/* ==========================================================================
   home-carousel-v5.css
   Verzió: 5.1
   ========================================================================== */

/* ==========================================================================
   1. ALAPBEÁLLÍTÁSOK ÉS KONTÉNER
   ========================================================================== */

.carousel-section,
.carousel-section * {
    font-size: inherit;
    line-height: inherit;
    box-sizing: border-box;
}

.carousel-section {
    padding: 30px 40px;
    position: relative;
    overflow: hidden; /* Megakadályozza az oldalirányú scrollbar villogását */
}

.carousel-section h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #f5f5f7;
    font-weight: 700;
    letter-spacing: -0.015em;
}

/* Scroll Container */
.carousel-section .carousel-container {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-top: 20px;
    padding-bottom: 40px;
}

.carousel-section .carousel-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.carousel-section .carousel-container {
    padding-left: 20px;
}

.google-ad-wrapper { 
    margin: 2rem auto; 
    text-align: center; 
}

/* ==========================================================================
   2. KÁRTYA STÍLUSOK (Apple TV - 16:9)
   ========================================================================== */

.carousel-section .carousel-item {
    position: relative;
    display: block;
    flex: 0 0 auto;
    scroll-snap-align: start;
    text-align: left;
    width: 400px;
    height: 225px;
    border-radius: 12px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
    background-color: #1c1c1e;
    cursor: pointer;
    overflow: hidden;
}

.carousel-section .carousel-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.carousel-section .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    background-color: #1c1c1e;
}

/* Teljes kártya link (Overlay alatt) */
.carousel-section .carousel-item .card-main-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    text-decoration: none;
    border: none;
    border-radius: 12px;
}


/* ==========================================================================
   3. OVERLAY ÉS META ADATOK
   ========================================================================== */

/* Cím Overlay (Gradiens) */
.carousel-item .item-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 40%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px 18px;
    pointer-events: none; /* Átengedjük a kattintást */
    z-index: 4;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.carousel-item .item-title-overlay h3 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
    margin: 0;
}

/* Meta sor (Évszám, Időtartam, Gombok) */
.carousel-item .item-meta-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 6px;
    pointer-events: auto; /* Gombok miatt kell */
}

.carousel-item .meta-left {
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.carousel-item .meta-left i {
    font-size: 1rem;
    color: #fff;
    vertical-align: middle;
}

.carousel-item .meta-sep {
    opacity: 0.6;
    font-size: 0.7rem;
    margin: 0 2px;
}


/* ==========================================================================
   4. INTERAKTÍV GOMBOK (Trailer, Info)
   ========================================================================== */

.carousel-item .meta-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

/* Object tag fix (ha van) */
.carousel-item .meta-actions object {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    margin: 0;
    padding: 0;
}

/* Egységes köralakú gomb stílus */
.carousel-item .meta-btn {
    color: #fff !important;
    font-size: 1.4rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all 0.2s ease;
    position: relative; 
    z-index: 20;
    
    /* Fix méretek */
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    border-radius: 50%;
    
    /* Háttér */
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
    box-sizing: border-box;
    margin: 0;
}

.carousel-item .meta-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.3);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.carousel-item .meta-btn i {
    line-height: 1;
    display: block;
}

.carousel-item .trailer-btn {
    display: none; /* JS kapcsolja be */
    cursor: pointer;
}


/* ==========================================================================
   5. SPECIÁLIS BADGE-EK (Rank, Translation)
   ========================================================================== */

/* Translation Badge (Jobb felső) */
.carousel-item .translation-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    font-weight: 800;
    padding: 3px 6px;
    font-size: 0.5rem;
    z-index: 6;
    text-transform: uppercase;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

/* Top 10 Rank Badge (Bal felső, kilógó) */
.top10-carousel .carousel-item {
    overflow: visible;
}

.top10-carousel .carousel-item .rank-badge {
    position: absolute;
    top: 0px;
    left: 0px;
    font-size: 70px;
    font-weight: 900;
    color: #f5f5f7;
    text-shadow: 2px 4px 12px rgba(0,0,0,0.9);
    z-index: 7;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    pointer-events: none;
    line-height: 1;
    padding-left: 10px;
}

.top10-carousel .item-title-overlay {
    padding-left: 18px; 
}


