/**
 * ISSCA YouTube Grid - Netflix Style with Arrow Navigation
 * Version: 3.3.3
 */

/* ============================================
   BASE SECTION - BLACK BACKGROUND
   ============================================ */

.ISSCA-homepage-courses-section {
    background: #141414 !important;
    padding: 80px 0 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

.ISSCA-homepage-courses-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ============================================
   HEADER SECTION - CENTERED
   ============================================ */

.ISSCA-homepage-header {
    padding: 0 4%;
    margin: 0 auto 1.5rem;
    text-align: center;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ISSCA-homepage-main-heading {
    color: #ffffff !important;
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 auto 30px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-align: center !important;
    width: 100%;
    display: block;
}

.ISSCA-homepage-cta-buttons {
    margin: 0 auto;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ISSCA-homepage-btn {
    display: inline-block;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
    cursor: pointer;
    text-align: center;
}

.ISSCA-homepage-btn-primary {
    background: #e50914;
    color: #ffffff;
}

.ISSCA-homepage-btn-primary:hover {
    background: #f40612;
    transform: scale(1.05);
}

/* ============================================
   FEATURED VIDEOS SECTION
   ============================================ */

.ISSCA-featured-videos-section {
    margin: 20px 0 4rem;
    padding: 0;
    width: 100%;
}

.ISSCA-featured-videos-grid {
    display: flex;
    gap: 20px;
    padding: 0 4%;
    max-width: 100%;
}

.ISSCA-featured-video-card {
    position: relative;
    flex: 1;
    min-width: 0;
}

.ISSCA-featured-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.ISSCA-featured-video-card:hover .ISSCA-featured-video-wrapper {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}

.ISSCA-featured-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ISSCA-featured-video-wrapper.paused .ISSCA-featured-video-iframe {
    pointer-events: none;
}

/* ============================================
   CAROUSEL SECTION
   ============================================ */

.ISSCA-carousel-section {
    margin-bottom: 2rem;
    position: relative;
}

.ISSCA-carousel-title {
    color: #e5e5e5 !important;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px 4%;
    padding: 0;
}

.ISSCA-carousel-wrapper {
    position: relative;
    padding: 0 60px;
}

/* ============================================
   CAROUSEL ARROWS - ALWAYS VISIBLE CIRCLES
   ============================================ */

.ISSCA-carousel-arrow {
    position: absolute;
    top: 30%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.ISSCA-carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.ISSCA-carousel-arrow-left {
    left: 0;
}

.ISSCA-carousel-arrow-right {
    right: 0;
}

.ISSCA-carousel-arrow svg {
    width: 20px;
    height: 20px;
}

.ISSCA-carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.2);
}

.ISSCA-carousel-arrow:disabled:hover {
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
}

/* ============================================
   CAROUSEL CONTAINER
   ============================================ */

.ISSCA-carousel-container {
    overflow: hidden;
    position: relative;
    padding: 0;
}

.ISSCA-carousel-track {
    display: flex;
    gap: 12px;
    transition: transform 0.6s cubic-bezier(0.5, 0, 0.1, 1);
    will-change: transform;
}

/* ============================================
   VIDEO CARDS - BIGGER SIZE
   ============================================ */

.ISSCA-video-card {
    flex: 0 0 calc(20% - 9.6px);
    min-width: calc(20% - 9.6px);
    position: relative;
    transition: transform 0.3s ease;
}

.ISSCA-video-card:hover {
    transform: scale(1.1);
    z-index: 10;
}

.ISSCA-video-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ============================================
   VIDEO THUMBNAIL - BIGGER IMAGES
   ============================================ */

.ISSCA-video-thumbnail {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: #2a2a2a;
    aspect-ratio: 4.5 / 2.8 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.ISSCA-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ISSCA-video-card:hover .ISSCA-video-thumbnail {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}

.ISSCA-video-card:hover .ISSCA-video-thumbnail img {
    transform: scale(1.05);
}

/* ============================================
   PLAY OVERLAY
   ============================================ */

.ISSCA-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

.ISSCA-video-card:hover .ISSCA-play-overlay {
    opacity: 1;
}

.ISSCA-play-overlay svg {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
}

/* ============================================
   VIDEO INFO
   ============================================ */

.ISSCA-video-info {
    padding: 12px 4px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    height: 7.5rem;
}

.ISSCA-video-card:hover .ISSCA-video-info {
    opacity: 1;
}

.ISSCA-video-title {
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.ISSCA-video-category {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 12px;
    margin: 0;
    font-weight: 400;
}

/* ============================================
   RESPONSIVE - LARGE SCREENS
   ============================================ */

@media (min-width: 1800px) {
    .ISSCA-video-card {
        flex: 0 0 calc(16.66% - 10px);
        min-width: calc(16.66% - 10px);
    }
}

@media (min-width: 1400px) and (max-width: 1799px) {
    .ISSCA-video-card {
        flex: 0 0 calc(20% - 9.6px);
        min-width: calc(20% - 9.6px);
    }
}

@media (max-width: 1399px) {
    .ISSCA-video-card {
        flex: 0 0 calc(25% - 9px);
        min-width: calc(25% - 9px);
    }

    .ISSCA-carousel-title {
        font-size: 24px;
    }

    .ISSCA-homepage-main-heading {
        font-size: 3rem;
    }
}

/* ============================================
   RESPONSIVE - MEDIUM SCREENS
   ============================================ */

@media (max-width: 1100px) {
    .ISSCA-video-card {
        flex: 0 0 calc(33.33% - 8px);
        min-width: calc(33.33% - 8px);
    }

    .ISSCA-homepage-main-heading {
        font-size: 2.5rem;
    }

    .ISSCA-carousel-arrow {
        width: 38px;
        height: 38px;
    }

    .ISSCA-carousel-arrow svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 900px) {
    .ISSCA-video-card {
        flex: 0 0 calc(50% - 6px);
        min-width: calc(50% - 6px);
    }

    .ISSCA-carousel-title {
        font-size: 22px;
    }

    .ISSCA-homepage-main-heading {
        font-size: 2.25rem;
    }

    .ISSCA-carousel-arrow {
        width: 36px;
        height: 36px;
    }

    .ISSCA-carousel-arrow svg {
        width: 16px;
        height: 16px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .ISSCA-homepage-courses-section {
        padding: 50px 0 !important;
    }

    .ISSCA-homepage-header {
        padding: 0 20px;
        margin-bottom: 50px;
    }

    .ISSCA-homepage-main-heading {
        font-size: 2rem;
    }

    .ISSCA-homepage-btn {
        padding: 14px 32px;
        font-size: 16px;
    }

    /* Featured Videos - Mobile: 1 per row, no padding */
    .ISSCA-featured-videos-section {
        margin-top: 20px;
        margin-bottom: 0;
        padding: 0;
    }

    .ISSCA-featured-videos-grid {
        flex-direction: column;
        gap: 24px;
        padding: 0;
    }

    .ISSCA-featured-video-card:hover .ISSCA-featured-video-wrapper {
        transform: none;
    }

    .ISSCA-carousel-wrapper {
        padding: 0;
    }

    .ISSCA-carousel-title {
        font-size: 20px;
        margin-left: 0;
        margin-right: 20px;
    }

    .ISSCA-carousel-container {
        padding: 0;
        overflow: hidden; /* Prevent showing partial 4th card */
    }

    .ISSCA-carousel-track {
        padding: 0 20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
    }

    .ISSCA-carousel-track::-webkit-scrollbar {
        display: none;
    }

    .ISSCA-video-card {
        flex: 0 0 300px;
        min-width: 300px;
        scroll-snap-align: start;
    }

    .ISSCA-video-card:hover {
        transform: none;
    }

    .ISSCA-carousel-arrow {
        display: none;
    }

    .ISSCA-video-info {
        opacity: 1;
    }

    .ISSCA-play-overlay {
        opacity: 0.8;
    }

    .ISSCA-video-title {
        font-size: 15px;
    }

    /* ============================================
       HARDCODED TEMPLATE - VERTICAL MOBILE IMAGES
       ============================================ */

    .ISSCA-video-card-hardcoded {
        min-width: calc(35% - 6.67px);
        max-width: calc(35% - 6.67px);
    }

    .ISSCA-video-card-hardcoded .ISSCA-video-thumbnail {
        aspect-ratio: auto !important;
        height: 205px !important;
        min-height: 205px;
        max-height: 205px;
    }

    /* Hide titles and categories on mobile for hardcoded template */
    .ISSCA-video-card-hardcoded .ISSCA-video-info {
        display: none !important;
    }

    /* Ensure exactly 3 videos show on mobile for hardcoded */
    .ISSCA-carousel-section .ISSCA-carousel-container {
        max-width: 100vw;
        overflow: hidden;
    }

    .ISSCA-video-card-hardcoded {
        scroll-snap-align: start;
    }
}

@media (max-width: 480px) {
    .ISSCA-homepage-main-heading {
        font-size: 1.75rem;
    }

    .ISSCA-video-card {
        flex: 0 0 260px;
        min-width: 260px;
    }

    .ISSCA-carousel-title {
        font-size: 18px;
    }

    .ISSCA-video-title {
        font-size: 14px;
    }

    .ISSCA-video-category {
        font-size: 12px;
    }

    .ISSCA-video-card-hardcoded {
        min-width: calc(35% - 6.67px);
        max-width: calc(35% - 6.67px);
    }

    .ISSCA-video-card-hardcoded .ISSCA-video-thumbnail {
        height: 205px !important;
        min-height: 205px;
        max-height: 205px;
    }

    /* Featured Videos - Smaller gap on small screens */
    .ISSCA-featured-videos-grid {
        gap: 20px;
    }
}

/* ============================================
   YOUTUBE MODAL
   ============================================ */

.youtube-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.youtube-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.youtube-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.youtube-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 1000000;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.youtube-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 42px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.9;
    line-height: 1;
    padding: 0;
}

.youtube-modal-close:hover {
    opacity: 1;
    transform: scale(1.15) rotate(90deg);
}

.youtube-modal-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.youtube-modal-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .youtube-modal-content {
        width: 95%;
    }

    .youtube-modal-close {
        top: -45px;
        font-size: 38px;
    }
}

/* ============================================
   UTILITY & ACCESSIBILITY
   ============================================ */

body.youtube-modal-open {
    overflow: hidden;
}

.ISSCA-video-link:focus,
.ISSCA-carousel-arrow:focus {
    outline: 3px solid #e50914;
    outline-offset: 3px;
}

.youtube-modal-close:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }

    .ISSCA-video-card:hover {
        transform: none;
    }

    .youtube-modal-close:hover {
        transform: none;
    }
}

/* ============================================
   HARDCODED TEMPLATE - RESPONSIVE IMAGES
   ============================================ */

/* Base styles for both images */
.ISSCA-desktop-image,
.ISSCA-mobile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Desktop: Show desktop image, hide mobile image */
@media (min-width: 769px) {
    .ISSCA-desktop-image {
        display: block !important;
    }

    .ISSCA-mobile-image {
        display: none !important;
    }

    .ISSCA-video-card-hardcoded .ISSCA-video-thumbnail {
        aspect-ratio: 4.5 / 2.8 !important;
    }
}

/* Mobile: Hide desktop image, show mobile image */
@media (max-width: 768px) {
    .ISSCA-desktop-image {
        display: none !important;
    }

    .ISSCA-mobile-image {
        display: block !important;
    }
}
