/* ================================================================
   css-body-EN.css
   base styles shared across all pages: reset, category menu modal,
   search modal, main content (.app-content), hero slider, imdb-card
   (shared base for every grid), filters, genres, mobile filter modal,
   subscription badge, notifications.

   Must always load first (before header/footer/film-series/
   listing-others), since base classes like .imdb-card and .btn-dl
   live here and other files override/extend them.
   ================================================================ */
/* ================================================================
   main site stylesheet - dark theme only
   ================================================================ */

/* ================================================================
   RESET & BASE
   ================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    direction: ltr;
    overflow-x: hidden;
    /* .site-header/.mobile-top-nav are position:fixed (always visible on
       scroll), so they no longer take up space in normal flow - this
       padding reserves that space so page content doesn't start out
       hidden underneath them. Matches the header's own height exactly
       (72px desktop, 56px mobile). Pages with a full-bleed hero that's
       meant to sit behind the header (film/series detail) override this
       back to 0 and handle their own spacing instead. */
    padding-top: 72px;
    padding-bottom: 0;
}
@media (max-width: 991px) {
    body {
        padding-top: 56px;
    }
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-family: inherit;
}

::-webkit-scrollbar {
    width: 4px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}


/* ================================================================
   HEADER - mobile
   ================================================================ */
.mobile-top-nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 500;
    height: 56px;
    box-sizing: border-box;
    align-items: center;
    background: var(--header-bg);
    border-bottom: 1px solid var(--on-surface-06);
    padding: 0 12px;
}

@media (max-width: 991px) {
    .mobile-top-nav {
        display: flex;
    }
}

/* same scrolled-state treatment as the desktop header */
body.scrolled .mobile-top-nav {
    background: var(--header-bg-scrolled);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.mobile-top-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

.nav-items {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mobile-top-nav .logo {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.mobile-top-nav .logo img {
    height: var(--logo-height-mobile, 32px);
    width: auto;
    border-radius: 4px;
}
.mobile-top-nav .logo span {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-text);
}
@media (max-width: 400px) {
    .mobile-top-nav .logo span {
        display: none;
    }
}

.mobile-top-nav .nav-item {
    height: 36px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--on-surface-60);
    transition: all 0.2s;
    background: var(--on-surface-05);
    padding: 0 6px;
    min-width: 36px;
}
.mobile-top-nav .nav-item:hover {
    background: var(--on-surface-12);
    color: #fff;
}
.mobile-top-nav .nav-item.active {
    color: var(--accent-text);
    background: rgba(208, 27, 27, 0.1);
}

/* mobile login button (blue) */
.mobile-top-nav .nav-item.login-btn {
    font-size: 13px;
    font-weight: 700;
    color: var(--btn-login-text);
    background: var(--btn-login-bg);
    border: none;
    padding: 0 14px;
    min-width: 44px;
    border-radius: 20px;
}
.mobile-top-nav .nav-item.login-btn:hover {
    background: var(--btn-login-hover-bg);
}
.mobile-top-nav .nav-item.login-btn span {
    font-size: 13px;
    font-weight: 700;
    color: var(--btn-login-text);
}

/* mobile account panel button (soft red, to stand out) */
.mobile-top-nav .nav-item.panel-btn {
    font-size: 13px;
    font-weight: 700;
    color: var(--btn-panel-text);
    background: var(--btn-panel-bg);
    border: none;
    padding: 0 14px;
    min-width: 44px;
    border-radius: 20px;
}
.mobile-top-nav .nav-item.panel-btn:hover {
    background: var(--btn-panel-hover-bg);
}
.mobile-top-nav .nav-item.panel-btn span {
    font-size: 13px;
    font-weight: 700;
    color: var(--btn-panel-text);
}

/* mobile buy subscription button (green) */
.mobile-top-nav .nav-item.subscribe-btn {
    font-size: 13px;
    font-weight: 700;
    color: var(--btn-subscribe-text);
    background: var(--btn-subscribe-bg);
    border: none;
    padding: 0 14px;
    min-width: 44px;
    border-radius: 20px;
}
.mobile-top-nav .nav-item.subscribe-btn:hover {
    background: var(--btn-subscribe-hover-bg);
}
.mobile-top-nav .nav-item.subscribe-btn span {
    font-size: 13px;
    font-weight: 700;
    color: var(--btn-subscribe-text);
}
.mobile-top-nav .nav-item.subscribe-btn i {
    font-size: 13px;
    margin-right: 3px;
}

/* ================================================================
   category menu modal
   ================================================================ */
.menu-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: flex-start;
    justify-content: center;
    padding-top: 70px;
}
.menu-modal-overlay.open {
    display: flex;
}
@media (min-width: 992px) {
    .menu-modal-overlay {
        display: none !important;
    }
}

