/* =============================================================
   AnimeX — Component Styles
   Search Bar · Pagination · Search Result Header · Scroll
   ============================================================= */

/* ── Search Bar (Header + Mobile Panel) ─────────────────────── */
#searchBarContainer {
    position: relative;
    width: 100%;
}

/* Shared search icon wrap for both desktop & mobile panel */
#searchBarContainer .search-icon-wrap,
#mobileSearchPanel    .search-icon-wrap {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
    display: flex;
    align-items: center;
}

#searchBarContainer .search-icon-wrap svg,
#mobileSearchPanel    .search-icon-wrap svg {
    width: 16px;
    height: 16px;
}

/* Desktop search input */
#searchInput,
#mobileSearchInput {
    width: 100% !important;
    background-color: #13141c !important;
    color: #e5e7eb !important;
    padding: 9px 60px 9px 38px !important;
    border-radius: 9999px !important;
    border: 1px solid #1f2133 !important;
    font-size: 0.8125rem !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease !important;
    line-height: 1.5 !important;
}

#searchInput::placeholder,
#mobileSearchInput::placeholder { color: #4b5570 !important; }

#searchInput:focus,
#mobileSearchInput:focus {
    border-color: #2d2f45 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Mobile panel form must be position:relative for absolute children */
#mobileSearchPanel form {
    position: relative !important;
    width: 100% !important;
}

#searchSubmitBtn,
#mobileSearchSubmitBtn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #b9090b, #E50914);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 32px;
    padding: 0 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    box-shadow: 0 2px 10px rgba(229, 9, 20, 0.35);
}

#searchSubmitBtn:hover,
#mobileSearchSubmitBtn:hover {
    background: linear-gradient(135deg, #990000, #b9090b);
    box-shadow: 0 4px 16px rgba(229, 9, 20, 0.55);
    transform: translateY(-50%) scale(1.04);
}

#searchSubmitBtn:active,
#mobileSearchSubmitBtn:active {
    transform: translateY(-50%) scale(0.97);
    box-shadow: 0 1px 6px rgba(229, 9, 20, 0.3);
}

/* ── Mobile Search Panel ─────────────────────────────────── */
#mobileSearchPanel {
    animation: mobileSearchSlideDown 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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



/* ── Pagination ─────────────────────────────────────────────── */
.animex-pagination {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE/Edge */
    max-width: 100%;
    min-width: 0;
    /* Card-style wrapper */
    background-color: #131522;
    border: 1px solid #1f2133;
    padding: 0.625rem;            /* 10px */
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.animex-pagination::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.animex-pagination .page-numbers {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    background-color: var(--bg-card);
    color: #9ca3af;
    border: 1px solid var(--border-base);
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.animex-pagination a.page-numbers:hover,
.animex-pagination a.page-numbers:active,
.animex-pagination .page-numbers.current {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    text-decoration: none;
}

.animex-pagination .next.page-numbers,
.animex-pagination .prev.page-numbers { padding: 0 1rem; }

/* Disabled prev/next (first page or last page) */
.animex-pagination .prev.page-numbers[aria-disabled="true"],
.animex-pagination .next.page-numbers[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.animex-pagination .dots.page-numbers {
    background: transparent;
    border: none;
    color: #6b7280;
}

/* ── Pagination: wrapper visibility (Desktop vs Mobile) ─────── */
.animex-pagination--desktop {
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    margin-top: 3.5rem;
}

.animex-pagination--mobile {
    display: none;
    justify-content: center;
    padding: 0 1rem;
    margin-top: 3.5rem;
}

@media (max-width: 768px) {
    .animex-pagination--desktop {
        display: none;
    }

    .animex-pagination--mobile {
        display: flex;
    }
}

/* ── Pagination: mobile info (e.g. 5/7) ─────────────────────── */
.animex-pagination__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    padding: 0 0.5rem;
    pointer-events: none;
    background: transparent;
    border: none;
    flex-shrink: 0;
}

.animex-pagination__info-sep {
    color: #6b7280;
    margin: 0 2px;
    font-weight: 500;
}

.animex-pagination__info-total {
    color: #9ca3af;
}

/* ── Search Result Header ────────────────────────────────────── */
.search-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background-color: #0e0f1a;
    border: 1px solid #1a1c2e;
    border-radius: 0.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.search-result-header__left {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.search-result-header__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.search-result-header__bar {
    width: 4px;
    height: 2.2rem;
    background: var(--primary);
    border-radius: 9999px;
    flex-shrink: 0;
}

.search-result-header__title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.01em;
    margin: 0;
    line-height: 1.3;
}

.search-result-header__title span { color: var(--primary); }

.search-result-header__count {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 400;
    margin: 0;
}

.search-result-header__count strong {
    color: #a0aec0;
    font-weight: 600;
}

/* ── Seasons Horizontal Scroll — Hide Scrollbar ─────────────── */
#seasonsContainer::-webkit-scrollbar { display: none; }



/* ── Mobile Drawer Nav Links (Rule #7 — CSS :hover, no JS events) */
.animex-drawer-link {
    display: block;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    color: #9ca3af;
    transition: background-color 0.2s, color 0.2s;
}

.animex-drawer-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: none;
}

.animex-drawer-link--active {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-left: 3px solid #7c3aed;
    font-weight: 600;
}

.animex-drawer-link--active:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

/* ── Custom Select Dropdown ─────────────────────────────────── */
/* Use explicit hex values — CSS vars are unreliable on native <select> elements */
.animex-select {
    background-color: #1a1c2d !important;
    color: #9ca3af !important;
    border: 1px solid #1f2937 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animex-select:hover {
    color: #ffffff !important;
    border-color: #E50914 !important;
}

.animex-select:focus {
    border-color: #E50914 !important;
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.25) !important;
    outline: none !important;
}

