/* ---- Translation status badge (top‑left corner) ---- */
.carousel-item .translation-badge {
    position: absolute;
    top: 0px;
    left: 0px;
    background: #fff;
    color: #000;
    font-weight: 600;
    padding: 4px 8px;
    font-size: 0.6rem;
    z-index: 6;
    text-transform: uppercase;
    border-radius: 8px 0 0 0;
}
.carousel-section {
    padding: 20px;
    position: relative;
}

.carousel-section h2 {
    margin-bottom: 10px;
    font-size: 1.6em;
    color: white;
    font-weight: 600;
}

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

.carousel-section .carousel-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
}

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

.carousel-section .carousel-item {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-width: 200px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    text-align: center;
    overflow: hidden;
    width: 350px; /* ÚJ */
    height: 525px; /* ÚJ */
    border-radius: 8px;
}

.carousel-container#actors-carousel img,
.carousel-container#translators-carousel img {
    width: 190px;
    height: 190px;
}

.carousel-section.actors-carousel .carousel-item,
.carousel-section.translators-carousel .carousel-item {
    width: 250px !important;
    height: 250px !important;
}

.carousel-section.country-carousel .carousel-item,
.carousel-section.country-carousel-movies .carousel-item,
.carousel-section.all-categories .carousel-item {
    width: 400px !important;
    height: 225px !important;
}

.top10-carousel .carousel-item {
    margin-left: 100px !important;      /* increased spacing so posters sit more to the right */
    position: relative;     /* allow absolutely‑positioned rank badge */
    overflow: visible;   /* allow rank badge to extend outside the item */
}

/* ----- Top‑10: keep first rank number visible on snap ----- */
.top10-carousel .carousel-container {
    scroll-padding-left: 100px; /* match the item margin-left to preserve the blank space on snap */
}

.top10-carousel .carousel-item img {
    width: 350px;
    height: 525px;
    border-radius: 8px;
}

.carousel-section .carousel-item img {
    width: 350px;
    height: 525px;
}

/* Nincs szükség a kép zoomolására, ha az overlay megjelenik */
.carousel-section .carousel-item:hover img {
    transform: scale(1.0);
}

.carousel-section.actors-carousel .carousel-item img:hover {
    transform: scale(1.0);
}

.carousel-section.translators-carousel .carousel-item img:hover {
    transform: scale(1.0);
}

.carousel-section .rank-badge {
    font-size: 160px;
    font-weight: bold;
    color: #ccc;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: "Lexend Deca", Arial, sans-serif;
    align-self: flex-end;
    margin-bottom: -10px;
    margin-right: -25px;
    line-height: 0.9;
    z-index: 3;
    transform: perspective(600px) rotateY(10deg);
    transition: transform 0.5s ease, text-shadow 0.5s ease;
}

.carousel-section .carousel-item:hover .rank-badge {
    transform: perspective(600px) rotateY(0deg) scale(1.05);
    text-shadow:
        1px 1px 1px #aaa,
        2px 2px 1px #999,
        3px 3px 2px #888,
        4px 4px 2px #777,
        5px 5px 3px rgba(0, 0, 0, 0.7);
}

.carousel-section .carousel-item a {
    display: block; /* Módosítva inline-block-ról */
    width: 100%;    /* ÚJ */
    height: 100%;   /* ÚJ */
    z-index: 4;
    display: inline-block;
    padding: 0;
    border: none;
    transition: none;
}

.carousel-section .carousel-item a:hover {
    background-color: transparent;
}

.carousel-section .rank-badge.tight {
    letter-spacing: -30px;
}

.top10-carousel .carousel-item .rank-badge {
    position: absolute;
    z-index: 2;
    left: -70px !important;
    bottom: -10px;
    margin: 0;
    pointer-events: none;
}

.top10-carousel .carousel-item .rank-badge.tight {
    left: -100px;
}

.top10-carousel .carousel-item a {
    display: block;
    overflow: hidden;
}

.carousel-section .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Material Icons';
    font-size: 48px;
    color: white;
    padding: 10px;
    cursor: pointer;
    display: none;
    z-index: 10;
}

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

.carousel-section .carousel-arrow.left { left: 0; }
.carousel-section .carousel-arrow.right { right: 0; }
.google-ad-wrapper { margin: 2rem auto; text-align: center; }


/* -------- MÓDOSÍTOTT OVERLAY STÍLUSOK -------- */