.menu-modal {
    background: var(--bg-base);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 16px;
    padding: 16px;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
    border: 1px solid var(--on-surface-06);
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.menu-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--on-surface-06);
}
.menu-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.menu-modal-header h3 i {
    color: var(--accent-text);
}
.menu-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--on-surface-06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #aaa;
    transition: 0.2s;
}
.menu-modal-close:hover {
    background: var(--on-surface-12);
    color: #fff;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    min-height:200px;
}
@media (max-width: 320px) {
    /* only drops to 2 columns on the smallest phones (under 320px, e.g.
       first-gen iPhone SE) - the breakpoint used to be 400px, which caught
       most regular phones (360-428px) too and split the 6 menu items into
       3 rows instead of 2. */
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* category menu tiles - a grayscale background image instead of an
   icon. The image sits in its own ::before (not directly as background
   on .menu-item), since filter (grayscale) applies to the *entire
   subtree* - directly on .menu-item would also gray out the accent
   hover border. The image is set from PHP via a CSS variable (--bg-url).
   Extra darkening via .menu-item-overlay plus a mild fixed blur (not
   scroll-driven) for text readability. */
.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-radius: 12px;
    background-color: var(--on-surface-04);
    border: 1px solid var(--on-surface-06);
    transition: all 0.2s;
    text-align: center;
    gap: 4px;
    min-height: 72px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.menu-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-url);
    background-size: cover;
    background-position: center;
    filter: grayscale(1);
    z-index: 0;
}
.menu-item:hover {
    border-color: rgba(208, 27, 27, 0.3);
    transform: scale(1.02);
}

/* darkening layer over the image - separate from the image's own
   grayscale/blur (on ::before), just for text readability. */
.menu-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 10, 10, 0.5) 0%,
        rgba(10, 10, 10, 0.35) 60%,
        rgba(10, 10, 10, 0.2) 100%
    );
    z-index: 1;
}

.menu-item .menu-label {
    position: relative;
    z-index: 2;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.menu-item .menu-arrow {
    position: relative;
    z-index: 2;
    font-size: 11px;
    color: var(--on-surface-70);
}

/* ===== mobile submenus ===== */
.menu-children-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 2500;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    padding: 70px 20px;
}
.menu-children-overlay.open {
    display: flex;
}

.menu-children-box {
    background: var(--bg-base);
    border-radius: 16px;
    padding: 16px;
    max-width: 400px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--on-surface-06);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
    animation: slideUp 0.25s ease;
    position: relative;
}

/* the submenu panel reuses the same background image as the tile that
   opened it. Same ::before + CSS variable pattern as .menu-item and
   .nav-dropdown-menu-bg (so grayscale only affects the image, not the
   box/text). */
.menu-children-box-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-url);
    background-size: cover;
    background-position: center;
    filter: grayscale(1);
    border-radius: 16px;
    z-index: 0;
}
.menu-children-box-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.75);
    border-radius: 16px;
    z-index: 1;
}
.menu-children-box-bg .menu-children-header,
.menu-children-box-bg .menu-children-list {
    position: relative;
    z-index: 2;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.menu-children-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--on-surface-06);
}
.menu-children-header .title {
    font-size: 17px;
    font-weight: 700;
    color: var(--accent-text);
}
.menu-children-header .close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--on-surface-06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #aaa;
    transition: 0.2s;
}
.menu-children-header .close-btn:hover {
    background: var(--on-surface-12);
    color: #fff;
}

.menu-children-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
@media (max-width: 400px) {
    .menu-children-list {
        grid-template-columns: 1fr;
    }
}

.menu-child-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--on-surface-03);
    transition: all 0.2s;
    color: var(--on-surface-75);
    font-size: 15px;
    text-decoration: none;
}
.menu-child-item:hover {
    background: rgba(208, 27, 27, 0.1);
    color: var(--accent-text);
}
.menu-child-item i {
    font-size: 15px;
    color: var(--on-surface-30);
    width: 18px;
    text-align: center;
}

/* ================================================================
   search
   ================================================================ */
.search-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.search-modal-overlay.open {
    display: flex;
}

.search-modal {
    width: 100%;
    max-width: 500px;
    background: var(--bg-base);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
    border: 1px solid var(--on-surface-06);
}
.search-modal-form {
    display: flex;
    gap: 10px;
}
.search-modal-form input {
    flex: 1;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-base);
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border 0.2s;
}
.search-modal-form input:focus {
    border-color: var(--accent-text);
}
.search-modal-form button {
    background: var(--accent);
    color: var(--accent-contrast);
    padding: 0 24px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    transition: 0.2s;
}
.search-modal-form button:hover {
    background: var(--accent-hover);
}
.search-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #aaa;
    transition: 0.2s;
    background: var(--on-surface-05);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-modal-close:hover {
    color: #fff;
    background: var(--on-surface-10);
}

/* ================================================================
   main content
   ================================================================ */
.app-content {
    max-width: 1700px;
    margin: 0 auto;
   
}
@media (max-width: 767px) {
    .app-content {
        padding: 0 8px 20px;
    }
}
@media (max-width: 991px) {
    .app-content {
        padding-top: 10px;
    }
}

/* ================================================================
   slider
   ================================================================ */
.imdb-slider-wrapper {
    position: relative;
    overflow: hidden;
    z-index: 1;
    /* .app-content (this section's parent) is capped at max-width:1700px -
       for the slider to actually span the full viewport width (not just
       the 1700px container), it has to break out of that constraint. */
    width: 100vw;
    margin-right: calc(-50vw + 50%);
    margin-left: calc(-50vw + 50%);
}