/* Option items — explicit dark colors for cross-browser consistency */
.animex-select option {
    background-color: #131522 !important;
    color: #e5e7eb !important;
}

/* Selected option highlight — explicit primary red */
.animex-select option:checked {
    background-color: #b9090b !important;
    color: #ffffff !important;
}

/* ── Season Number Overlay (More Seasons cards) ─────────────── */
.season-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        rgba(12, 13, 20, 0.72) 0%,
        rgba(124, 58, 237, 0.12) 100%
    );
    transition: background 0.35s ease;
}

/* The big glitch number */
.season-overlay__number {
    position: relative;
    font-size: clamp(3.5rem, 10vw, 6rem);
    font-weight: 900;
    line-height: 1;
    color: transparent;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    letter-spacing: -0.04em;
    filter: drop-shadow(0 0 18px rgba(229, 9, 20, 0.55));
    transition: filter 0.35s ease, transform 0.35s ease;
}
.season-overlay__number::before {
    content: attr(data-sn);
    position: absolute;
    top: 0;
    left: 3px;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    z-index: -1;
    animation: sn-glitch-1 3s infinite linear alternate-reverse;
}

/* Ghost glitch layer 2 */
.season-overlay__number::after {
    content: attr(data-sn);
    position: absolute;
    top: 0;
    left: -3px;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    z-index: -1;
    animation: sn-glitch-2 3.8s infinite linear alternate-reverse;
}

@keyframes sn-glitch-1 {
    0%   { clip-path: inset(25% 0 60% 0); transform: translate(-3px, 0); }
    25%  { clip-path: inset(55% 0 15% 0); transform: translate(3px, 0); }
    50%  { clip-path: inset(35% 0 45% 0); transform: translate(-2px, 0); }
    75%  { clip-path: inset(70% 0 10% 0); transform: translate(3px, 0); }
    100% { clip-path: inset(15% 0 65% 0); transform: translate(-3px, 0); }
}

@keyframes sn-glitch-2 {
    0%   { clip-path: inset(10% 0 55% 0); transform: translate(3px, 0); }
    25%  { clip-path: inset(40% 0 25% 0); transform: translate(-3px, 0); }
    50%  { clip-path: inset(65% 0 20% 0); transform: translate(2px, 0); }
    75%  { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 0); }
    100% { clip-path: inset(50% 0 15% 0); transform: translate(3px, 0); }
}


/* ── Screenshots Gallery ────────────────────────────────────── */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .screenshots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}



.screenshots-grid__item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: #1a1c2d;
    border: 1px solid #1f2937;
}

.screenshots-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.screenshots-grid__item:hover img {
    transform: scale(1.05);
}

/* Remove overlay */



/* ── Custom Tag Groups (Homepage Movies/Series) ───────────── */
.custom-btn-groups {
    width: 100%;
    margin-bottom: 1rem;
}

.btn-group-label {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    gap: 0.5rem;
    text-transform: uppercase;
}

/* Gradient lines before and after the label */
.btn-group-label::before,
.btn-group-label::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E50914);
}
.btn-group-label::after {
    background: linear-gradient(270deg, transparent, #E50914);
}

.btn-group-label svg {
    color: #E50914;
}

.btn-group-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.c-tag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #d81b1b;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.02em;
}

.c-tag-btn:hover {
    background-color: #b91515;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(229, 9, 20, 0.3);
}

.c-tag-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(229, 9, 20, 0.3);
}