.carousel-item .overlay {
    position: absolute;
    inset: 0;
    background: #000; /* Szolid fekete háttér */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* A tartalom fentről lefelé építkezik */
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
    border-radius: 8px;
}

/* Az overlay megjelenítése hover állapotban */
.carousel-item:hover .overlay {
    opacity: 1;
    pointer-events: auto;
}

/* A videó konténere az overlay-en belül - MÓDOSÍTVA */
.carousel-item .video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%; /* Ez hozza létre a 16:9 képarányt (9 / 16 * 100) */
    background-color: #111;
    flex-shrink: 0; /* Megakadályozza, hogy a flexbox elrendezés összenyomja */
}

/* JAVÍTOTT SZABÁLY */
.carousel-item .video-container > video,
.carousel-item .video-container > img.poster-fallback-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 25%;
}

.carousel-item .video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-item .video-container img.poster-fallback-image {
    max-width: 100%;
    max-height: 100%;

}

/* A videó vezérlői */
.carousel-item .video-controls {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 10;
    display: flex; /* Gombok egymás mellett */
    gap: 8px;      /* Térköz a gombok között */
}

.carousel-item .volume-toggle,
.carousel-item .fullscreen-toggle {
    cursor: pointer;
    color: white;
    font-size: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    transition: transform 0.2s ease;
}

.carousel-item .volume-toggle:hover,
.carousel-item .fullscreen-toggle:hover {
    transform: scale(1.15);
}

/* Újraindító gomb a videó közepén */
.carousel-item .replay-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.2s ease;
}

.carousel-item .replay-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-item .replay-button i {
    font-size: 40px;
    color: white;
    line-height: 1;
}

.overlay-buttons a {
    border-radius: 5px;
}

/* Szöveges tartalom és gombok konténere */
.carousel-item .overlay-content {
    padding: 1rem;
    text-align: left;
    width: 100%;
    flex-grow: 1; /* Kitölti a maradék helyet a videó alatt */
    display: flex;
    flex-direction: column;
}

.carousel-item .overlay-content h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #fff;
}

.carousel-item .overlay-content p {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    color: #bbb;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Max 3 sornyi leírás */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Gombok konténere */
.carousel-item .overlay-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    margin-top: auto; /* A gombokat a konténer aljára tolja */
}

.carousel-item .overlay-buttons a,
.carousel-item .overlay-buttons .um-bookmarks-button a {
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    background: hsla(0, 0%, 100%, 0.15);
    font-weight: 600;
    display: flex; /* Flex a belső ikon és szöveg igazításához */
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    flex-grow: 1; /* A gombok egyenlő arányban töltik ki a helyet */
}

.carousel-item a.overlay-link {
    padding: 10px !important;
}

.carousel-item .overlay-bookmark a {
    padding: 7px 10px !important;
}

.carousel-item .overlay-buttons a:hover,
.carousel-item .overlay-buttons .um-bookmarks-button a:hover {
    background: hsla(0, 0%, 100%, 0.25);
}

.carousel-item .overlay-bookmark {
    margin-top: 0;
}

.carousel-item i.um-icon-close,
.carousel-item i.um-icon-plus,
.carousel-item i.ri-play-large-fill {
    font-size: 1.2rem !important;
}