.imdb-slider {
    position: relative;
    width: 100%;
    height: 90vh; /* full screen - always 90% viewport height, regardless of device */
    height: 90dvh; /* mobile: adjusts correctly as the address bar shows/hides */
    background: var(--bg-base);
    overflow: hidden;
    box-sizing: border-box;
    /* deliberately no border-radius and no margin-top: must start flush
       right under the header, no rounded corners or gap - a genuinely
       full-bleed slider, not a rounded box in the middle of the page. */
    margin: 0;
    margin-bottom: 20px;
}
@media (max-width: 767px) {
    .imdb-slider {
        /* on mobile, "full screen" means from under the header to roughly mid-
           page, with no empty gap above/below. At 90vh (fine for desktop),
           since the image is shown uncropped via "contain", it left two big
           empty bars above/below the image because the frame is much taller
           than the image itself. Fix: shortened the frame (55vh) and
           switched the main image layer back to "cover" on mobile only, so
           it fills the frame completely with no empty space left. */
        height: 55vh;
        height: 55dvh;
        margin: 0;
        margin-bottom: 12px;
    }
    .imdb-slide::after {
        background-size: cover;
    }
}

.imdb-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* blurred ambient layer - always fills the frame via cover; wherever the
   main layer (now "contain", never cropped) leaves empty space, this
   blurred version of the same image shows through instead of a flat
   color or empty bar. */
.imdb-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(35px) brightness(0.55) saturate(1.15);
    transform: scale(1.15);
    z-index: 0;
}
/* main image layer - deliberately "contain" (not "cover") so the image
   is never cropped and shows in full, even if its aspect ratio doesn't
   match the slider frame. Stays centered, not stretched/squeezed. */
.imdb-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: inherit;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}
.imdb-slide .container-1700 {
    max-width: var(--site-content-width, 1700px);
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}
@media (max-width: 767px) {
    .imdb-slide .container-1700 {
        padding: 0 16px;
    }
}
.imdb-slide.active {
    opacity: 1;
}
.imdb-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, var(--overlay-strong) 0%, var(--overlay-soft) 50%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 2;
}
@media (max-width: 767px) {
    .imdb-slide-overlay {
        background: linear-gradient(to top, var(--overlay-strong) 0%, var(--overlay-soft) 60%, rgba(0,0,0,0) 100%);
    }
}

.imdb-slide-content {
    max-width: 550px;
    width: 100%;
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
@media (max-width: 767px) {
    .imdb-slide-content {
        max-width: 100%;
        gap: 6px;
        padding: 12px;
    }
}

.imdb-slide-title-fa {
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
    line-height: 1.15;
    margin-bottom: 2px;
}
@media (max-width: 767px) {
    .imdb-slide-title-fa {
        font-size: clamp(18px, 5vw, 26px);
        margin-bottom: 0;
    }
}

.imdb-slide-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 15px;
    font-weight: 600;
    color: var(--on-surface-85);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.imdb-slide-meta .slide-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--btn-yellow);
}
.imdb-slide-meta .slide-dot {
    opacity: 0.5;
    font-size: 12px;
}
@media (max-width: 767px) {
    .imdb-slide-meta {
        font-size: 12px;
        gap: 6px;
    }
}

.imdb-slide-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}
@media (max-width: 767px) {
    .imdb-slide-buttons {
        gap: 6px;
    }
}

.imdb-slide-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: var(--accent-contrast) !important;
    padding: 10px 30px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s;
    box-shadow: 0 8px 32px rgba(208, 27, 27, 0.35);
}
.imdb-slide-btn:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
    box-shadow: 0 10px 40px rgba(208, 27, 27, 0.5);
}
@media (max-width: 767px) {
    .imdb-slide-btn {
        padding: 6px 16px;
        font-size: 11px;
        gap: 4px;
    }
    .imdb-slide-btn i {
        font-size: 10px;
    }
}

.slider-arrows {
    display: flex;
    gap: 10px;
    justify-content: center;
    position: absolute;
    right: 0;
    left: 0;
    bottom: 18px;
    z-index: 3;
    pointer-events: none;
}
.slider-arrows .slider-arrow {
    pointer-events: auto;
}
.slider-arrow {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--on-surface-08);
    backdrop-filter: blur(6px);
    border: 1px solid var(--on-surface-12);
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    cursor: pointer;
}
.slider-arrow:hover {
    background: rgba(208, 27, 27, 0.25);
    border-color: var(--accent-text);
    transform: scale(1.1);
}
@media (max-width: 767px) {
    .slider-arrow {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    .slider-arrows {
        gap: 6px;
        bottom: 10px;
    }
}

/* ================================================================
   square section (below the slider)
   ================================================================ */
.imdb-featured-wrapper {
    position: relative;
    z-index: 5;
    margin-top: -12%;
    padding: 0 16px;
    max-width: 1700px;
    margin-right: auto;
    margin-left: auto;
}
@media (max-width: 767px) {
    .imdb-featured-wrapper {
        margin-top: -10%;
        padding: 0 8px;
    }
}

.imdb-featured-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    background: transparent;
}
.imdb-featured-grid .imdb-card {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-elevated-2);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.imdb-featured-grid .imdb-card:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8);
}
.imdb-featured-grid .imdb-card .imdb-card-image img {
    object-fit: cover;
}
.imdb-featured-grid .imdb-card .imdb-card-meta {
    padding: 16px 10px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
}
.imdb-featured-grid .imdb-card .imdb-card-title {
    font-size: 13px;
    min-height: 30px;
    -webkit-line-clamp: 1;
}
.imdb-featured-grid .imdb-card .imdb-card-rating {
    width: 34px;
    height: 34px;
    top: 6px;
    left: 6px;
}
.imdb-featured-grid .imdb-card .imdb-card-rating .rating-text {
    font-size: 8px;
}
.imdb-featured-grid .imdb-card .imdb-card-rating .progress-circle,
.imdb-featured-grid .imdb-card .imdb-card-rating .bg-circle {
    stroke-width: 2.5;
}