/* ==========================================================================
   6. "FOLYTASD, AHOL ABBAHAGYTAD" SPECIFIKUS STÍLUSOK
   (Progress bar, Next Episode, Remove)
   ========================================================================== */

/* Info box (csak ebben a szekcióban) */
#recently-viewed-carousel .sn-card-info-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    z-index: 5;
    pointer-events: none;
}

#recently-viewed-carousel .sn-card-info-box h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

#recently-viewed-carousel .last-watched-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

/* Progress Bar */
#recently-viewed-carousel .sn-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin-top: 8px;
}

#recently-viewed-carousel .sn-progress-bar {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* --- ACTION BUTTONS CONTAINER (Jobb felső sarok) --- */
#recently-viewed-carousel .card-top-right-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    flex-direction: row-reverse; /* X a szélen, Nyíl mellette */
    gap: 8px;
    opacity: 0; /* Alapból rejtett */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#recently-viewed-carousel .carousel-item:hover .card-top-right-actions {
    opacity: 1; /* Hoverre megjelenik */
}

/* --- KÖVETKEZŐ RÉSZ GOMB (Nyíl) --- */
#recently-viewed-carousel .next-episode-link {
    width: 28px;
    height: 28px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#recently-viewed-carousel .next-episode-link:hover {
    background-color: hsl(228, 70%, 63%); /* Kék kiemelés */
    transform: scale(1.15);
}

#recently-viewed-carousel .next-episode-link i {
    font-size: 20px;
    line-height: 1;
}

/* --- TÖRLÉS GOMB (X) --- */
#recently-viewed-carousel .remove-from-list {
    position: relative; /* Container miatt relative */
    width: 28px;
    height: 28px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#recently-viewed-carousel .remove-from-list:hover {
    background-color: #e50914; /* Piros kiemelés */
    transform: scale(1.15) rotate(90deg);
}

#recently-viewed-carousel .remove-from-list::before,
#recently-viewed-carousel .remove-from-list::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background-color: #fff;
    transform-origin: center;
}

#recently-viewed-carousel .remove-from-list::before { transform: translate(-50%, -50%) rotate(45deg); }
#recently-viewed-carousel .remove-from-list::after { transform: translate(-50%, -50%) rotate(-45deg); }


/* ==========================================================================
   7. SPECIÁLIS KARUSSZELEK (Színészek, Fordítók)
   ========================================================================== */

.carousel-section.actors-carousel .carousel-item,
.carousel-section.translators-carousel .carousel-item {
    width: 160px !important;
    height: auto !important;
    background: transparent;
    box-shadow: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
}

.carousel-section.actors-carousel .carousel-item:hover,
.carousel-section.translators-carousel .carousel-item:hover {
    transform: scale(1.05);
    box-shadow: none;
}

.carousel-container#actors-carousel img,
.carousel-container#translators-carousel img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 3px solid rgba(255,255,255,0.1);
    object-fit: cover;
}

.carousel-section.actors-carousel p,
.carousel-section.translators-carousel p {
    color: #f5f5f7;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: none;
    margin-top: 5px;
}


/* ==========================================================================
   8. NAVIGÁCIÓ (Nyilak)
   ========================================================================== */

.carousel-arrow {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    font-family: 'Material Icons';
    font-size: 3rem;
    color: rgba(255,255,255,0.8);
    padding: 10px;
    cursor: pointer;
    z-index: 20;
    display: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.carousel-arrow:hover { 
    transform: translateY(-50%) scale(1.1); 
    color: #fff; 
}

.carousel-section:hover .carousel-arrow { 
    display: block; 
}

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


/* ==========================================================================
   9. LIGHTBOX (Trailer)
   ========================================================================== */

.trailer-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.trailer-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.trailer-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.trailer-content video {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    outline: none;
}

.trailer-close {
    position: absolute;
    top: -40px;
    right: -10px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    transition: transform 0.2s;
}

.trailer-close:hover {
    transform: scale(1.2) rotate(90deg);
}


/* ==========================================================================
   10. RESPONSIVE / MEDIA QUERIES
   ========================================================================== */

/* --- Tablet / Kis Laptop (max 1024px) --- */
@media screen and (max-width: 1024px) {
    .carousel-section {
        padding: 25px 30px;
    }

    .carousel-section .carousel-item {
        width: 340px;
        height: 191px;
    }

    /* Érintőképernyőn nincs hover effekt */
    .carousel-section .carousel-item:hover {
        transform: none;
        z-index: initial;
    }
    
    /* Gombok mindig láthatók legyenek érintőn? (Opcionális) */
    #recently-viewed-carousel .card-top-right-actions {
        opacity: 1;
    }

    .carousel-arrow {
        display: none !important;
    }
}