/* -------- Reszponzív stílusok -------- */
@media (max-width: 600px) {
    .carousel-section .carousel-item img {
        width: 260px;
        height: 390px;
    }

    .carousel-section .carousel-item {
    width: 260px; /* ÚJ */
    height: 390px; /* ÚJ */
    }

    .carousel-item .overlay-content {
        padding: 0.75rem;
    }
    
    .carousel-item .overlay-content h2 {
        font-size: 1rem;
    }

    .carousel-item .overlay-content p {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
    
    .carousel-item .overlay-buttons a,
    .carousel-item .overlay-buttons .um-bookmarks-button a {
        padding: 8px !important;
        font-size: 0.8rem;
    }

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

    /* A konténer elemek (.carousel-item) méretének beállítása */
    .carousel-section.daily-recommendations-carousel .carousel-item,
    .carousel-section.coming-soon-carousel .carousel-item,
    .carousel-section.country-carousel .carousel-item,
    .carousel-section.country-carousel-movies .carousel-item,
    .carousel-section.all-categories .carousel-item {
        width: 225px !important;
        height: 127px !important;
    }

    /* A bennük lévő képek méretének beállítása, hogy kitöltsék a konténert */
    .carousel-section.daily-recommendations-carousel .carousel-item img,
    .carousel-section.coming-soon-carousel .carousel-item img,
    .carousel-section.country-carousel .carousel-item img,
    .carousel-section.country-carousel-movies .carousel-item img,
    .carousel-section.all-categories .carousel-item img {
        width: 100% !important;
        height: 100% !important;
    }

    /* A kör alakú képek méretének csökkentése */
    .carousel-section.actors-carousel .carousel-item img,
    .carousel-section.translators-carousel .carousel-item img {
        width: 125px !important;
        height: 125px !important;
    }

    /* A képek alatti nevek betűméretének és térközének igazítása */
    .carousel-section.actors-carousel .carousel-item p,
    .carousel-section.translators-carousel .carousel-item a[style*="font-weight:bold"] {
        font-size: 0.9rem !important;
        margin-top: 8px !important;
    }

    /* A teljes "doboz" méretének csökkentése, hogy jobban nézzen ki */
    .carousel-section.actors-carousel .carousel-item,
    .carousel-section.translators-carousel .carousel-item {
        width: 150px !important; 
        height: auto !important; /* A magasságot a tartalomhoz igazítjuk */
        font-size: .8rem !important;
    }
}

/* ---- ÚJ: Napi ajánló karusszel stílusai ---- */
.daily-recommendations-carousel .carousel-item {
    width: 400px !important;
    height: 225px !important;
    border-radius: 8px;
    overflow: hidden; /* Biztosítja, hogy a kép tartsa a lekerekítést */
    display: block;   /* Felülírja a flexbox igazítást */
    position: relative;
    background-color: #222; /* Háttérszín, amíg a kép betölt */
}

.daily-recommendations-carousel .carousel-item:hover {
    transform: scale(1.02); /* Finom nagyítás hoverre */
    transition: transform 0.2s ease-in-out;
}

.daily-recommendations-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.daily-recommendations-carousel .carousel-item .item-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 20%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    padding: 15px;
}

.daily-recommendations-carousel .carousel-container#recently-viewed-carousel .carousel-item .item-title-overlay {
    padding: 0 !important;
}

.daily-recommendations-carousel .carousel-item .item-title-overlay h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    padding: 0; /* A szülő paddingje kezeli a térközt */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    text-align: center; /* Legyen középen, mint a címke */
}

/* === ÚJ: Interaktív hover effekt a "Folytasd, ahol abbahagytad" carouselhez === */

/* A konténernek kell a 'relative' pozíció, hogy a benne lévő abszolút pozicionált elemek ehhez igazodjanak. */
.daily-recommendations-carousel .carousel-item {
    position: relative;
    overflow: hidden; /* Fontos, hogy a sarkokon túlnyúló elemeket levágja */
}

/* Az elsötétítő réteg és a play ikon konténere */
.daily-recommendations-carousel .carousel-item .hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fekete, 50%-os átlátszósággal */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* Alapból teljesen átlátszó */
    transition: opacity 0.2s ease-in-out;
    pointer-events: none; /* Ne akadályozza a kattintást az alatta lévő linkre */
    z-index: 2;
}

/* A play ikon stílusa */
.daily-recommendations-carousel .carousel-item .hover-overlay i {
    font-size: 60px; /* A play ikon mérete */
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Amikor az egér a carousel elem fölé kerül, az overlay láthatóvá válik */
.daily-recommendations-carousel .carousel-item:hover .hover-overlay {
    opacity: 1;
}

/* Az eltávolítás (X) gomb stílusa */
.daily-recommendations-carousel .carousel-item .remove-from-list {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 3; /* Legfelül legyen */
    opacity: 0; /* Alapból rejtett */
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    transform: scale(0.8);
    font-family: Arial, sans-serif;
}

/* Az X gomb megjelenik, ha az egér az elem fölé kerül */
.daily-recommendations-carousel .carousel-item:hover .remove-from-list {
    opacity: 1;
    transform: scale(1);
}

.daily-recommendations-carousel .carousel-item .remove-from-list:hover {
    background-color: #e50914; /* Piros háttér hoverre */
    transform: scale(1.1);
}

.daily-recommendations-carousel .item-title-overlay .last-watched-label {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.8em;
    font-weight: 600;
    color: #000;
    background: #d0cdcd;
    padding: 5px 0;
    border-radius: 0 0 8px 8px;
    text-transform: uppercase;
    
    /* Ez a térköz a cím és a sáv között */
    margin-top: 10px; 
}