/* YouTube Preview Component Styles */
/* Ultra-modern glassmorphism YouTube video preview with overlap positioning */

:root {
    --youtube-gradient-start: #ff0000;
    --youtube-gradient-end: #cc0000;
    --youtube-overlay: rgba(0, 0, 0, 0.4);
    --youtube-hover-overlay: rgba(0, 0, 0, 0.2);
    --youtube-play-bg: rgba(255, 255, 255, 0.98);
    --youtube-play-hover: rgba(138, 43, 226, 1);
    --youtube-play-icon: #8a2be2;
    --youtube-play-icon-hover: #ffffff;
    --youtube-text-primary: #ffffff;
    --youtube-text-secondary: rgba(255, 255, 255, 0.9);
    --youtube-border-radius: 24px;
    --youtube-shadow: 0 20px 60px rgba(138, 43, 226, 0.4);
    --youtube-shadow-hover: 0 30px 80px rgba(138, 43, 226, 0.6);
    --youtube-glass-bg: rgba(138, 43, 226, 0.1);
    --youtube-glass-border: rgba(138, 43, 226, 0.3);
    --youtube-purple-glow: rgba(138, 43, 226, 0.5);
}

/* Overlap Container - Positions video between header and content */
.youtube-overlap-container {
    position: relative;
    margin-top: -200px;
    z-index: 100;
    padding: 0 20px;
}

.youtube-overlap-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

/* Base Card Styles - Ultra-modern Purple Glassmorphism */
.youtube-preview-card {
    position: relative;
    width: 100%;
    margin: 0 auto;
    border-radius: var(--youtube-border-radius);
    overflow: hidden;
    box-shadow: var(--youtube-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.85) 0%, rgba(138, 43, 226, 0.75) 50%, rgba(148, 0, 211, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--youtube-glass-border);
}

.youtube-preview-card:hover {
    box-shadow: var(--youtube-shadow-hover);
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(186, 85, 211, 0.6);
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.9) 0%, rgba(138, 43, 226, 0.85) 50%, rgba(148, 0, 211, 0.9) 100%);
}

.youtube-preview-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Thumbnail Styles */
.youtube-preview-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    cursor: pointer;
    overflow: hidden;
    background: #000;
}

.youtube-preview-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.youtube-preview-thumbnail:hover img {
    transform: scale(1.08);
}

.youtube-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--youtube-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.youtube-preview-thumbnail:hover .youtube-preview-overlay {
    background: var(--youtube-hover-overlay);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

/* Play Button - Ultra-modern with ring animation */
.youtube-play-button {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--youtube-play-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(255, 0, 0, 0.7);
    position: relative;
}

.youtube-play-button::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 3px solid rgba(186, 85, 211, 0.5);
    animation: ringPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes ringPulse {
    0% {
        transform: scale(0.9);
        opacity: 1;
        border-color: rgba(186, 85, 211, 0.6);
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
        border-color: rgba(138, 43, 226, 0.2);
    }
}

.youtube-play-button svg {
    width: 40px;
    height: 40px;
    color: var(--youtube-play-icon);
    margin-left: 4px;
    transition: all 0.3s ease;
}

.youtube-preview-thumbnail:hover .youtube-play-button {
    background: var(--youtube-play-hover);
    transform: scale(1.15);
    box-shadow: 0 12px 40px rgba(138, 43, 226, 0.8), 0 0 0 8px rgba(138, 43, 226, 0.3);
}

.youtube-preview-thumbnail:hover .youtube-play-button svg {
    color: var(--youtube-play-icon-hover);
}

@keyframes pulsePlay {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(138, 43, 226, 0.6), 0 0 0 0 rgba(138, 43, 226, 0.7);
    }
    50% {
        box-shadow: 0 12px 48px rgba(138, 43, 226, 0.8), 0 0 0 8px rgba(138, 43, 226, 0.4);
    }
}

/* Iframe Wrapper */
.youtube-preview-iframe-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.youtube-preview-iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Content Section - Purple Glassmorphism styling */
.youtube-preview-content {
    padding: 32px;
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.9) 0%, rgba(106, 13, 173, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
}

.youtube-preview-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(186, 85, 211, 0.6), transparent);
}