.imdb-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    border: 1px solid var(--on-surface-10);
}
.imdb-card-badge.film {
    background: rgba(208, 27, 27, 0.25);
    border-color: rgba(208, 27, 27, 0.3);
    color: var(--accent-text);
}
.imdb-card-badge.series {
    background: rgba(15, 92, 163, 0.18);
    border-color: rgba(15, 92, 163, 0.28);
    color: var(--blue-text);
}

/* genre/country cards - same grid as .imdb-featured-grid (square, like
   a film card), but instead of a real film poster, a random poster from
   a pool (picked in PHP, can differ each time). The image sits in its
   own ::before (not directly as background-image on the card) since
   these cards link to a text page (genre/country), not a specific film,
   so the image itself shouldn't look interactive/clickable - it's just
   decorative. Dark + fairly heavy blur (by design) to feel like a "text
   card", not an actual poster. */
.imdb-taxonomy-card {
    background-color: var(--bg-elevated-2);
}
.imdb-taxonomy-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-url);
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.imdb-taxonomy-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.55);
    z-index: 1;
}
.imdb-taxonomy-card .imdb-card-meta {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    inset: 0;
    height: 100%;
    background: none;
    padding: 0;
}
.imdb-taxonomy-card .imdb-card-title {
    font-size: 16px;
    font-weight: 700;
    -webkit-line-clamp: 2;
}
.imdb-taxonomy-card:hover .imdb-taxonomy-card-overlay {
    background: rgba(10, 10, 10, 0.4);
}

/* #N rank badge on "top rated" film/series cards */
.imdb-card-badge-top250 {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 4;
    background: rgba(208, 27, 27, 0.9);
    color: var(--accent-contrast);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}
.imdb-card-badge-top250 {
    right: auto;
    left: 8px;
}

@media (max-width: 767px) {
    .imdb-featured-grid {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 12px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    .imdb-featured-grid::-webkit-scrollbar {
        height: 4px;
    }
    .imdb-featured-grid::-webkit-scrollbar-track {
        background: var(--on-surface-05);
        border-radius: 4px;
    }
    .imdb-featured-grid::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 4px;
    }
    .imdb-featured-grid .imdb-card {
        flex: 0 0 140px;
        scroll-snap-align: start;
        aspect-ratio: 1 / 1;
    }
    .imdb-featured-grid .imdb-card .imdb-card-title {
        font-size: 11px;
        min-height: 26px;
    }
    .imdb-featured-grid .imdb-card .imdb-card-rating {
        width: 28px;
        height: 28px;
        top: 4px;
        left: 4px;
    }
    .imdb-featured-grid .imdb-card .imdb-card-rating .rating-text {
        font-size: 7px;
    }
    .imdb-featured-grid .imdb-card .imdb-card-rating .progress-circle,
    .imdb-featured-grid .imdb-card .imdb-card-rating .bg-circle {
        stroke-width: 2;
    }
    .imdb-featured-grid .imdb-card .imdb-card-meta {
        padding: 12px 6px 6px;
    }
    .imdb-card-badge {
        font-size: 8px;
        padding: 2px 8px;
        top: 4px;
        right: 4px;
    }
}
@media (min-width: 768px) and (max-width: 1200px) {
    .imdb-featured-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}
@media (min-width: 1201px) and (max-width: 1600px) {
    .imdb-featured-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ================================================================
   cards and scrollable sections
   ================================================================ */
.imdb-carousel-section {
    margin-bottom: 44px;
    max-width: 1700px;
    margin-right: auto;
    margin-left: auto;
    padding: 0 16px;
    position: relative;
}
/* theme customizer: section width/spacing/background only applies on
   the homepage (scoped to .imdb-container, which only exists in
   index.php) - film/series list pages that share this same
   .imdb-carousel-section class are left untouched. */
.imdb-container .imdb-carousel-section {
    margin-bottom: var(--section-gap);
    max-width: var(--site-content-width);
    background: var(--section-bg);
    border-radius: var(--section-radius);
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
}
/* when this section is nested inside another page-wrapper (like
   .movies-page-wrapper in pages/film/index.php and
   pages/series/index.php), the outer wrapper already has its own
   max-width/padding/centering - keeping this section's own padding too
   would stack, pushing content further from the edge the deeper it's
   nested ("staircase" spacing bug). Neutralized here for that case. */
.movies-page-wrapper .imdb-carousel-section {
    max-width: none;
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
}
.imdb-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 4px 16px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}
.imdb-carousel::-webkit-scrollbar {
    height: 8px;
}
.imdb-carousel::-webkit-scrollbar-track {
    background: var(--on-surface-05);
    border-radius: 4px;
}
.imdb-carousel::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}
.imdb-carousel .imdb-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    aspect-ratio: 2 / 3;
}
@media (max-width: 767px) {
    .imdb-carousel .imdb-card {
        flex: 0 0 140px;
    }
    .imdb-carousel {
        gap: 12px;
        padding: 4px 2px 12px;
    }
    .imdb-carousel::-webkit-scrollbar {
        height: 6px;
    }
}

/* actor/director card in homepage sections - reuses the base
   .imdb-card (for consistency with other sections), just with a portrait-
   friendlier image ratio (3/4 instead of the 2/3 poster ratio), and a
   grayscale image with slightly boosted brightness (by design: "grayscale
   but a bit bright"). */