/* ── Responsive: Mobile (≤480px) ─────────────────────────── */
@media (max-width: 480px) {
    .custom-btn-groups {
        margin-bottom: 0.5rem;
    }

    .btn-group-label {
        font-size: 0.78rem;
        gap: 0.35rem;
        margin-bottom: 0.6rem;
    }

    .btn-group-label::before,
    .btn-group-label::after {
        width: 24px;
    }

    .btn-group-label svg {
        width: 14px;
        height: 14px;
    }

    .btn-group-row {
        gap: 0.4rem;
    }

    .c-tag-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.65rem;
        border-radius: 4px;
        letter-spacing: 0.01em;
    }
}

/* ── Responsive: Tablet (481px – 768px) ──────────────────── */
@media (min-width: 481px) and (max-width: 768px) {
    .btn-group-label {
        font-size: 0.88rem;
        gap: 0.4rem;
        margin-bottom: 0.75rem;
    }

    .btn-group-label::before,
    .btn-group-label::after {
        width: 30px;
    }

    .btn-group-label svg {
        width: 15px;
        height: 15px;
    }

    .btn-group-row {
        gap: 0.55rem;
    }

    .c-tag-btn {
        font-size: 0.78rem;
        padding: 0.42rem 0.85rem;
    }
}

/* ── Anime Card Below-Image Title ───────────────────────────
   Rule: CSS-only truncation (no JS). Animate only opacity/transform.
   BEM: .anime-card__title
   ─────────────────────────────────────────────────────────── */
.anime-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.25rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #d1d5db;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.anime-card:hover .anime-card__title {
    color: #ffffff;
}

/* ── Navigation Submenus (Desktop & Mobile) ──────────────────── */

/* Desktop Submenu (Hover Triggered) */
@media (min-width: 1024px) {
    #desktopHeader nav ul li {
        position: relative;
    }

    #desktopHeader nav ul li .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 190px;
        background-color: #0d0d0d;
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        padding: 8px 0;
        margin-top: 4px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
        z-index: 50;
        display: flex;
        flex-direction: column;
        list-style: none;
    }

    #desktopHeader nav ul li:hover > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    #desktopHeader nav ul li .sub-menu li {
        padding: 0 8px;
    }

    /* Submenu links style */
    #desktopHeader nav ul li .sub-menu li a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        color: #9ca3af;
        font-size: 0.9rem;
        font-weight: 500;
        border-radius: 6px;
        transition: background-color 0.2s ease, color 0.2s ease;
        text-decoration: none;
    }

    #desktopHeader nav ul li .sub-menu li a:hover {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.06);
    }

    /* Deep nested submenus (Level 3+) */
    #desktopHeader nav ul li .sub-menu .sub-menu {
        top: 0;
        left: 100%;
        margin-top: 0;
        margin-left: 4px;
    }

    /* Carets for items with children */
    #desktopHeader nav ul li.menu-item-has-children > a::after {
        content: '';
        display: inline-block;
        width: 14px;
        height: 14px;
        margin-left: 2px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        vertical-align: middle;
        transition: transform 0.2s ease;
    }
    
    #desktopHeader nav ul li.menu-item-has-children:hover > a::after {
        transform: rotate(180deg);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    }

    /* Submenu carets point right */
    #desktopHeader nav ul li .sub-menu li.menu-item-has-children > a::after {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
        margin-left: auto;
    }
    #desktopHeader nav ul li .sub-menu li.menu-item-has-children:hover > a::after {
        transform: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
    }
}

/* Mobile Submenu (Indented List) */
@media (max-width: 1023px) {
    #mobileMenu nav ul li .sub-menu {
        display: none; /* Hide by default */
        flex-direction: column;
        gap: 2px;
        padding-left: 16px;
        margin-top: 4px;
        margin-bottom: 6px;
        border-left: 1px solid rgba(255, 255, 255, 0.05);
        list-style: none;
    }

    #mobileMenu nav ul li.is-open > .sub-menu {
        display: flex; /* Show when open */
    }

    #mobileMenu nav ul li .sub-menu li a {
        display: block;
        padding: 8px 12px;
        color: #9ca3af;
        font-size: 0.85rem;
        font-weight: 500;
        border-radius: 6px;
        text-decoration: none;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    #mobileMenu nav ul li .sub-menu li a:hover {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.04);
    }

    /* Mobile Carets for items with children */
    #mobileMenu nav ul li.menu-item-has-children > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    #mobileMenu nav ul li.menu-item-has-children > a::after {
        content: '';
        display: inline-block;
        width: 14px;
        height: 14px;
        margin-left: 2px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        transition: transform 0.2s ease;
    }
    
    #mobileMenu nav ul li.menu-item-has-children.is-open > a::after {
        transform: rotate(180deg);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    }
}

/* ==========================================================================
   TMDB Screenshots & Cast (BEM)
   ========================================================================== */