.youtube-preview-category {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.8), rgba(186, 85, 211, 0.8));
    color: var(--youtube-text-primary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid rgba(186, 85, 211, 0.4);
}

.youtube-preview-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--youtube-text-primary);
    margin: 12px 0;
    line-height: 1.3;
}

.youtube-preview-description {
    font-size: 16px;
    color: var(--youtube-text-secondary);
    line-height: 1.6;
    margin: 12px 0;
}

.youtube-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.youtube-preview-tag {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--youtube-text-secondary);
    font-size: 13px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.youtube-preview-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--youtube-text-primary);
}

.youtube-preview-duration {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--youtube-text-secondary);
    margin: 12px 0;
}

.youtube-preview-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.9), rgba(186, 85, 211, 0.9));
    color: var(--youtube-text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(186, 85, 211, 0.5);
}

.youtube-preview-cta:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(138, 43, 226, 0.6);
    color: var(--youtube-text-primary);
    background: linear-gradient(135deg, rgba(138, 43, 226, 1), rgba(186, 85, 211, 1));
}

/* Card Style Variants */

/* Featured Style - Large hero-style card */
.youtube-preview-card.featured {
    max-width: 100%;
}

.youtube-preview-card.featured .youtube-preview-content {
    padding: 32px;
}

.youtube-preview-card.featured .youtube-preview-title {
    font-size: 32px;
}

.youtube-preview-card.featured .youtube-preview-description {
    font-size: 18px;
}

/* Card Style - Standard card for grids */
.youtube-preview-card.card {
    max-width: 100%;
}

/* Compact Style - Horizontal layout for sidebars */
.youtube-preview-card.compact .youtube-preview-container {
    flex-direction: row;
}

.youtube-preview-card.compact .youtube-preview-thumbnail,
.youtube-preview-card.compact .youtube-preview-iframe-wrapper {
    width: 40%;
    padding-bottom: 0;
    min-height: 180px;
}

.youtube-preview-card.compact .youtube-preview-content {
    width: 60%;
    padding: 16px;
}

.youtube-preview-card.compact .youtube-preview-title {
    font-size: 18px;
}

.youtube-preview-card.compact .youtube-preview-description {
    font-size: 14px;
}

/* Hero Style - Full-width banner */
.youtube-preview-card.hero {
    max-width: 100%;
    border-radius: 0;
}

.youtube-preview-card.hero .youtube-preview-content {
    padding: 48px;
    text-align: center;
}

.youtube-preview-card.hero .youtube-preview-title {
    font-size: 42px;
}

.youtube-preview-card.hero .youtube-play-button {
    width: 100px;
    height: 100px;
    animation: heroGlow 2s infinite;
}

@keyframes heroGlow {
    0%, 100% {
        box-shadow: 0 0 40px rgba(255, 0, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 0, 0, 0.8);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .youtube-overlap-container {
        margin-top: -150px;
    }

    .youtube-preview-card.featured .youtube-preview-title {
        font-size: 24px;
    }

    .youtube-preview-card.featured .youtube-preview-content {
        padding: 20px;
    }
    
    .youtube-preview-card.hero .youtube-preview-title {
        font-size: 28px;
    }
    
    .youtube-preview-card.hero .youtube-preview-content {
        padding: 24px;
    }
    
    .youtube-preview-card.compact .youtube-preview-container {
        flex-direction: column;
    }
    
    .youtube-preview-card.compact .youtube-preview-thumbnail,
    .youtube-preview-card.compact .youtube-preview-iframe-wrapper,
    .youtube-preview-card.compact .youtube-preview-content {
        width: 100%;
    }
    
    .youtube-play-button {
        width: 60px;
        height: 60px;
    }
    
    .youtube-play-button svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .youtube-overlap-container {
        margin-top: -120px;
        padding: 0 10px;
    }

    .youtube-preview-content {
        padding: 16px;
    }

    .youtube-preview-title {
        font-size: 20px;
    }

    .youtube-preview-description {
        font-size: 14px;
    }

    .youtube-preview-cta {
        width: 100%;
        justify-content: center;
    }

    .youtube-play-button {
        width: 70px;
        height: 70px;
    }

    .youtube-play-button svg {
        width: 32px;
        height: 32px;
    }
}

/* Print Styles */
@media print {
    .youtube-preview-card {
        display: none;
    }
}