.imdb-carousel .imdb-person-card {
    aspect-ratio: 3 / 4;
}
.imdb-carousel .imdb-person-card .imdb-card-image img {
    filter: grayscale(1) brightness(1.08);
}
.imdb-carousel .imdb-person-card:hover .imdb-card-image img {
    filter: grayscale(1) brightness(1.15);
    transform: scale(1.08);
}

/* ===== cards ===== */
.imdb-card {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-elevated-2);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.imdb-card:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8);
}
.imdb-card-image {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-base);
    overflow: hidden;
}
.imdb-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}
.imdb-card:hover .imdb-card-image img {
    transform: scale(1.08);
    filter: brightness(1.1);
}
.imdb-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0.6;
}
.imdb-card:hover .imdb-card-image::after {
    opacity: 0.3;
}

.imdb-card-rating {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    border: 2px solid var(--on-surface-10);
}
@media (max-width: 767px) {
    .imdb-card-rating {
        width: 34px;
        height: 34px;
        top: 5px;
        left: 5px;
    }
}
.imdb-card-rating svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}
.imdb-card-rating .bg-circle {
    fill: none;
    stroke: var(--on-surface-15);
    stroke-width: 3;
}
.imdb-card-rating .progress-circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}
.imdb-card-rating .rating-text {
    position: absolute;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    line-height: 1;
}
@media (max-width: 767px) {
    .imdb-card-rating .rating-text {
        font-size: 8px;
    }
}

/* year badge above the poster (genre/country/language/year pages +
   homepage) - always stays on the poster's right (RTL or LTR), since the
   rating badge (imdb-card-rating) always sits on the left and isn't RTL-
   flipped; a [dir="rtl"] rule used to also move the year to the left,
   overlapping the rating circle - removed. */
.imdb-card-year-top {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--on-surface-80);
    border: 1px solid var(--on-surface-08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

/* genre tags under the card title (genre/country/language/year pages) */
.imdb-card-genres {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 4px;
    flex-wrap: wrap;
}
.imdb-card-genre {
    background: var(--on-surface-08);
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 9px;
    color: var(--on-surface-60);
    white-space: nowrap;
}

.imdb-card-meta {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 30px 12px 14px;
    text-align: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    z-index: 2;
}
.imdb-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--card-title-color);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 40px;
}
@media (max-width: 767px) {
    .imdb-card-meta {
        padding: 25px 8px 10px;
    }
    .imdb-card-title {
        font-size: 13px;
        min-height: 34px;
    }
}

/* ================================================================
   show more button
   ================================================================ */
.imdb-divider {
    width: 100%;
    max-width: 1700px;
    margin: 10px auto 20px;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--on-surface-10), transparent);
}
.imdb-load-more-wrap {
    display: flex;
    justify-content: center;
    margin: 20px 0 30px;
    max-width: 1700px;
    margin-right: auto;
    margin-left: auto;
}
.imdb-load-more {
    background: transparent;
    border: 2px solid rgba(208, 27, 27, 0.3);
    color: var(--accent-text);
    padding: 12px 48px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.imdb-load-more:hover {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent-text);
    box-shadow: 0 8px 32px rgba(208, 27, 27, 0.25);
    transform: scale(1.02);
}

/* ================================================================
   filters
   ================================================================ */
.imdb-filter-wrapper {
    max-width: var(--site-content-width);
    margin: 0 auto;
    padding: 0 16px;
    display: var(--filter-display);
}
.imdb-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0 28px;
    padding: 16px 0;
    border-top: 1px solid var(--on-surface-06);
    border-bottom: 1px solid var(--on-surface-06);
    width: 100%;
}
.imdb-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--on-surface-06);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 14px;
    color: #ddd;
    transition: 0.2s;
    white-space: nowrap;
}
.imdb-filter-toggle:hover {
    background: var(--on-surface-12);
    color: #fff;
}
.imdb-filter-toggle .arrow {
    font-size: 12px;
    transition: transform 0.3s;
}
.imdb-filter-toggle.open .arrow {
    transform: rotate(180deg);
}

.imdb-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}
.imdb-filter-select {
    background: var(--filter-bg);
    border: 1px solid var(--filter-border-color);
    color: var(--filter-text-color);
    padding: 10px 18px;
    border-radius: 40px;
    font-size: var(--filter-font-size);
    outline: none;
    transition: 0.2s;
    min-width: 130px;
    flex: 1 0 auto;
    max-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
.imdb-filter-select:focus {
    border-color: var(--accent-text);
}
.imdb-filter-select option {
    background: var(--filter-bg);
}
.imdb-filter-link {
    padding: 10px 22px;
    border-radius: 40px;
    background: var(--on-surface-04);
    color: var(--filter-text-color);
    font-size: var(--filter-font-size);
    transition: 0.2s;
    white-space: nowrap;
}
.imdb-filter-link:hover {
    background: var(--on-surface-10);
    color: #fff;
}

@media (max-width: 767px) {
    .imdb-filter-toggle {
        display: flex;
        /* used to be a small button; now full-width and larger like the other
           rows on the page (cards), for an easier tap target. */
        width: 100%;
        justify-content: center;
        padding: 14px 18px;
        font-size: 15px;
        border-radius: 14px;
    }
    .imdb-filter-grid {
        display: none;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        padding-top: 12px;
    }
    .imdb-filter-grid.open {
        display: flex;
    }
    .imdb-filter-select {
        min-width: 100px;
        max-width: 100%;
        flex: 1 1 45%;
        padding: 8px 14px;
        font-size: 12px;
    }
    .imdb-filter-link {
        padding: 8px 16px;
        font-size: 12px;
    }
    .imdb-filter-bar {
        padding: 12px 0;
        margin: 10px 0 20px;
    }
}

/* ================================================================
   sections and section headers
   ================================================================ */
.imdb-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 2px;
}
.imdb-section-title {
    font-size: clamp(18px, 2.4vw, 28px);
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}
.imdb-section-title i {
    color: var(--accent-text);
    font-size: 0.85em;
}
.imdb-see-all {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-text);
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    white-space: nowrap;
}
.imdb-see-all:hover {
    color: var(--accent-text-hover);
    gap: 10px;
}

