/* ========================================
   YouTube Feed Section - Modern Design
   ======================================== */

.youtube-feed-section {
    padding: 5rem 0;
    background: #ffffff;
}

/* Section Header */
.youtube-feed-section .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.youtube-feed-section .section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.youtube-feed-section .section-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 700px;
    margin: 0 auto;
}

/* Video Grid */
.youtube-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Video Card */
.youtube-video-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-thumbnail:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-thumbnail:hover img {
    transform: scale(1.08);
}

/* Video Overlay */
.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-thumbnail:hover .video-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
}

/* Play Button */
.play-button {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #154D71;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.play-button svg {
    width: 32px;
    height: 32px;
    margin-left: 4px;
}

.video-thumbnail:hover .play-button {
    transform: scale(1.15);
    background: #154D71;
    color: white;
    box-shadow: 0 12px 32px rgba(21, 77, 113, 0.4);
}

/* Video Title */
.video-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.5;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.youtube-video-card:hover .video-title {
    color: #154D71;
}

/* Section CTA (Watch on YouTube button) */
.section-cta {
    text-align: center;
    margin-top: 3rem;
}

.btn-youtube {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #154D71;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(21, 77, 113, 0.3);
}

.btn-youtube:hover {
    background: #0f3d5a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(21, 77, 113, 0.4);
    color: white;
}

.btn-youtube svg {
    width: 24px;
    height: 24px;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.video-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Overlay */
.video-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
}

/* Modal Content - Desktop: Normal landscape, Mobile/Tablet: Shorts portrait */
.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px; /* Wide width for landscape format on desktop */
    z-index: 10000;
    transition: max-width 0.3s ease;
}

/* Desktop: All videos display as normal landscape */
.video-modal--short .video-modal-content,
.video-modal--regular .video-modal-content {
    max-width: 1200px;
}

/* Modal Close Button */
.video-modal-close {
    position: absolute;
    top: -55px;
    right: 0;
    width: 48px;
    height: 48px;
    background: #154D71;
    backdrop-filter: blur(10px);
    border: 2px solid #154D71;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.video-modal-close svg {
    width: 24px;
    height: 24px;
}

.video-modal-close:hover {
    background: #0f3d5a;
    transform: scale(1.1);
    border-color: #0f3d5a;
    box-shadow: 0 4px 12px rgba(21, 77, 113, 0.4);
}

[dir="rtl"] .video-modal-close {
    right: auto;
    left: 0;
}

/* Mobile RTL close button */
@media (max-width: 640px) {
    [dir="rtl"] .video-modal-close {
        align-self: flex-end;
        left: auto;
        right: auto;
    }

    .video-modal {
        align-items: center;
        padding-top: 5vh;
        padding-bottom: 5vh;
    }
}

/* Modal Iframe Wrapper - Desktop: Normal landscape (16:9), Mobile/Tablet: Shorts portrait (9:16) */
.video-modal-iframe-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio - normal landscape format for desktop */
    height: 0;
    max-height: none; /* No height limit for desktop landscape */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: padding-bottom 0.3s ease;
}

/* Desktop: All videos display as normal landscape (16:9) */
.video-modal--short .video-modal-iframe-wrapper,
.video-modal--regular .video-modal-iframe-wrapper {
    padding-bottom: 56.25%; /* 16:9 aspect ratio for landscape */
    max-height: none;
}

.video-modal-iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ======================================
   Responsive Design
   ====================================== */