/* --- Mobil Fekvő / Nagy Mobil (max 768px) --- */
@media screen and (max-width: 768px) {
    .carousel-section {
        padding: 20px 0 20px 20px;
        overflow: hidden;
    }

    .carousel-section h2 {
        font-size: 1.25rem;
        margin-bottom: 15px;
        margin-right: 20px;
    }

    .carousel-section .carousel-container {
        padding: 10px 20px 30px 0;
        gap: 16px;
        scroll-padding-left: 20px;
    }

    /* Kártya méretek mobilra */
    .carousel-section .carousel-item,
    .carousel-section.country-carousel .carousel-item,
    .daily-recommendations-carousel .carousel-item {
        width: 280px !important;
        height: 158px !important;
        border-radius: 10px;
    }

    .carousel-section .carousel-item img {
        border-radius: 10px;
    }

    .carousel-item .item-title-overlay {
        height: 80%;
        padding: 12px 14px;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
    }

    .carousel-item .item-title-overlay h3 {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    /* Meta sor */
    .carousel-item .item-meta-row {
        margin-top: 4px;
        font-size: 0.7rem;
    }

    .carousel-item .meta-left {
        font-size: 0.7rem;
        gap: 4px;
    }
    
    .carousel-item .meta-left i {
        font-size: 0.85rem;
    }

    .carousel-item .meta-actions {
        gap: 8px;
    }

    /* Gombok mobil méret */
    .carousel-item .meta-btn,
    .carousel-item .meta-actions object {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px;
        font-size: 1.2rem;
        border-width: 1.5px;
    }

    /* Speciális karusszelek mobil */
    .carousel-section.actors-carousel .carousel-item, 
    .carousel-section.translators-carousel .carousel-item {
        width: 110px !important;
    }

    .carousel-container#actors-carousel img, 
    .carousel-container#translators-carousel img {
        width: 110px;
        height: 110px;
        border-width: 2px;
        margin-bottom: 8px;
    }
    
    .carousel-section.actors-carousel p, 
    .carousel-section.translators-carousel p {
        font-size: 0.8rem;
    }

    /* Badges mobil */
    .top10-carousel .carousel-item .rank-badge {
        font-size: 50px;
        top: -5px;
        left: -2px;
    }

    .top10-carousel .item-title-overlay {
        padding-left: 14px;
    }

    .carousel-item .translation-badge {
        top: 8px;
        right: 8px;
        font-size: 0.45rem;
        padding: 2px 5px;
    }

    /* Trailer Lightbox mobil */
    .trailer-content {
        width: 100%;
        border-radius: 0;
    }
    .trailer-content video { border-radius: 0; }
    .trailer-close {
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        padding: 5px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* --- Mobil Álló (max 480px) --- */
@media screen and (max-width: 480px) {
    .carousel-section {
        padding: 15px 0 15px 15px;
    }

    .carousel-section h2 {
        font-size: 1.1rem;
    }

    /* Képernyőarányos méretezés */
    .carousel-section .carousel-item {
        width: 75vw !important;
        height: 42.18vw !important; /* 16:9 arány */
    }

    .carousel-section .carousel-container {
        gap: 12px;
        padding-bottom: 20px;
        scroll-padding-left: 15px;
    }
    
    .carousel-item .meta-btn,
    .carousel-item .meta-actions object {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px;
        font-size: 1rem;
    }
}

/* Ha a tartalom elfér a képernyőn (nincs görgetés) */
.carousel-section .carousel-container.fits-screen {
    overflow-x: visible !important; /* Engedjük kilógni a nagyítást */
    padding-left: 0 !important;     /* Nem kell a belső margó */
    margin-left: 0 !important;      /* Nem kell a kompenzáló margó */
    justify-content: flex-start;    /* Balra igazítás */
}

/* Ha a szekción van 'no-scroll' osztály, a nyilak tűnjenek el (még hoverre se jöjjenek elő) */
.carousel-section.no-scroll .carousel-arrow {
    display: none !important;
}