/* ================================================================
   genres
   ================================================================ */
.imdb-genre-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 16px;
}
@media (max-width: 767px) {
    .imdb-genre-grid {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .imdb-genre-grid::-webkit-scrollbar {
        height: 6px;
    }
    .imdb-genre-grid::-webkit-scrollbar-track {
        background: var(--on-surface-05);
        border-radius: 4px;
    }
    .imdb-genre-grid::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 4px;
    }
    .imdb-genre-tile {
        flex: 0 0 auto;
    }
}

.imdb-genre-tile {
    padding: 8px 22px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    transition: all 0.25s;
    border: 1px solid var(--on-surface-06);
    background: var(--on-surface-04);
    white-space: nowrap;
}
.imdb-genre-tile:hover {
    transform: scale(1.05);
    background: rgba(208, 27, 27, 0.15);
    border-color: rgba(208, 27, 27, 0.2);
    color: var(--accent-text);
}
.imdb-genre-tile.imdb-color-1 {
    background: rgba(220, 20, 60, 0.25);
    border-color: rgba(220, 20, 60, 0.2);
}
.imdb-genre-tile.imdb-color-2 {
    background: rgba(30, 144, 255, 0.2);
    border-color: rgba(30, 144, 255, 0.2);
}
.imdb-genre-tile.imdb-color-3 {
    background: rgba(50, 205, 50, 0.2);
    border-color: rgba(50, 205, 50, 0.2);
}
.imdb-genre-tile.imdb-color-4 {
    background: rgba(255, 140, 0, 0.2);
    border-color: rgba(255, 140, 0, 0.2);
}
.imdb-genre-tile.imdb-color-5 {
    background: rgba(186, 85, 211, 0.2);
    border-color: rgba(186, 85, 211, 0.2);
}
.imdb-genre-tile.imdb-color-6 {
    background: rgba(255, 69, 0, 0.2);
    border-color: rgba(255, 69, 0, 0.2);
}
.imdb-genre-tile.imdb-color-7 {
    background: rgba(0, 206, 209, 0.2);
    border-color: rgba(0, 206, 209, 0.2);
}
.imdb-genre-tile.imdb-color-8 {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.2);
}

/* ================================================================
   filter modal (mobile)
   ================================================================ */
.imdb-filter-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 3000;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
}
.imdb-filter-modal.open {
    display: flex;
}
.imdb-filter-modal-content {
    background: var(--bg-base);
    width: 100%;
    max-width: 500px;
    border-radius: 28px 28px 0 0;
    padding: 24px 20px 34px;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.8);
    border-top: 1px solid var(--on-surface-06);
    animation: slideUpModal 0.35s ease;
}
@keyframes slideUpModal {
    from {
        transform: translateY(60px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.imdb-filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}
.imdb-filter-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--on-surface-06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #aaa;
    transition: 0.2s;
}
.imdb-filter-modal-close:hover {
    background: var(--on-surface-12);
    color: #fff;
}
.imdb-filter-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.imdb-filter-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.imdb-filter-modal-grid .imdb-filter-select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--filter-bg);
    border: 1px solid var(--filter-border-color);
    color: var(--filter-text-color);
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
.imdb-filter-modal-grid .imdb-filter-select:focus {
    border-color: var(--accent-text);
}
.imdb-filter-modal-grid .imdb-filter-select option {
    background: var(--filter-bg);
}

@media (max-width: 576px) {
    .imdb-filter-modal-content {
        padding: 20px 16px 28px;
        border-radius: 20px 20px 0 0;
    }
    .imdb-filter-modal-grid {
        grid-template-columns: 1fr;
    }
}

.visually-hidden-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}


/* ===== RTL support in the footer ===== */
 /* ===== active subscription badge ===== */
.subscription-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border-radius: 20px;
    background: rgba(61, 191, 110, 0.14);
    color: var(--btn-green);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: none;
    transition: background 0.2s;
}

.subscription-badge:hover {
    background: rgba(61, 191, 110, 0.24);
    color: var(--btn-green);
}

.subscription-badge i {
    font-size: 0.9rem;
    color: var(--btn-green);
}

/* ===== mobile version ===== */
.subscription-badge-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 12px;
    color: var(--btn-green);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.subscription-badge-mobile:hover {
    background: rgba(76, 175, 80, 0.12);
}

.subscription-badge-mobile i {
    font-size: 1.1rem;
    color: var(--btn-green);
}