/* Large Tablets - 2 Columns */
@media (max-width: 991px) {
    .youtube-feed-section {
        padding: 4rem 0;
    }

    .youtube-feed-section .section-title {
        font-size: 2rem;
    }

    .youtube-feed-section .section-subtitle {
        font-size: 1rem;
    }

    .youtube-videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .video-title {
        font-size: 1rem;
    }

    .play-button {
        width: 70px;
        height: 70px;
    }

    .play-button svg {
        width: 28px;
        height: 28px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .youtube-feed-section {
        padding: 3rem 0;
    }

    .youtube-feed-section .section-header {
        margin-bottom: 2rem;
    }

    .youtube-videos-grid {
        gap: 1.25rem;
        margin-bottom: 2rem;
    }

    .video-thumbnail {
        border-radius: 12px;
    }

    .play-button {
        width: 64px;
        height: 64px;
    }

    .play-button svg {
        width: 24px;
        height: 24px;
    }

    .btn-youtube {
        font-size: 1rem;
        padding: 0.875rem 1.75rem;
    }

    /* Tablet: All videos as shorts (portrait) */
    .video-modal-content {
        width: 92%;
        max-width: 420px; /* Force narrow width for all videos */
        height: auto;
        max-height: none;
        padding-top: 0;
    }

    /* Tablet: Force all videos to shorts format */
    .video-modal--short .video-modal-content,
    .video-modal--regular .video-modal-content {
        max-width: 420px;
    }

    .video-modal-close {
        width: 44px;
        height: 44px;
        font-size: 22px;
        top: -50px;
    }

    .video-modal-close svg {
        width: 22px;
        height: 22px;
    }

    /* Tablet: All videos display as shorts (portrait 9:16) */
    .video-modal-iframe-wrapper {
        padding-bottom: 177.78%; /* 9:16 aspect ratio for ALL videos */
        max-height: 85vh;
        height: 0;
    }

    /* Tablet: Force all videos to shorts aspect ratio */
    .video-modal--short .video-modal-iframe-wrapper,
    .video-modal--regular .video-modal-iframe-wrapper {
        padding-bottom: 177.78%; /* 9:16 aspect ratio */
        max-height: 85vh;
    }
}

/* Mobile - 1 Column */
@media (max-width: 640px) {
    .youtube-feed-section {
        padding: 2.5rem 0;
    }

    .youtube-feed-section .section-title {
        font-size: 1.75rem;
    }

    .youtube-feed-section .section-subtitle {
        font-size: 0.938rem;
    }

    .youtube-videos-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .video-title {
        font-size: 0.938rem;
    }

    .play-button {
        width: 56px;
        height: 56px;
    }

    .play-button svg {
        width: 20px;
        height: 20px;
    }

    .btn-youtube {
        font-size: 0.938rem;
        padding: 0.75rem 1.5rem;
    }

    .section-cta {
        margin-top: 2rem;
    }

    /* Mobile: All videos as shorts (portrait) */
    .video-modal-content {
        width: 95%;
        max-width: 400px; /* Force narrow width for all videos */
        height: auto;
        max-height: none;
        padding-top: 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    /* Mobile: Force all videos to shorts format */
    .video-modal--short .video-modal-content,
    .video-modal--regular .video-modal-content {
        max-width: 400px;
    }

    .video-modal-close {
        width: 48px;
        height: 48px;
        font-size: 22px;
        position: relative;
        top: 0;
        right: auto;
        left: auto;
        align-self: flex-end;
        margin-bottom: 0.5rem;
    }

    .video-modal-close svg {
        width: 20px;
        height: 20px;
    }

    /* Mobile: All videos display as shorts (portrait 9:16) */
    .video-modal-iframe-wrapper {
        padding-bottom: 177.78%; /* 9:16 aspect ratio for ALL videos */
        max-height: 85vh;
        height: 0;
        border-radius: 12px;
        width: 100%;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    }

    /* Mobile: Force all videos to shorts aspect ratio */
    .video-modal--short .video-modal-iframe-wrapper,
    .video-modal--regular .video-modal-iframe-wrapper {
        padding-bottom: 177.78%; /* 9:16 aspect ratio */
        max-height: 85vh;
        height: 0;
    }

    .video-modal-iframe-wrapper iframe {
        border-radius: 12px;
    }
}


@media (min-width: 1024px) {
    button.video-modal-close {
        position: absolute;
        left: -8vh !important;
        top: 1vh !important;
    }
}
.video-modal-close {
    background: #ca0b0b !important;
    border: none;
}