/* TMDB Screenshots Grid */
.screenshots-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .screenshots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .screenshots-grid--tmdb {
        grid-template-columns: repeat(4, 1fr);
    }
}

.screenshots-grid__item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: #111;
}

.screenshots-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.screenshots-grid__item:hover img {
    transform: scale(1.05);
}

/* Image Modal */
.image-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.image-modal__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
}

.image-modal__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 2;
}

.image-modal__content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.image-modal.is-open .image-modal__content img {
    transform: scale(1);
}

.image-modal__close {
    position: absolute;
    top: -40px;
    right: -10px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.image-modal__close:hover {
    opacity: 1;
}

@media (min-width: 768px) {
    .image-modal__close {
        right: -40px;
    }
}

/* TMDB Cast Carousel */
.tmdb-cast__list {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.tmdb-cast__item:hover .tmdb-cast__avatar-wrap img {
    transform: scale(1.1);
}

.tmdb-cast__avatar-wrap img {
    transition: transform 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   REVIEW SECTION — BEM Components
   Follows: CSS variables from base.css, animate only transform/opacity,
            no JS-driven animation, BEM naming (.block__element--modifier).
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ─────────────────────────────────────────────────────────── */
.rv-section {
    margin-top: 3rem;
    margin-bottom: 0.5rem;
}

.rv-section__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.rv-section__title {
    font-size: 1.125rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .rv-section__title { font-size: 1.5rem; }
}

/* ── Rating Cards Grid ───────────────────────────────────────────────────────── */
.rv-ratings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
    .rv-ratings-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Individual Card ─────────────────────────────────────────────────────────── */
.rv-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    cursor: default;
}

.rv-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.rv-card__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rv-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.rv-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.rv-card__score {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.rv-card__score-max {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
}

.rv-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rv-card__count {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.1rem;
}

.rv-card--rt:hover     { border-color: rgba(250, 50, 10, 0.4); }
.rv-card--popcorn:hover { border-color: rgba(255, 158, 0, 0.4); }
.rv-card--tmdb:hover   { border-color: rgba(1, 180, 228, 0.4); }
.rv-card--imdb:hover   { border-color: rgba(245, 197, 24, 0.4); }

/* ── Our Review Block ────────────────────────────────────────────────────────── */
.rv-our-review {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .rv-our-review {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.5rem;
    }
}

.rv-our-review__score-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    flex-shrink: 0;
}

.rv-our-review__score {
    display: flex;
    align-items: baseline;
    gap: 0.1rem;
    line-height: 1;
}

.rv-our-review__score-num {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.04em;
}

.rv-our-review__score-denom {
    font-size: 1rem;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    align-self: flex-end;
    margin-bottom: 0.3rem;
}

.rv-our-review__stars {
    display: flex;
    gap: 1px;
    font-size: 1.125rem;
}

.rv-star { transition: opacity 0.15s ease; }
.rv-star--full  { color: #f5c518; }
.rv-star--half  { color: #f5c518; opacity: 0.65; }
.rv-star--empty { color: rgba(255,255,255,0.15); }

.rv-our-review__reviewer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.rv-our-review__reviewer-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.rv-our-review__reviewer-name {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    font-weight: 600;
}

.rv-our-review__text-wrap {
    flex: 1;
    min-width: 0;
    align-self: center;
}

.rv-review-text {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.75);
}

/* Collapsible review — <details>/<summary> no-JS pattern */
.rv-review-details {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9375rem;
    line-height: 1.65;
}

.rv-review-details__summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    flex-wrap: wrap;
    user-select: none;
    -webkit-user-select: none;
}

.rv-review-details__summary::-webkit-details-marker { display: none; }
.rv-review-details__summary::marker { display: none; }

.rv-review-excerpt { flex: 1; color: rgba(255,255,255,0.65); }

.rv-review-details__toggle--open  { display: flex; }
.rv-review-details__toggle--close { display: none; }
.rv-review-details[open] .rv-review-details__toggle--open  { display: none; }
.rv-review-details[open] .rv-review-details__toggle--close { display: flex; }
.rv-review-details[open] .rv-review-excerpt { display: none; }

.rv-review-details__toggle { color: rgba(255,255,255,0.4); }
.rv-review-details__toggle:hover { color: rgba(255,255,255,0.7); }

.rv-chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.rv-review-details__full {
    margin-top: 0.75rem;
    color: rgba(255,255,255,0.75);
    animation: rv-fade-in 0.2s ease;
}

@keyframes rv-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .rv-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.875rem;
    }
    .rv-card__score { font-size: 1.25rem; }
    .rv-our-review__score-num { font-size: 2rem; }
}