/* ===== responsive ===== */
@media (max-width: 768px) {
    .subscription-badge {
        font-size: 0.7rem;
        padding: 0 12px;
        height: 34px;
    }
    
    .subscription-badge i {
        font-size: 0.75rem;
    }
}

  /* ============================================================
       header notification styles
    ============================================================ */
    .notification-btn {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--on-surface-05);
        border: 1px solid var(--on-surface-08);
        color: var(--on-surface-60);
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        font-size: 1rem;
    }

    .notification-btn:hover {
        background: var(--on-surface-08);
        color: #fff;
        border-color: var(--on-surface-15);
    }

    .notification-btn .badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 50%;
        background: var(--danger);
        color: #fff;
        font-size: 0.55rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--bg-elevated);
        animation: pulse-badge 1.5s ease-in-out infinite;
    }

    .notification-btn .badge.empty {
        display: none;
    }

    @keyframes pulse-badge {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.1);
        }
    }

    /* mobile */
    .mobile-notification-btn {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--on-surface-40);
        text-decoration: none;
        font-size: 1.2rem;
        padding: 6px 10px;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .mobile-notification-btn:hover {
        color: #fff;
        background: var(--on-surface-05);
    }

    .mobile-notification-btn .badge {
        position: absolute;
        top: 0;
        right: 0;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 50%;
        background: var(--danger);
        color: #fff;
        font-size: 0.5rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--bg-elevated);
    }

    .mobile-notification-btn .badge.empty {
        display: none;
    }
    

/* ===== circular stories with horizontal scroll ===== */
.imdb-circle-stories-wrapper {
    margin-top: 24px;
    margin-bottom: 8px;
}
@media (max-width: 767px) {
    .imdb-circle-stories-wrapper {
        margin-top: 5px;
        margin-bottom: 4px;
    }
}

    .imdb-circle-stories-wrapper {
        padding: 20px 0 0px;
     
        position: relative;
    }

    .imdb-circle-stories-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        margin-bottom: 16px;
    }

    .imdb-circle-stories-subtitle {
        font-size: 13px;
        color: #888;
    }

    .imdb-circle-stories-container {
        position: relative;
        padding: 0 16px;
    }

    .imdb-circle-stories {
        display: flex;
        gap: 16px;
        padding: 10px 0;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        cursor: grab;
    }

    .imdb-circle-stories::-webkit-scrollbar {
        display: none;
    }

    .imdb-circle-scroll-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid var(--on-surface-20);
        color: #fff;
        cursor: pointer;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        font-size: 16px;
        backdrop-filter: blur(4px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    }

    .imdb-circle-scroll-btn:hover {
        background: rgba(208, 27, 27, 0.9);
        border-color: var(--accent);
    }

    .imdb-circle-scroll-btn:active {
        transform: translateY(-50%) scale(0.95);
    }

    .imdb-circle-scroll-left {
        left: 4px;
    }

    .imdb-circle-scroll-right {
        right: 4px;
    }

    .imdb-circle-story {
        display: flex;
        flex-direction: column;
        align-items: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: transform 0.2s;
        width: 80px;
        position: relative;
    }

    .imdb-circle-story:hover {
        transform: scale(1.05);
    }

    .imdb-circle-story-ring {
        width: 72px;
        height: 72px;
        padding: 3px;
        border-radius: 50%;
        background: linear-gradient(-135deg, var(--story-ring-color-1), var(--story-ring-color-2), var(--btn-yellow));
        position: relative;
    }

    .imdb-circle-story-image {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        overflow: hidden;
        position: relative;
        border: 2px solid var(--bg-black);
    }

    .imdb-circle-story-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .imdb-circle-story-title {
        font-size: 11px;
        color: var(--story-title-color);
        text-align: center;
        margin-top: 6px;
        max-width: 72px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ===== story modal ===== */
    .imdb-story-modal {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        z-index: 10000;
        animation: fadeIn 0.3s ease;
    }

    .imdb-story-modal.open {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .imdb-story-modal-overlay {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.92);
    }

    .imdb-story-modal-content {
        position: relative;
        width: 100%;
        max-width: 420px;
        height: 100%;
        max-height: 100vh;
        background: #000;
        overflow: hidden;
        z-index: 1;
        animation: slideUp 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    @media (min-width: 480px) {
        .imdb-story-modal-content {
            height: 90vh;
            max-height: 780px;
            border-radius: 16px;
        }
    }

    /* progress bars - Instagram-style stories, top of screen */
    .imdb-story-progress-row {
        position: absolute;
        top: 10px;
        right: 10px;
        left: 10px;
        display: flex;
        gap: 4px;
        z-index: 5;
    }

    .imdb-story-progress-track {
        flex: 1;
        height: 3px;
        background: var(--on-surface-35);
        border-radius: 2px;
        overflow: hidden;
    }

    .imdb-story-progress-fill {
        height: 100%;
        width: 0%;
        background: #fff;
        border-radius: 2px;
    }

    .imdb-story-topbar {
        position: absolute;
        top: 22px;
        right: 10px;
        left: 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 5;
    }

    .imdb-story-pause-btn,
    .imdb-story-modal-close {
        background: rgba(0,0,0,0.35);
        border: none;
        color: #fff;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 15px;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .imdb-story-pause-btn:hover,
    .imdb-story-modal-close:hover {
        background: var(--on-surface-20);
    }

    .imdb-story-modal-body {
        position: relative;
        flex: 1;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .imdb-story-poster-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* invisible click zones - right = previous, left = next (matches RTL) */
    .imdb-story-nav-zone {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 35%;
        z-index: 3;
        cursor: pointer;
    }

    .imdb-story-nav-prev {
        left: 0;
    }

    .imdb-story-nav-next {
        right: 0;
    }

    .imdb-story-overlay-info {
        position: absolute;
        bottom: 0;
        right: 0;
        left: 0;
        padding: 60px 20px 24px;
        background: linear-gradient(to top, rgba(0,0,0,0.85) 20%, transparent);
        z-index: 4;
        pointer-events: none;
    }

    .imdb-story-overlay-info a {
        pointer-events: auto;
    }

    .imdb-story-overlay-info .imdb-story-title {
        color: #fff;
        font-size: 20px;
        font-weight: 700;
        margin: 0 0 8px;
        text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    }

    .imdb-story-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 16px;
        margin-bottom: 14px;
    }

    .imdb-story-meta span {
        color: #ddd;
        font-size: 13px;
    }

    .imdb-story-meta #storyRating {
        color: #ffd700;
        font-weight: bold;
    }

    .imdb-story-watch-btn {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        background: var(--accent);
        color: #fff;
        padding: 10px 24px;
        border-radius: 30px;
        font-weight: 600;
        font-size: 15px;
        text-decoration: none;
        transition: background 0.2s;
        align-self: flex-start;
    }

    .imdb-story-watch-btn:hover {
        background: var(--accent-dark);
        color: #fff;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @keyframes slideUp {
        from { transform: translateY(30px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    /* ===== responsive ===== */
    @media (max-width: 768px) {
        .imdb-circle-story {
            width: 70px;
        }
        .imdb-circle-story-ring {
            width: 62px;
            height: 62px;
        }
        .imdb-circle-story-title {
            font-size: 10px;
            max-width: 62px;
        }
        .imdb-circle-scroll-btn {
            width: 32px;
            height: 32px;
            font-size: 13px;
        }
        .imdb-circle-scroll-left {
            left: 0;
        }
        .imdb-circle-scroll-right {
            right: 0;
        }
        .imdb-story-overlay-info .imdb-story-title {
            font-size: 18px;
        }
        .imdb-story-watch-btn {
            align-self: center;
        }
        .imdb-story-meta {
            justify-content: center;
        }
    }

    @media (max-width: 480px) {
        .imdb-circle-story {
            width: 60px;
        }
        .imdb-circle-story-ring {
            width: 52px;
            height: 52px;
        }
        .imdb-circle-story-title {
            font-size: 9px;
            max-width: 52px;
        }
    }
/* ================================================================
   subtle animations (not attention-grabbing) - run once on page load,
   not on every scroll. Grid cards fade in with a short stagger, not
   all at once.
   Note: this block used to be wrapped in
   @media (prefers-reduced-motion: no-preference), which disabled the
   whole animation on systems with OS-level reduced motion - removed
   since it should always run.
   ================================================================ */
.imdb-card,
.actor-card,
.country-card {
    animation: fadeInUpSoft 0.45s ease backwards;
}
/* staggered delay for the first 12 items in each grid - beyond that,
   everything appears with the same last delay so we don't generate an
   endless number of selectors */
.movies-grid > *:nth-child(1),  .actor-grid > *:nth-child(1)  { animation-delay: 0.02s; }
.movies-grid > *:nth-child(2),  .actor-grid > *:nth-child(2)  { animation-delay: 0.05s; }
    .movies-grid > *:nth-child(3),  .actor-grid > *:nth-child(3)  { animation-delay: 0.08s; }
    .movies-grid > *:nth-child(4),  .actor-grid > *:nth-child(4)  { animation-delay: 0.11s; }
    .movies-grid > *:nth-child(5),  .actor-grid > *:nth-child(5)  { animation-delay: 0.14s; }
    .movies-grid > *:nth-child(6),  .actor-grid > *:nth-child(6)  { animation-delay: 0.17s; }
    .movies-grid > *:nth-child(7),  .actor-grid > *:nth-child(7)  { animation-delay: 0.20s; }
    .movies-grid > *:nth-child(8),  .actor-grid > *:nth-child(8)  { animation-delay: 0.23s; }
    .movies-grid > *:nth-child(9),  .actor-grid > *:nth-child(9)  { animation-delay: 0.26s; }
    .movies-grid > *:nth-child(10), .actor-grid > *:nth-child(10) { animation-delay: 0.29s; }
    .movies-grid > *:nth-child(11), .actor-grid > *:nth-child(11) { animation-delay: 0.32s; }
    .movies-grid > *:nth-child(12), .actor-grid > *:nth-child(12) { animation-delay: 0.35s; }
@keyframes fadeInUpSoft {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* buttons: slightly softer, with a light press feedback */
.btn-hero,
.imdb-slide-btn,
.movies-filter-link,
.actor-tab,
.btn-dl {
    transition: transform 0.18s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.btn-hero:active,
.imdb-slide-btn:active,
.btn-dl:active {
    transform: scale(0.97);
}

/* active tab underline moves smoothly, not a sudden jump */
.actor-tab,
.type-tab,
.film-tab-btn {
    position: relative;
}

/* ================================================================
   EN fixes (added when the stylesheet was converted from RTL to LTR)
   ================================================================ */

/* Cards that show BOTH the type badge (Movie/Series) and the year badge had the two
   pinned to the same top-right corner and drew on top of each other. Stack them. */
.imdb-card:has(.imdb-card-badge) .imdb-card-year-top {
    top: 34px;
}
@media (max-width: 767px) {
    .imdb-card:has(.imdb-card-badge) .imdb-card-year-top {
        top: 24px;
        right: 4px;
    }
}
