/* AniGlass Base Styles & Utilities */

/* ─── Screen Reader Accessibility (WCAG 2.1 AAA Compliant) ─── */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}
.screen-reader-text:focus {
    background-color: #181824;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
    clip: auto !important;
    -webkit-clip-path: none;
    clip-path: none;
    color: #ffffff;
    display: block;
    font-size: 14px;
    font-weight: 700;
    height: auto;
    left: 10px;
    line-height: normal;
    padding: 12px 20px;
    text-decoration: none;
    top: 10px;
    width: auto;
    z-index: 100000;
}

:root {
    --bg-color: #050508;
    /* Deep obsidian black */
    --text-color: #ffffff;
    --text-muted: #9ca3af;
    /* Soft gray */
    --glass-bg: rgba(12, 12, 16, 0.75);
    --glass-border: rgba(255, 255, 255, 0.07);
    --accent-color: #a855f7;
    /* Vibrant violet */
    --accent-hover: #9333ea;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Spring Animation */
    --spring-transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    --smooth-transition: all 0.3s ease;
}

/* ─── Light Mode ─── */
html.light-mode {
    --bg-color: #f0f0f5;
    --text-color: #1d1d1f;
    --text-muted: #52525b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
}

/* Body & page background */
html.light-mode body {
    background-color: #f0f0f5;
    background-image: none;
    color: #1d1d1f;
}

/* Header and navs */
.glass-nav {
    background: rgba(6, 6, 9, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

html.light-mode .glass-nav {
    background: rgba(245, 245, 247, 0.88) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .glass-bottom-nav {
    background: rgba(255, 255, 255, 0.75) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .mobile-bottom-nav a {
    color: #1d1d1f !important;
}

/* Sidebar */
html.light-mode #sidebar-panel {
    background: #f0f0f5 !important;
    border-right-color: rgba(0, 0, 0, 0.08) !important;
}

/* Cards and glass panels */
html.light-mode .glass-panel {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

/* Episode card backgrounds */
html.light-mode .episode-card,
html.light-mode div[style*="background: #222"],
html.light-mode div[style*="background:#222"] {
    background: #e8e8ed !important;
    color: #1d1d1f !important;
}

/* Home row sections */
html.light-mode .home-row h3,
html.light-mode .library-section h3 {
    color: #1d1d1f;
}

/* Buttons */
html.light-mode .btn-glass {
    background: rgba(255, 255, 255, 0.5);
    color: #1d1d1f;
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 1px #ffffff, 0 4px 10px rgba(0, 0, 0, 0.05);
}

html.light-mode .btn-glass:hover {
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid #ffffff;
    box-shadow: inset 0 1px 2px #ffffff, 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Header buttons */
html.light-mode .site-header button,
html.light-mode header button {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(30px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(150%) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.8) !important;
    color: #1d1d1f !important;
    box-shadow: inset 0 1px 1px #ffffff, 0 4px 10px rgba(0, 0, 0, 0.05);
}

.site-header button {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(30px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(150%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.site-header button:hover {
    background: rgba(168, 85, 247, 0.2) !important;
    border-top: 1px solid rgba(168, 85, 247, 0.5) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 4px 20px rgba(168, 85, 247, 0.4);
}

/* Search */
html.light-mode .search-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 1px #ffffff, 0 4px 10px rgba(0, 0, 0, 0.05);
    color: #1d1d1f;
}

html.light-mode .search-card:hover {
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid #ffffff;
    box-shadow: inset 0 1px 2px #ffffff, 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Quick View layout */
.quick-view-split {
    display: flex;
    flex-direction: row;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #08080b;
    color: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--smooth-transition);
}

.qv-mobile-handle {
    display: none;
}

.qv-header-wrap {
    display: block;
}

.qv-mobile-thumb {
    display: none;
}

.qv-image-section {
    width: 38%;
    min-width: 240px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 20px 0 0 20px;
    position: relative;
}

.qv-content-section {
    flex: 1;
    padding: 35px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    background: #08080b;
    color: #ffffff;
    border-radius: 0 20px 20px 0;
}

.qv-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
}

.qv-native-title {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 14px;
    font-style: italic;
}

.qv-meta-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 600;
    flex-wrap: wrap;
}

.qv-badge-score {
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 3px 8px;
    border-radius: 6px;
    color: #eab308;
    background: rgba(234, 179, 8, 0.12);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.qv-badge-meta {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 3px 9px;
    border-radius: 6px;
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.06);
    font-size: 12px;
    font-weight: 600;
}

.qv-badge-hd {
    border: 1px solid rgba(34, 197, 94, 0.4);
    padding: 3px 8px;
    border-radius: 6px;
    color: #16a34a;
    background: rgba(34, 197, 94, 0.12);
    font-weight: 700;
}

.qv-genres-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.qv-genre-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d5db;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.qv-synopsis {
    font-size: 13px;
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qv-cast-section {
    margin-bottom: 22px;
}

.qv-cast-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9ca3af;
    font-weight: 700;
    margin-bottom: 8px;
}

.qv-cast-scroller {
    display: flex;
    gap: 10px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch;
}
.qv-cast-scroller::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.qv-cast-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 12px 4px 4px;
    border-radius: 30px;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s, transform 0.2s;
}
.qv-cast-pill:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.qv-cast-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.qv-cast-avatar-fallback {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #e5e7eb;
    flex-shrink: 0;
}

.qv-cast-info {
    line-height: 1.2;
}

.qv-cast-name {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.qv-cast-char {
    font-size: 10px;
    color: #9ca3af;
    white-space: nowrap;
}

.qv-watch-btn {
    background: #e50914;
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.35);
    transition: background 0.2s, transform 0.2s;
}
.qv-watch-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.qv-trailer-btn {
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-decoration: none;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transition: background 0.2s, transform 0.2s;
}
.qv-trailer-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.qv-mylist-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.qv-mylist-btn svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    margin: auto !important;
    pointer-events: none !important;
    transition: transform 0.2s ease;
}
.qv-mylist-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.qv-mylist-btn:active {
    transform: scale(0.95);
}
.qv-mylist-btn.in-list {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.6) !important;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3) !important;
}

#quick-view-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
#quick-view-body::-webkit-scrollbar {
    width: 6px;
}
#quick-view-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .quick-view-split {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .qv-image-section {
        width: 100% !important;
        min-width: 100% !important;
        height: 230px !important;
        background-position: center top !important;
        border-radius: 20px 20px 0 0 !important;
        position: relative !important;
    }

    .qv-image-section::after {
        display: none !important;
    }

    .qv-content-section {
        width: 100% !important;
        padding: 20px 18px 24px !important;
        margin-top: 0 !important;
        position: relative !important;
        z-index: 2 !important;
        border-radius: 0 0 20px 20px !important;
    }

    .qv-content-section .qv-title {
        font-size: 22px !important;
        margin-bottom: 4px !important;
        line-height: 1.2 !important;
    }

    .qv-content-section p {
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
        margin-bottom: 14px !important;
        font-size: 13px !important;
        line-height: 1.5 !important;
    }
}

/* Modal Overlay & Close Button (Dark Mode Default) */
.modal-overlay {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
    width: 44px;
    height: 44px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2001;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 0;
    line-height: 1;
    transition: background 0.2s, transform 0.2s;
}
.modal-close:hover {
    transform: scale(1.08);
}

/* QuickView Mobile Compact Bottom Sheet Adaptation */
@media (max-width: 768px) {
    #quick-view-modal {
        padding: 0 !important;
        align-items: flex-end !important;
        justify-content: center !important;
    }

    #quick-view-modal .modal-content,
    #quick-view-modal > div {
        max-height: 86vh !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px)) !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7) !important;
        background: #121018 !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-bottom: none !important;
    }

    #quick-view-body {
        max-height: calc(86vh - 25px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #quick-view-modal .modal-close {
        top: 12px !important;
        right: 12px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
        z-index: 25 !important;
        background: rgba(255, 255, 255, 0.12) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
    }

    .qv-mobile-handle {
        display: block !important;
        width: 38px;
        height: 4px;
        background: rgba(255, 255, 255, 0.25);
        border-radius: 9999px;
        margin: 10px auto 4px auto;
    }

    .quick-view-split {
        flex-direction: column !important;
        border-radius: 20px 20px 0 0 !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .qv-image-section {
        display: none !important;
    }

    .qv-content-section {
        padding: 12px 16px 18px !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    /* Compact Mobile Header Row (Poster thumbnail on left, title & badges on right) */
    .qv-header-wrap {
        display: flex !important;
        gap: 14px !important;
        align-items: flex-start !important;
        margin-bottom: 12px !important;
        padding-right: 28px; /* space for close button */
    }

    .qv-mobile-thumb {
        display: block !important;
        width: 88px !important;
        height: 132px !important;
        flex-shrink: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        position: relative !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
    }

    .qv-mobile-thumb img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    .qv-mobile-country-badge {
        position: absolute !important;
        bottom: 5px !important;
        left: 4px !important;
        right: 4px !important;
        background: rgba(0, 0, 0, 0.78) !important;
        backdrop-filter: blur(6px) !important;
        -webkit-backdrop-filter: blur(6px) !important;
        padding: 2px 4px !important;
        border-radius: 5px !important;
        font-size: 9.5px !important;
        font-weight: 700 !important;
        color: #fff !important;
        text-align: center !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .qv-header-meta {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .qv-title {
        font-size: 16px !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        margin: 0 0 3px 0 !important;
        color: #ffffff !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .qv-native-title {
        font-size: 11.5px !important;
        margin-bottom: 6px !important;
        color: #9ca3af !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .qv-meta-row {
        gap: 5px !important;
        margin-bottom: 8px !important;
        font-size: 11px !important;
    }

    .qv-badge-score,
    .qv-badge-meta,
    .qv-badge-hd {
        padding: 2px 6px !important;
        font-size: 10.5px !important;
        border-radius: 5px !important;
    }

    .qv-genres-row {
        gap: 4px !important;
        margin-bottom: 10px !important;
    }

    .qv-genre-pill {
        padding: 2px 8px !important;
        font-size: 10.5px !important;
        border-radius: 12px !important;
    }

    .qv-seasons-row,
    .qv-languages-row {
        margin-bottom: 10px !important;
    }

    .qv-season-pill,
    .qv-lang-pill {
        padding: 2px 8px !important;
        font-size: 10.5px !important;
        border-radius: 12px !important;
    }

    .qv-synopsis {
        font-size: 12px !important;
        line-height: 1.45 !important;
        margin-bottom: 10px !important;
        color: #c4c4c8 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .qv-cast-section {
        margin-bottom: 12px !important;
    }

    .qv-cast-label {
        font-size: 9.5px !important;
        margin-bottom: 5px !important;
    }

    .qv-cast-pill {
        padding: 2px 8px 2px 2px !important;
        gap: 5px !important;
    }

    .qv-cast-avatar,
    .qv-cast-avatar-fallback {
        width: 22px !important;
        height: 22px !important;
        font-size: 9.5px !important;
    }

    .qv-cast-name {
        font-size: 10.5px !important;
    }

    .qv-cast-char {
        font-size: 8.5px !important;
    }

    /* Actions row on mobile */
    .qv-actions-row {
        display: flex !important;
        gap: 8px !important;
        align-items: center !important;
        margin-top: 4px !important;
        padding-top: 8px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    .qv-watch-btn {
        flex: 1 !important;
        justify-content: center !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
        border-radius: 9999px !important;
    }

    .qv-trailer-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        border-radius: 9999px !important;
    }

    .qv-mylist-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    .qv-mylist-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Sidebar nav links */
html.light-mode .sidebar-menu-list a,
body.light-mode .sidebar-menu-list a {
    color: #1d1d1f;
}

html.light-mode .sidebar-menu-list a:hover,
body.light-mode .sidebar-menu-list a:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Modal and Overlays */
html.light-mode .modal-overlay,
body.light-mode .modal-overlay,
html.light-mode #search-modal,
body.light-mode #search-modal {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
}

/* Quick View modal layout text and backgrounds in Light Mode */
html.light-mode #quick-view-body,
body.light-mode #quick-view-body {
    color: #0f172a !important;
    background: transparent !important;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
html.light-mode #quick-view-body::-webkit-scrollbar-thumb,
body.light-mode #quick-view-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

html.light-mode .modal-content,
body.light-mode .modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.light-mode .quick-view-split,
body.light-mode .quick-view-split {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.2) !important;
}

html.light-mode .qv-content-section,
body.light-mode .qv-content-section {
    background: #ffffff !important;
    color: #0f172a !important;
}

html.light-mode .qv-title,
body.light-mode .qv-title {
    color: #0f172a !important;
}

html.light-mode .qv-native-title,
body.light-mode .qv-native-title {
    color: #64748b !important;
}

html.light-mode .qv-badge-score,
body.light-mode .qv-badge-score {
    background: #fef9c3 !important;
    border-color: #fde047 !important;
    color: #a16207 !important;
}

html.light-mode .qv-badge-meta,
body.light-mode .qv-badge-meta {
    border-color: #cbd5e1 !important;
    background: #f1f5f9 !important;
    color: #334155 !important;
}

html.light-mode .qv-badge-hd,
body.light-mode .qv-badge-hd {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
    color: #16a34a !important;
}

html.light-mode .qv-genre-pill,
body.light-mode .qv-genre-pill {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

html.light-mode .qv-synopsis,
body.light-mode .qv-synopsis {
    color: #334155 !important;
}

html.light-mode .qv-cast-label,
body.light-mode .qv-cast-label {
    color: #64748b !important;
}

html.light-mode .qv-cast-pill,
body.light-mode .qv-cast-pill {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
html.light-mode .qv-cast-pill:hover,
body.light-mode .qv-cast-pill:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

html.light-mode .qv-cast-name,
body.light-mode .qv-cast-name {
    color: #0f172a !important;
    font-weight: 700 !important;
}

html.light-mode .qv-cast-char,
body.light-mode .qv-cast-char {
    color: #64748b !important;
}

html.light-mode .qv-watch-btn,
body.light-mode .qv-watch-btn {
    background: #e50914 !important;
    color: #ffffff !important;
}



html.light-mode .qv-trailer-btn,
body.light-mode .qv-trailer-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .qv-trailer-btn:hover,
body.light-mode .qv-trailer-btn:hover {
    background: #e2e8f0 !important;
}

html.light-mode .modal-close,
body.light-mode .modal-close {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12) !important;
}

/* Inputs and Selects (Search bar, Server Selector) */
html.light-mode input[type="search"],
html.light-mode #live-search-input {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #1d1d1f !important;
}

html.light-mode #search-close {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #1d1d1f !important;
}

html.light-mode .server-selector-container {
    background: #e8e8ed !important;
}

html.light-mode .server-selector-container select,
html.light-mode .server-selector-container span {
    color: #1d1d1f !important;
}

html.light-mode #server-selector option {
    background: #fff !important;
    color: #1d1d1f !important;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(168, 85, 247, 0.04) 0%, transparent 45%),
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.02) 0%, transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.03) 0%, transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(236, 72, 153, 0.02) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Eliminate GPU scroll jank on mobile */
@media (max-width: 880px) {
    body,
    html.light-mode body {
        background-attachment: scroll !important;
    }
}

/* Mobile Touch Optimization & Tactile Physics */
a, button, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.drama-card,
.glass-card,
.actor-card,
.episode-card,
.btn-glass,
.liquid-nav-item,
.liquid-nav-circle,
.header-drama-back-btn,
.header-main-hamburger,
.hero-trailer-btn,
.hero-play-primary-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.drama-card:active,
.glass-card:active,
.actor-card:active,
.episode-card:active,
.liquid-nav-item:active,
.liquid-nav-circle:active {
    transform: scale(0.96) !important;
    transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--smooth-transition);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    font-weight: 700;
}

p {
    line-height: 1.6;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-nav {
    background: rgba(6, 6, 9, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--glass-border);
}

/* App Store Style Liquid Navigation (Mobile Bottom) */
.liquid-bottom-container {
    position: fixed;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    transform: translateX(-50%) translateZ(0) !important;
    -webkit-transform: translateX(-50%) translateZ(0) !important;
    display: flex !important;
    gap: 12px;
    z-index: 999;
}

/* Responsive Single Drama / Anime Header Controls (Dynamically switched via body class) */
@media (max-width: 880px) {
    /* Default state on mobile for general pages (home, browse, actors, upcoming, trending, etc.) */
    .header-drama-back-btn,
    .header-drama-mobile-menu {
        display: none !important;
    }
    .header-main-hamburger,
    .header-main-logo,
    .header-main-theme-btn,
    .header-main-search-btn,
    .header-main-notif-btn {
        display: flex !important;
    }

    /* Single Drama & Single Anime pages on mobile: display circular back button & mobile drawer menu, hide standard logo/hamburger */
    body.single-drama .header-drama-back-btn,
    body.single-anime .header-drama-back-btn,
    body.single .header-drama-back-btn {
        display: flex !important;
    }
    body.single-drama .header-drama-mobile-menu,
    body.single-anime .header-drama-mobile-menu,
    body.single .header-drama-mobile-menu {
        display: flex !important;
    }
    body.single-drama .header-main-hamburger,
    body.single-anime .header-main-hamburger,
    body.single .header-main-hamburger,
    body.single-drama .header-main-logo,
    body.single-anime .header-main-logo,
    body.single .header-main-logo,
    body.single-drama .header-main-theme-btn,
    body.single-anime .header-main-theme-btn,
    body.single .header-main-theme-btn,
    body.single-drama .header-main-search-btn,
    body.single-anime .header-main-search-btn,
    body.single .header-main-search-btn {
        display: none !important;
    }
}

@media (min-width: 881px) {
    /* Desktop: always show full logo, hamburger, search, theme, desktop nav pills. Hide mobile drama back button. */
    .header-drama-back-btn,
    .header-drama-mobile-menu {
        display: none !important;
    }
    .header-main-hamburger,
    .header-main-logo,
    .header-main-theme-btn,
    .header-main-search-btn,
    .header-main-notif-btn,
    .header-desktop-nav {
        display: flex !important;
    }
}

body.drama-comments-drawer-active .liquid-bottom-container,
body.drama-comments-drawer-active .mobile-bottom-nav {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(100px) !important;
    transition: transform 0.25s ease, opacity 0.25s ease !important;
}

.liquid-nav-main {
    display: flex;
    align-items: center;
    border-radius: 100px;
    padding: 6px;
    background: rgba(10, 10, 14, 0.85);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 10px 40px rgba(0, 0, 0, 0.6);
}

.liquid-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 56px;
    border-radius: 100px;
    color: var(--text-color);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.liquid-nav-item.active {
    background: var(--accent-color);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    color: #ffffff;
}

.liquid-nav-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    background: rgba(10, 10, 14, 0.88);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

html.light-mode .liquid-nav-main,
html.light-mode .liquid-nav-circle {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

html.light-mode .liquid-nav-item.active {
    background: #ffffff;
    /* Light mode inner pill */
    color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Subtle lift */
}

html.light-mode .liquid-nav-item {
    color: #1d1d1f;
}

html.light-mode .liquid-nav-circle {
    color: #1d1d1f;
}

/* Server Segmented Control (Tabs) */
.server-segmented-control {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: 100px;
    margin: 0;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for cleaner look */
.server-segmented-control::-webkit-scrollbar {
    display: none;
}

.server-segmented-control {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html.light-mode .server-segmented-control {
    background: #e5e5ea;
}

.server-tab {
    padding: 8px 24px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    color: #8e8e93;
    /* Dark gray text */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    background: transparent;
    border: none;
    outline: none;
}

.server-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.server-tab.active {
    font-weight: 700;
    color: #ffffff;
}

html.light-mode .server-tab {
    color: #64748b;
}

html.light-mode .server-tab:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

html.light-mode .server-tab.active {
    color: #ffffff;
}

/* Light mode episode cards */
html.light-mode .episode-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .episode-card:hover {
    background: #ffffff !important;
}


/* Glass Segmented Control (Tabs) */
.glass-segmented-control {
    display: inline-flex;
    background: rgba(12, 12, 16, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 4px;
    border-radius: 100px;
    margin: 20px 0;
}

html.light-mode .glass-segmented-control {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.05);
}

.glass-tab {
    padding: 8px 24px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    background: transparent;
    border: none;
    outline: none;
}

.glass-tab:hover {
    color: var(--text-color);
}

.glass-tab.active {
    background: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

html.light-mode .glass-tab.active {
    background: #ffffff;
    color: #1d1d1f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: var(--spring-transition);
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(126, 34, 206, 0.8));
    color: #ffffff;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 4px 15px rgba(147, 51, 234, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.9), rgba(147, 51, 234, 0.9));
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3), 0 8px 25px rgba(147, 51, 234, 0.6);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 12px 30px rgba(0, 0, 0, 0.3);
}

.btn-glass-hero {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

.btn-glass-hero:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3), 0 15px 40px rgba(0, 0, 0, 0.5) !important;
}

/* iOS 26 Liquid Glass Button */
.ios-liquid-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 2px 4px rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    outline: none;
}

.ios-liquid-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
}

.ios-liquid-button:active {
    transform: translateY(1px);
    background: rgba(255, 255, 255, 0.08);
}

html.light-mode .ios-liquid-button {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-top: 1px solid #ffffff;
    border-left: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 2px 4px #ffffff;
    color: #1d1d1f;
}

html.light-mode .ios-liquid-button:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), inset 0 2px 4px #ffffff;
}

html.light-mode .ios-liquid-button:active {
    background: rgba(255, 255, 255, 0.5);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-main {
    padding-top: 80px;
    /* Space for fixed header */
    padding-bottom: 100px;
    /* Space for mobile nav */
}

/* Horizontal Scroll Rows */
/* Horizontal Scroll Rows */
.horizontal-scroll {
    display: flex;
    align-items: flex-start !important;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 12px;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll>* {
    flex: 0 0 auto;
}

.horizontal-scroll .anime-card,
.horizontal-scroll .drama-card {
    height: auto !important;
    margin-bottom: 0 !important;
    align-self: flex-start !important;
}

.horizontal-scroll .drama-card .anime-card-info {
    flex-grow: 0 !important;
}

.horizontal-scroll .carousel-card-col,
.horizontal-scroll>div {
    width: 160px;
    flex: 0 0 160px;
    flex-shrink: 0 !important;
    align-self: flex-start !important;
    height: auto !important;
}

/* ==========================================================================
   Horizontal Carousel Navigation & Side Fade Effects
   ========================================================================== */
.carousel-wrapper {
    position: relative;
    width: 100%;
}

.carousel-wrapper .horizontal-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Edge Fade Vignette Overlays */
.carousel-fade {
    position: absolute;
    top: 0;
    bottom: 12px;
    width: 85px;
    pointer-events: none;
    z-index: 6;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.carousel-fade-left {
    left: 0;
    background: linear-gradient(to right, var(--bg-color) 12%, rgba(5, 5, 8, 0.85) 45%, transparent 100%);
}

.carousel-fade-right {
    right: 0;
    background: linear-gradient(to left, var(--bg-color) 12%, rgba(5, 5, 8, 0.85) 45%, transparent 100%);
}

html.light-mode .carousel-fade-left {
    background: linear-gradient(to right, var(--bg-color) 12%, rgba(240, 240, 245, 0.8) 45%, transparent 100%);
}

html.light-mode .carousel-fade-right {
    background: linear-gradient(to left, var(--bg-color) 12%, rgba(240, 240, 245, 0.8) 45%, transparent 100%);
}

/* Vertical Capsule / Pill Navigation Buttons */
.carousel-nav-btn {
    position: absolute;
    top: 120px;
    transform: translateY(-50%);
    width: 36px;
    height: 80px;
    border-radius: 9999px;
    background: rgba(18, 14, 28, 0.76);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    outline: none;
    padding: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.carousel-nav-prev {
    left: 8px;
}

.carousel-nav-next {
    right: 8px;
}

.carousel-nav-btn:hover {
    background: rgba(36, 26, 56, 0.95);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 14px rgba(168, 85, 247, 0.3);
}

.carousel-nav-btn:active {
    transform: translateY(-50%) scale(0.96);
}

.carousel-nav-btn svg {
    display: block;
    stroke: #ffffff;
    transition: transform 0.2s ease;
}

.carousel-nav-prev:hover svg {
    transform: translateX(-2px);
}

.carousel-nav-next:hover svg {
    transform: translateX(2px);
}

/* Light Mode Navigation */
html.light-mode .carousel-nav-btn {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #1d1d1f;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

html.light-mode .carousel-nav-btn svg {
    stroke: #1d1d1f;
}

html.light-mode .carousel-nav-btn:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.22);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

/* Hidden State */
.carousel-nav-btn.is-hidden,
.carousel-fade.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .carousel-fade {
        width: 48px;
    }
    .carousel-nav-btn {
        top: 110px;
        width: 28px;
        height: 64px;
    }
    .carousel-nav-prev {
        left: 4px;
    }
    .carousel-nav-next {
        right: 4px;
    }
    .carousel-nav-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Trending Header Navigation Link */
.trending-page-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #ff4757;
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid rgba(255, 71, 87, 0.32);
    padding: 4px 12px;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.25s ease;
    user-select: none;
}

.trending-page-link:hover {
    background: rgba(255, 71, 87, 0.22) !important;
    border-color: rgba(255, 71, 87, 0.65) !important;
    color: #ff6b81 !important;
    transform: translateX(2px);
    box-shadow: 0 0 14px rgba(255, 71, 87, 0.35);
}

.trending-page-link:active {
    transform: scale(0.96);
}

html.light-mode .trending-page-link {
    background: rgba(255, 71, 87, 0.08);
    border-color: rgba(255, 71, 87, 0.28);
    color: #e84118;
}

html.light-mode .trending-page-link:hover {
    background: rgba(255, 71, 87, 0.16) !important;
    border-color: rgba(255, 71, 87, 0.5) !important;
}


/* Typography Utilities */
.text-muted {
    color: var(--text-muted);
}

.text-xs {
    font-size: 12px;
}

.text-sm {
    font-size: 14px;
}

.text-md {
    font-size: 16px;
}

.text-lg {
    font-size: 18px;
}

.text-xl {
    font-size: 24px;
}

.text-2xl {
    font-size: 32px;
}

.text-3xl {
    font-size: 40px;
}

/* My List UI Components */
.cw-card {
    display: flex;
    padding: 12px;
    gap: 15px;
    align-items: center;
    border-radius: 20px;
    text-decoration: none;
    background: rgba(12, 12, 16, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.cw-card:hover {
    background: rgba(60, 60, 60, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.cw-title {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
}

.cw-text {
    color: #8e8e93;
}

/* Continue Watching Light Mode */
html.light-mode .cw-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

html.light-mode .cw-card:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

html.light-mode .cw-title {
    color: #1d1d1f;
}

/* Discover More Card */
.discover-more-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    min-height: 240px;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 20px;
    text-align: center;
}

.discover-more-card svg {
    stroke: rgba(255, 255, 255, 0.3);
}

.discover-more-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 5px;
}

.discover-more-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Discover More Light Mode */
html.light-mode .discover-more-card {
    border-color: rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

html.light-mode .discover-more-card svg {
    stroke: rgba(0, 0, 0, 0.3);
}

html.light-mode .discover-more-card h3 {
    color: #1d1d1f;
}

html.light-mode .discover-more-card:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.25);
}

/* Empty State Classes */
.empty-state-icon-box {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-state-icon-box svg {
    stroke: rgba(255, 255, 255, 0.2);
}

html.light-mode .empty-state-icon-box {
    background: rgba(0, 0, 0, 0.05);
}

html.light-mode .empty-state-icon-box svg {
    stroke: rgba(0, 0, 0, 0.3);
}

html.light-mode .empty-state-title {
    color: #1d1d1f;
}

/* Plan to Watch Badge */
.ptw-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #8e8e93;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

html.light-mode .ptw-badge {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.05);
    color: #6e6e73;
}

/* Custom Ad Slots Styling */
.aniglass-ad-slot {
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* Ensure scripts and styles inside ad slots NEVER display text on screen */
.aniglass-ad-slot script,
.aniglass-ad-slot style,
.aniglass-ad-slot noscript {
    display: none !important;
    visibility: hidden !important;
}

.aniglass-ad-slot > *:not(script):not(style):not(noscript) {
    max-width: 100%;
    border-radius: 12px;
}

.aniglass-ad-slot img,
.aniglass-ad-slot iframe,
.aniglass-ad-slot .aniglass-ad-frame {
    object-fit: contain;
    max-width: 100% !important;
    height: auto;
    border: none;
    display: block;
    margin: 0 auto;
    background: transparent;
}

/* Specific Ad Banner Sizes */
.ad-size-468x60 {
    max-width: 468px;
    min-height: 60px;
    margin: 0 auto;
}

.ad-size-300x250 {
    max-width: 300px;
    min-height: 250px;
    margin: 0 auto;
}

.ad-size-728x90 {
    max-width: 728px;
    min-height: 90px;
    margin: 0 auto;
}

.ad-size-320x50 {
    max-width: 320px;
    min-height: 50px;
    margin: 0 auto;
}

.ad-size-adaptive {
    width: 100%;
}

/* Player Overlay Ad (Single Drama) */
.drama-player-overlay-ad {
    position: absolute;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 8, 16, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px;
    animation: fadeInDramaOverlay 0.3s ease-out;
}

@keyframes fadeInDramaOverlay {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.drama-overlay-ad-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
}

.drama-overlay-ad-close:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: #ef4444;
    transform: scale(1.04);
}

.drama-overlay-ad-content {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile Sticky Bottom Anchor Banner Ad */
.aniglass-mobile-anchor-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 8, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    animation: slideUpAnchorAd 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpAnchorAd {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.anchor-ad-close-btn {
    position: absolute;
    top: -14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(26, 20, 38, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #e4e4e7;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    z-index: 10001;
    padding: 0;
}

.anchor-ad-close-btn:hover {
    background: #e11d48;
    color: #ffffff;
    border-color: #f43f5e;
    transform: scale(1.1);
}

.anchor-ad-slot-wrap {
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Offset floating bottom nav if anchor ad is present on mobile */
@media (max-width: 768px) {
    body.has-mobile-anchor-ad .liquid-bottom-container {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
        transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

/* Grid Utilities */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (min-width: 480px) {
    .anime-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (min-width: 768px) {
    .anime-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .anime-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 24px;
    }
}

/* Skeleton Loading Screens */
@keyframes skeleton-pulse {
    0% {
        background-color: rgba(255, 255, 255, 0.05);
    }

    50% {
        background-color: rgba(255, 255, 255, 0.12);
    }

    100% {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.skeleton {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    color: transparent !important;
    border-radius: var(--radius-sm);
}

.skeleton img {
    opacity: 0;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 12px;
}

/* Badge Utilities for Cards & Search */
.badge-outline {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
}

.badge-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    min-width: 32px;
}

.badge-solid.green {
    background-color: #20b2aa;
}

.badge-solid.red {
    background-color: #ff3b30;
}

.badge-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(200, 150, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: #ffd700;
    font-size: 11px;
    font-weight: 700;
}

/* Trending Period Switcher Tabs & Top Rated Layout */
.trending-period-tabs {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    padding: 3px;
    gap: 3px;
}

.trending-tab-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted, #9ca3af);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    user-select: none;
}

.trending-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.trending-tab-btn.active {
    background: var(--accent-color, #a855f7);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.4);
}

html.light-mode .trending-period-tabs {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .trending-tab-btn {
    color: #6e6e73;
}

html.light-mode .trending-tab-btn:hover {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.05);
}

html.light-mode .trending-tab-btn.active {
    background: var(--accent-color, #a855f7);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
}

.trending-period-panel {
    transition: opacity 0.25s ease;
}

.top-rated-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-left: 48px !important;
}

.top-rated-card-item {
    position: relative;
    width: 160px;
    flex-shrink: 0;
}

.top-rated-rank {
    position: absolute;
    left: -32px;
    bottom: 12px;
    font-size: 96px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.12);
    line-height: 0.8;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.32);
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

html.light-mode .top-rated-rank {
    color: rgba(0, 0, 0, 0.06);
    -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.22);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Character Cards */
.character-card {
    background: #2a2a2a;
}

.character-name {
    color: #fff;
}

html.light-mode .character-card {
    background: rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: none !important;
}

html.light-mode .character-name {
    color: #1d1d1f !important;
}

/* Search specific */
.search-card {
    display: flex;
    gap: 15px;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(18, 12, 12, 0.8);
    border: 1px solid rgba(255, 100, 100, 0.08);
    border-radius: 16px;
    transition: transform 0.2s ease, background 0.2s ease;
    text-decoration: none;
    position: relative;
}

.search-card:hover {
    background: rgba(25, 15, 15, 0.95);
    transform: translateY(-2px);
    border-color: rgba(255, 100, 100, 0.15);
}

/* Continue Watching */
.continue-watching-title {
    margin: 0;
    font-size: 22px;
    border-left: 3px solid #ff0000;
    padding-left: 10px;
}

.continue-watching-card {
    position: relative;
    width: 260px;
    height: 155px;
    border-radius: 14px;
    overflow: hidden;
    display: block;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border-bottom: 3px solid #ff0000;
    flex-shrink: 0;
    transition: var(--smooth-transition);
    text-decoration: none;
}

.continue-watching-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.55);
}

.cw-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 10px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
}

.cw-anime-title {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.cw-ep-info {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 4px 8px;
    /* 4px top/bottom 8px left/right */
    border-radius: 6px;
    text-align: right;
}

.cw-ep-text {
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    display: block;
}

.cw-ep-date {
    color: #aaa;
    font-size: 10px;
    display: block;
    margin-top: 2px;
}

.cw-remove-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: red;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--smooth-transition);
    padding: 0;
}

.cw-remove-btn:hover {
    background: #cc0000;
    transform: scale(1.1);
}

/* Single Anime Page Hero Header */
.anime-hero-header {
    width: 100%;
    height: 60vh;
    max-height: 600px;
    min-height: 400px;
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    position: relative;
    /* Smooth fade into the body background */
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
}



.hero-bottom-controls {
    position: absolute;
    bottom: 40px;
    left: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Primary Hero Play Button */
.hero-play-primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.45);
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}

.hero-play-primary-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 25px rgba(236, 72, 153, 0.65);
    color: #ffffff !important;
}

.hero-play-primary-btn:active {
    transform: scale(0.96) !important;
}

.hero-trailer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 20px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-trailer-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
}

/* Light Mode Overrides for Hero */
html.light-mode .hero-trailer-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

html.light-mode .hero-trailer-btn:hover {
    background: #ffffff;
}

/* Mobile Hero Header Proportions (App Caliber) */
@media (max-width: 640px) {
    .anime-hero-header {
        height: 34vh !important;
        min-height: 230px !important;
        max-height: 290px !important;
        background-position: center 15% !important;
    }

    .hero-bottom-controls {
        bottom: 16px !important;
        left: 16px !important;
        gap: 8px !important;
    }

    .hero-play-primary-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }

    .hero-trailer-btn {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }
}

/* Live Search Results Styling */
#live-search-input {
    background: rgba(12, 12, 18, 0.85) !important;
    backdrop-filter: blur(30px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(150%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3), 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    color: #ffffff;
}

html.light-mode #live-search-input {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(30px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(150%) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: inset 0 1px 1px #ffffff, 0 4px 10px rgba(0, 0, 0, 0.05) !important;
    color: #1d1d1f !important;
}

/* Sidebar Panel */
#sidebar-panel {
    background: rgba(8, 8, 12, 0.95);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3), 0 4px 20px rgba(0, 0, 0, 0.5);
}

html.light-mode #sidebar-panel {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 1px #ffffff, 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Search Modal Input */
#search-modal input {
    background: rgba(12, 12, 18, 0.85);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
}

html.light-mode #search-modal input {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 1px #ffffff;
    color: #1d1d1f;
}

/* Forms and Inputs */
.glass-input {
    background: rgba(12, 12, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-color);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.glass-input:focus {
    border-color: var(--accent-color);
    background: rgba(18, 16, 26, 0.95);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(168, 85, 247, 0.2);
}

html.light-mode .glass-input {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 1px #ffffff;
    color: #1d1d1f;
}

html.light-mode .glass-input:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 1px #ffffff, 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* Filter Modal Styles */
.filter-modal-content {
    background: rgba(30, 30, 30, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

html.light-mode .filter-modal-content {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

.genre-pill {
    padding: 8px 16px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.genre-pill:hover {
    background: rgba(255, 255, 255, 0.1);
}

.genre-pill.active {
    background: #e50914;
    /* Netflix/Action Red */
    border-color: #e50914;
    color: #fff;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

html.light-mode .genre-pill {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #1d1d1f;
}

html.light-mode .genre-pill:hover {
    background: rgba(0, 0, 0, 0.08);
}

html.light-mode .genre-pill.active {
    background: #e50914;
    border-color: #e50914;
    color: #fff;
}

/* Custom Range Sliders */
.filter-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
    margin-top: 10px;
}

html.light-mode .filter-slider {
    background: rgba(0, 0, 0, 0.1);
}

.filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e50914;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.filter-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.filter-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e50914;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.filter-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* ==========================================================================
   Header Notification Bell & Unread Badge
   ========================================================================== */
.notifications-trigger {
    position: relative;
}

.notifications-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
    animation: notifPulse 2s infinite;
    pointer-events: none;
    box-sizing: border-box;
}

.notifications-badge.dot-only {
    width: 10px;
    min-width: 10px;
    height: 10px;
    top: 2px;
    right: 2px;
    padding: 0;
}

@keyframes notifPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   Notifications Modal & Tabs
   ========================================================================== */
.notif-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notif-tab:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.notif-tab.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.35);
    color: #c084fc;
}

html.light-mode .notif-tab.active {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.3);
    color: #7e22ce;
}

.notif-tab .tab-count {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
}

.notif-tab .tab-count.badge-new {
    background: #ef4444;
    color: #ffffff;
    font-weight: 700;
}

/* Notice Cards */
.notice-item-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.notice-item-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateY(-1px);
}

.notice-item-card.is-unread {
    border-left: 3px solid #c084fc;
    background: rgba(168, 85, 247, 0.06);
}

.notice-badge-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}

.notice-badge-pill.badge-announcement { background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.35); color: #c084fc; }
.notice-badge-pill.badge-release { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.35); color: #4ade80; }
.notice-badge-pill.badge-server { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.35); color: #60a5fa; }
.notice-badge-pill.badge-alert { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.35); color: #f87171; }
.notice-badge-pill.badge-trending { background: rgba(249, 115, 22, 0.15); border: 1px solid rgba(249, 115, 22, 0.35); color: #fb923c; }
.notice-badge-pill.badge-notice { background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.35); color: #22d3ee; }

.notice-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.notice-action-btn:hover {
    background: #a855f7;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.35);
}

/* Floating Glass Toast Notification */
.dramaglass-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 20, 30, 0.92);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.dramaglass-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Top Trending Section Tabs & Panels
   ========================================================================== */
.trending-period-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

html.light-mode .trending-period-tabs {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
}

.trending-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted, #94a3b8);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    outline: none;
}

.trending-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

html.light-mode .trending-tab-btn {
    color: #64748b;
}

html.light-mode .trending-tab-btn:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.04);
}

.trending-tab-btn.active {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.25);
}

html.light-mode .trending-tab-btn.active {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.35);
}

.trending-period-panel {
    animation: trendingFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes trendingFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Global Glassmorphic Pagination System
   ========================================================================== */
.pagination-wrapper {
    margin-top: 45px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-glass .nav-links {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 100px;
    background: rgba(10, 10, 14, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    justify-content: center;
}

html.light-mode .pagination-glass .nav-links {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.pagination-glass .page-numbers {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
    line-height: 1;
}

.pagination-glass .page-numbers:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.pagination-glass .page-numbers.current {
    background: var(--accent-color, #a855f7);
    color: #ffffff !important;
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    cursor: default;
    transform: none;
}

.pagination-glass .page-numbers.prev,
.pagination-glass .page-numbers.next {
    padding: 0 18px;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.pagination-glass .page-numbers.prev:hover,
.pagination-glass .page-numbers.next:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.pagination-glass .page-numbers.dots {
    min-width: 24px;
    padding: 0 4px;
    color: rgba(255, 255, 255, 0.4);
    background: transparent !important;
    border-color: transparent !important;
    transform: none !important;
    box-shadow: none !important;
    cursor: default;
}

/* Light mode styles */
html.light-mode .pagination-glass .page-numbers {
    color: #475569;
}

html.light-mode .pagination-glass .page-numbers:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}

html.light-mode .pagination-glass .page-numbers.current {
    background: var(--accent-color, #a855f7);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
}

html.light-mode .pagination-glass .page-numbers.prev,
html.light-mode .pagination-glass .page-numbers.next {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .pagination-glass .page-numbers.dots {
    color: #94a3b8;
}

@media (max-width: 640px) {
    .pagination-glass .nav-links {
        gap: 4px;
        padding: 6px 8px;
    }
    .pagination-glass .page-numbers {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
        padding: 0 6px;
    }
    .pagination-glass .page-numbers.prev,
    .pagination-glass .page-numbers.next {
        padding: 0 12px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Multi-Season & Franchise Switcher System
   ========================================================================== */
.drama-seasons-block {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
}

.drama-seasons-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.season-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color, #ffffff);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
}

.season-pill-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    color: #ffffff;
}

.season-pill-btn.active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.25);
    cursor: default;
    transform: none;
}

.season-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.season-pill-btn.active .season-pill-dot {
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.season-current-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.25);
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.3;
}

/* Season Mini Badges (Overview specs) */
.season-mini-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color, #ffffff);
}

.season-mini-badge:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #ffffff;
}

.season-mini-badge.active {
    background: var(--accent-color, #a855f7);
    border-color: transparent;
    color: #ffffff !important;
}

/* Quick View Season Pills */
.qv-season-pill {
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qv-season-pill:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    color: #c084fc;
}

.qv-season-pill.active {
    background: var(--accent-color, #a855f7);
    border-color: transparent;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.35);
    cursor: default;
}

/* Light Mode Overrides */
html.light-mode .season-pill-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

html.light-mode .season-pill-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(168, 85, 247, 0.4);
    color: #0f172a;
}

html.light-mode .season-pill-btn.active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #ffffff !important;
}

html.light-mode .season-mini-badge {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
    color: #334155;
}

html.light-mode .season-mini-badge.active {
    background: var(--accent-color, #a855f7);
    color: #ffffff !important;
}

html.light-mode .qv-season-pill {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

html.light-mode .qv-season-pill.active {
    background: var(--accent-color, #a855f7);
    color: #ffffff !important;
}

/* ==========================================================================
   Custom Code Episode Buttons & Download Links
   ========================================================================== */
.drama-custom-episodes-block {
    display: flex;
    flex-direction: column;
}

.drama-custom-episodes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 6px;
}

.drama-custom-episodes-list p {
    margin: 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.drama-custom-episodes-list p:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

.drama-custom-episodes-list a.button,
.drama-custom-episodes-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-color, #ffffff);
}

.drama-custom-episodes-list a.button:hover,
.drama-custom-episodes-list a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(168, 85, 247, 0.15);
    color: #ffffff;
}

/* Terabox specific styling */
.drama-custom-episodes-list a[href*="terabox"],
.drama-custom-episodes-list a.button:first-child {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.25);
    color: #38bdf8;
}

.drama-custom-episodes-list a[href*="terabox"]:hover,
.drama-custom-episodes-list a.button:first-child:hover {
    background: rgba(14, 165, 233, 0.25);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

/* Stream specific styling */
.drama-custom-episodes-list a[href*="stream"],
.drama-custom-episodes-list a.button:nth-child(2) {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    color: #c084fc;
}

.drama-custom-episodes-list a[href*="stream"]:hover,
.drama-custom-episodes-list a.button:nth-child(2):hover {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
}

/* Light mode overrides */
html.light-mode .drama-custom-episodes-list p {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

html.light-mode .drama-custom-episodes-list p:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

html.light-mode .drama-custom-episodes-list a.button,
html.light-mode .drama-custom-episodes-list a {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

html.light-mode .drama-custom-episodes-list a[href*="terabox"],
html.light-mode .drama-custom-episodes-list a.button:first-child {
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.25);
    color: #0284c7;
}

html.light-mode .drama-custom-episodes-list a[href*="terabox"]:hover,
html.light-mode .drama-custom-episodes-list a.button:first-child:hover {
    background: #0284c7;
    color: #ffffff;
}

html.light-mode .drama-custom-episodes-list a[href*="stream"],
html.light-mode .drama-custom-episodes-list a.button:nth-child(2) {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.25);
    color: #7c3aed;
}

html.light-mode .drama-custom-episodes-list a[href*="stream"]:hover,
html.light-mode .drama-custom-episodes-list a.button:nth-child(2):hover {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #ffffff;
}

/* ==========================================================================
   Audio Languages & Dub Versions Switcher
   ========================================================================== */
.drama-languages-block {
    display: flex;
    flex-direction: column;
}

.drama-languages-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.drama-languages-pills::-webkit-scrollbar {
    display: none;
}

.lang-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color, #ffffff);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
}

.lang-pill-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    color: #ffffff;
}

.lang-pill-btn.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.25);
    cursor: default;
    transform: none;
}

.lang-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}

.lang-pill-btn.active .lang-pill-dot {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff;
}

.lang-current-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.25);
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.3;
}

/* Audio Languages Mini Badges (Overview specs) */
.lang-mini-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color, #ffffff);
}

.lang-mini-badge:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #ffffff;
}

.lang-mini-badge.active {
    background: #10b981;
    border-color: transparent;
    color: #ffffff !important;
}

/* Quick View Language Pills */
.qv-lang-pill {
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qv-lang-pill:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.qv-lang-pill.active {
    background: #10b981;
    border-color: transparent;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
    cursor: default;
}

/* Light Mode Overrides */
html.light-mode .lang-pill-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

html.light-mode .lang-pill-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(16, 185, 129, 0.4);
    color: #0f172a;
}

html.light-mode .lang-pill-btn.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff !important;
}

html.light-mode .lang-mini-badge {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
    color: #334155;
}

html.light-mode .lang-mini-badge.active {
    background: #10b981;
    color: #ffffff !important;
}

html.light-mode .qv-lang-pill {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

html.light-mode .qv-lang-pill.active {
    background: #10b981;
    color: #ffffff !important;
}

/* ==========================================================================
   Desktop Top Navigation Bar
   ========================================================================== */
.header-desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

@media (max-width: 880px) {
    .header-desktop-nav {
        display: none !important;
    }
}

.header-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-nav-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.header-nav-pill.active {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: #ffffff !important;
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 3px 14px rgba(168, 85, 247, 0.4);
}

.nav-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
    animation: navDotPulse 2s infinite ease-in-out;
}

@keyframes navDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.75); }
}

html.light-mode .header-nav-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

html.light-mode .header-nav-pill:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

html.light-mode .header-nav-pill.active {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: #ffffff !important;
}

/* ==========================================================================
   Upcoming Schedule Dashboard & Cards
   ========================================================================== */
.upcoming-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.upcoming-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
    animation: navDotPulse 1.8s infinite ease-in-out;
}

.upcoming-pulse-dot-red {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f43f5e;
    box-shadow: 0 0 8px #f43f5e;
    animation: navDotPulse 1.4s infinite ease-in-out;
    display: inline-block;
}

.upcoming-clock-pill {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 100px;
}

.upcoming-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 15px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upcoming-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.upcoming-tab-btn.active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.upcoming-day-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.upcoming-day-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.upcoming-day-btn.active {
    background: #38bdf8;
    color: #0f172a !important;
    border-color: #38bdf8;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.upcoming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.upcoming-card {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--glass-bg, rgba(20, 20, 25, 0.7));
}

.upcoming-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.upcoming-card.type-ongoing {
    border-left: 3.5px solid #38bdf8;
}

.upcoming-card.type-upcoming {
    border-left: 3.5px solid #a855f7;
}

.upcoming-poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.upcoming-poster-wrap > a {
    display: block;
    width: 100%;
    height: 100%;
}

.upcoming-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.upcoming-card:hover .upcoming-poster-img {
    transform: scale(1.05);
}

.upcoming-poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    font-size: 40px;
}

.upcoming-top-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

.upcoming-tag-ongoing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.upcoming-tag-premiere {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.upcoming-score-badge {
    background: rgba(0, 0, 0, 0.75);
    color: #ffd700;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(6px);
}

.upcoming-bottom-progress {
    position: absolute;
    bottom: 10px;
    left: 12px;
    z-index: 2;
}

.upcoming-progress-pill {
    background: rgba(0, 0, 0, 0.75);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.upcoming-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.upcoming-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.upcoming-country-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 7px;
    border-radius: 4px;
}

.upcoming-network-badge {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 7px;
    border-radius: 4px;
}

.upcoming-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 4px 0;
    line-height: 1.35;
}

.upcoming-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.upcoming-title a:hover {
    color: var(--accent-color);
}

.upcoming-native-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upcoming-airing-info {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 15px;
    font-size: 12.5px;
}

.upcoming-date-line {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
    margin-bottom: 4px;
}

.upcoming-time-badge {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
}

.upcoming-cadence-line {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 11.5px;
}

/* Countdown Digit Boxes */
.upcoming-countdown-container {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.countdown-digit-boxes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.countdown-digit-boxes .cbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 5px 8px;
    min-width: 44px;
}

.countdown-digit-boxes .c-val {
    font-size: 17px;
    font-weight: 800;
    font-family: monospace, sans-serif;
    color: #38bdf8;
    line-height: 1;
}

.countdown-digit-boxes .c-lbl {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.countdown-digit-boxes .c-sep {
    font-weight: 800;
    color: var(--text-muted);
    font-size: 14px;
}

.countdown-airing-status {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #10b981;
    padding: 6px 0;
}

.upcoming-pending {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 8px;
}

.upcoming-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.upcoming-watch-btn {
    flex: 1;
    text-align: center;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
}

.upcoming-qv-btn,
.upcoming-mylist-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

/* ==========================================================================
   Single Drama Page Schedule Banner
   ========================================================================== */
.drama-schedule-banner {
    background: rgba(15, 23, 42, 0.8);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 25px rgba(56, 189, 248, 0.12);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 22px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dsb-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.dsb-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 3px 8px;
    border-radius: 100px;
}

.dsb-ep-title {
    font-size: 15px;
    color: #ffffff;
    font-weight: 800;
}

.dsb-network-tag {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 2px 7px;
    border-radius: 6px;
}

.dsb-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 6px;
}

.dsb-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dsb-cadence {
    font-size: 12px;
    color: #94a3b8;
}

.dsb-countdown {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 0;
}

.schedule-specs-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
}

/* Light Mode Overrides for Upcoming */
html.light-mode .upcoming-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .upcoming-airing-info {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

html.light-mode .upcoming-countdown-container {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .countdown-digit-boxes .cbox {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

html.light-mode .drama-schedule-banner {
    background: rgba(240, 249, 255, 0.95);
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.1);
}

html.light-mode .dsb-ep-title {
    color: #0f172a;
}

html.light-mode .dsb-info-row {
    color: #334155;
}

html.light-mode .dsb-countdown {
    background: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   Scheduled Episodes & Real-Time Auto Unlock Styling
   ========================================================================== */
.episode-card {
    height: 82px;
    min-height: 82px;
    gap: 15px;
}

.episode-card .ep-thumb-wrapper {
    width: 140px;
    min-width: 140px;
}

.episode-card .ep-badge-pill {
    bottom: 6px;
    left: 6px;
    padding: 2.5px 8px;
    font-size: 11px;
}

.episode-card .ep-card-details {
    padding-right: 15px;
}

.episode-card .ep-card-title {
    font-size: 15px;
}

.episode-card .ep-server-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 6px;
}

.episode-card .ep-card-subtitle {
    font-size: 12px;
}

.episode-card.is-scheduled-locked {
    position: relative;
    user-select: none;
}

.episode-card.is-scheduled-locked:hover {
    cursor: pointer;
}

.episode-card.is-scheduled-locked .ep-thumb-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(245, 158, 11, 0.15) 0%, rgba(15, 23, 42, 0.5) 100%);
    pointer-events: none;
}

.ep-lock-circle {
    z-index: 2;
    transition: transform 0.25s ease;
}

.episode-card.is-scheduled-locked:hover .ep-lock-circle {
    transform: scale(1.08);
}

.ep-locked-countdown {
    display: inline-block;
    letter-spacing: 0.3px;
    animation: lockPulse 2s infinite ease-in-out;
}

@keyframes lockPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Keyframe for instant unlock celebration */
@keyframes unlockCelebration {
    0% {
        transform: scale(0.98);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px 10px rgba(16, 185, 129, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
}

.episode-card.episode-unlocked-live {
    animation: unlockCelebration 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Light mode overrides for scheduled episode cards */
html.light-mode .episode-card.is-scheduled-locked {
    background: rgba(254, 243, 199, 0.5) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

html.light-mode .episode-card.is-scheduled-locked:hover {
    background: rgba(254, 243, 199, 0.8) !important;
    border-color: #f59e0b !important;
}

html.light-mode .episode-card.is-scheduled-locked .ep-card-title {
    color: #78350f !important;
}

/* Ep Aired • Uploading Soon State (When time ended but link is pending) */
.episode-card.is-ep-aired-uploading {
    position: relative;
    user-select: none;
    border-left: 3.5px solid #38bdf8 !important;
}

.episode-card.is-ep-aired-uploading .ep-uploading-circle svg {
    animation: uploadIconBounce 1.8s infinite ease-in-out;
}

@keyframes uploadIconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

html.light-mode .episode-card.is-ep-aired-uploading {
    background: rgba(224, 242, 254, 0.6) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
}

html.light-mode .episode-card.is-ep-aired-uploading .ep-card-title {
    color: #0369a1 !important;
}

/* ==========================================================================
   TRENDING PAGE STYLES (DRAMAS & ACTORS LEADERBOARDS)
   ========================================================================== */

/* Hero Header & Radar Pills */
.trending-hero-header {
    position: relative;
}

.trending-radar-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 5px 12px;
    border-radius: 100px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.trending-radar-time {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.3);
    color: #c084fc;
}

.trending-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
    animation: trendingRadarPulse 1.6s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes trendingRadarPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.4; }
}

/* View Switcher Pills (Dramas vs Actors) */
.trending-view-toggle {
    background: rgba(20, 15, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.trending-view-btn {
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.trending-view-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.06);
}

.trending-view-btn.active {
    background: var(--accent-color, #a855f7);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

/* Filter Bar Container & Rows */
.trending-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 18px;
    margin-top: 25px;
}

.trending-period-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.trending-country-filters {
    display: flex;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
}

.trending-region-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-right: 4px;
    white-space: nowrap;
}

/* Period Tabs */
.trending-filter-tab {
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.trending-filter-tab:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
}

.trending-filter-tab.active {
    background: #ffffff;
    color: #0f172a !important;
    border-color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
}

/* Country Quick Buttons */
.trending-country-btn {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.trending-country-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.08);
}

.trending-country-btn.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.4);
    font-weight: 700;
}

/* ==========================================================================
   DRAMAS PODIUM (TOP 3 SPOTLIGHT)
   ========================================================================== */
.trending-podium-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.trending-podium-card {
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
    background: var(--glass-bg, rgba(12, 12, 16, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.trending-podium-card:hover {
    transform: translateY(-6px);
}

/* Gold / Silver / Bronze Themes */
.trending-podium-card.podium-gold {
    border: 1.5px solid rgba(234, 179, 8, 0.45);
    box-shadow: 0 10px 35px rgba(234, 179, 8, 0.15);
}

.trending-podium-card.podium-gold:hover {
    box-shadow: 0 16px 45px rgba(234, 179, 8, 0.28);
}

.trending-podium-card.podium-silver {
    border: 1.5px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 10px 30px rgba(148, 163, 184, 0.12);
}

.trending-podium-card.podium-bronze {
    border: 1.5px solid rgba(249, 115, 22, 0.4);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.12);
}

.podium-poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #000;
}

.podium-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.trending-podium-card:hover .podium-poster-img {
    transform: scale(1.05);
}

.podium-poster-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 12, 22, 0.95) 0%, rgba(15, 12, 22, 0.3) 60%, transparent 100%);
    pointer-events: none;
}

.podium-top-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.podium-crown-tag {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 100px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.5px;
}

.podium-gold .podium-crown-tag {
    background: rgba(234, 179, 8, 0.9);
    color: #1a1200;
    box-shadow: 0 2px 10px rgba(234, 179, 8, 0.5);
}

.podium-silver .podium-crown-tag {
    background: rgba(148, 163, 184, 0.9);
    color: #0f172a;
}

.podium-bronze .podium-crown-tag {
    background: rgba(249, 115, 22, 0.9);
    color: #ffffff;
}

.podium-views-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #38bdf8;
}

.podium-big-rank-digit {
    position: absolute;
    bottom: -10px;
    right: 12px;
    font-size: 84px;
    font-weight: 900;
    line-height: 1;
    color: rgba(255, 255, 255, 0.08);
    pointer-events: none;
    user-select: none;
    font-family: inherit;
    z-index: 1;
}

.podium-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 2;
}

.podium-country-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.podium-score-tag {
    font-size: 11px;
    font-weight: 800;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 2px 7px;
    border-radius: 6px;
}

.podium-eps-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 7px;
    border-radius: 6px;
}

.podium-title {
    font-size: 19px;
    font-weight: 800;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.podium-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.podium-title a:hover {
    color: var(--accent-color);
}

.podium-native-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-cast-snippet {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.podium-actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.podium-watch-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
}

/* ==========================================================================
   RANKED LEADERBOARD LIST / GRID (#4 - #30)
   ========================================================================== */
.trending-ranked-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.trending-rank-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 18px;
    background: var(--glass-bg, rgba(12, 12, 16, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.trending-rank-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.16);
}

.rank-number-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    flex-shrink: 0;
}

.rank-number-digit {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-muted);
    letter-spacing: -0.5px;
}

.rank-poster-link {
    width: 58px;
    height: 82px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
    background: #000;
}

.rank-poster-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.trending-rank-card:hover .rank-poster-thumb {
    transform: scale(1.08);
}

.rank-details {
    flex: 1;
    min-width: 0;
}

.rank-badge-country {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 4px;
}

.rank-badge-score {
    font-size: 10px;
    font-weight: 700;
    color: #ffd700;
}

.rank-badge-eps {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.rank-title {
    font-size: 15px;
    font-weight: 700;
    margin: 2px 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.rank-title a:hover {
    color: var(--accent-color);
}

.rank-metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.rank-views-text {
    color: #38bdf8;
    font-weight: 600;
}

.rank-action-col {
    flex-shrink: 0;
}

.rank-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ==========================================================================
   ACTORS PODIUM (TOP 3 STARS RANKED BY DRAMA VIEWS)
   ========================================================================== */
.trending-actor-podium-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.trending-actor-podium-card {
    border-radius: 24px;
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    background: var(--glass-bg, rgba(12, 12, 16, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.trending-actor-podium-card:hover {
    transform: translateY(-6px);
}

.trending-actor-podium-card.actor-gold {
    border: 1.5px solid rgba(234, 179, 8, 0.45);
    box-shadow: 0 10px 35px rgba(234, 179, 8, 0.15);
}

.trending-actor-podium-card.actor-silver {
    border: 1.5px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 10px 30px rgba(148, 163, 184, 0.12);
}

.trending-actor-podium-card.actor-bronze {
    border: 1.5px solid rgba(249, 115, 22, 0.4);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.12);
}

.actor-podium-rank-tag {
    margin-bottom: 16px;
}

.actor-podium-rank-tag span {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 0.5px;
}

.actor-gold .actor-podium-rank-tag span {
    background: rgba(234, 179, 8, 0.9);
    color: #1a1200;
    box-shadow: 0 2px 10px rgba(234, 179, 8, 0.4);
}

.actor-silver .actor-podium-rank-tag span {
    background: rgba(148, 163, 184, 0.9);
    color: #0f172a;
}

.actor-bronze .actor-podium-rank-tag span {
    background: rgba(249, 115, 22, 0.9);
    color: #ffffff;
}

.actor-avatar-ring-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    margin-bottom: 16px;
}

.actor-avatar-link {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.actor-podium-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    transition: transform 0.3s ease;
}

.trending-actor-podium-card:hover .actor-podium-avatar-img {
    transform: scale(1.08);
}

.actor-gold .actor-avatar-ring-wrap {
    border: 3.5px solid #eab308;
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 0 25px rgba(234, 179, 8, 0.35);
}

.actor-silver .actor-avatar-ring-wrap {
    border: 3.5px solid #94a3b8;
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 0 20px rgba(148, 163, 184, 0.25);
}

.actor-bronze .actor-avatar-ring-wrap {
    border: 3.5px solid #f97316;
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.25);
}

.actor-crown-icon {
    position: absolute;
    bottom: -4px;
    right: 4px;
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.actor-podium-name {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px 0;
}

.actor-podium-name a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.actor-podium-name a:hover {
    color: var(--accent-color);
}

.actor-podium-country {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.actor-views-metric-pill {
    font-size: 12px;
    font-weight: 700;
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 4px 14px;
    border-radius: 100px;
    margin-bottom: 18px;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.actor-top-drama-box {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 18px;
    text-align: left;
}

.actor-trending-in-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-color);
    margin-bottom: 6px;
}

.actor-top-drama-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
}

.actor-top-drama-thumb {
    width: 38px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.actor-drama-title-text {
    font-size: 13px;
    font-weight: 700;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actor-character-text {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actor-profile-btn {
    width: 100%;
    margin-top: auto;
    padding: 10px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

/* ==========================================================================
   ACTORS RANKED GRID (#4 - #30)
   ========================================================================== */
.trending-actors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.trending-actor-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 18px;
    background: var(--glass-bg, rgba(12, 12, 16, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.trending-actor-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.16);
}

.actor-rank-badge {
    font-size: 16px;
    font-weight: 900;
    color: var(--text-muted);
    width: 32px;
    flex-shrink: 0;
}

.actor-avatar-small-wrap {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: block;
}

.actor-avatar-small-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.actor-info-col {
    flex: 1;
    min-width: 0;
}

.actor-name-row {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actor-name-row a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.actor-name-row a:hover {
    color: var(--accent-color);
}

.actor-hit-drama-row {
    font-size: 12px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actor-hit-drama-name {
    color: #38bdf8;
    font-weight: 600;
    text-decoration: none;
}

.actor-hit-drama-name:hover {
    text-decoration: underline;
}

.actor-char-tag {
    color: var(--text-muted);
    font-size: 11px;
}

.actor-meta-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.actor-stat-pill {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--text-muted);
}

.actor-arrow-col {
    flex-shrink: 0;
}

.actor-view-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
}

/* ==========================================================================
   LIGHT MODE OVERRIDES
   ========================================================================== */
html.light-mode .trending-view-toggle {
    background: rgba(240, 240, 245, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .trending-view-btn.active {
    background: #0f172a;
    color: #ffffff;
}

html.light-mode .trending-filter-tab.active {
    background: #0f172a;
    color: #ffffff !important;
}

html.light-mode .trending-podium-card,
html.light-mode .trending-rank-card,
html.light-mode .trending-actor-podium-card,
html.light-mode .trending-actor-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

html.light-mode .actor-top-drama-box {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   TRENDING LEADERBOARD RESPONSIVE & MOBILE COMPACT ENGINE
   ========================================================================== */

/* Base swipe hint hidden on desktop */
.podium-swipe-hint {
    display: none;
}

@media (min-width: 769px) and (max-width: 991px) {
    .trending-podium-grid,
    .trending-actor-podium-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .trending-ranked-grid,
    .trending-actors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ─── Compact Mobile Layout (<= 768px) ─── */
@media (max-width: 768px) {
    /* 1. Page Container & Hero Spacing */
    .trending-page-container {
        padding-top: 12px !important;
        padding-bottom: 85px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .trending-hero-header {
        margin-bottom: 16px !important;
    }

    .trending-hero-top-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .trending-radar-row {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin-bottom: 6px !important;
        flex-wrap: wrap !important;
    }

    .trending-radar-pill {
        font-size: 9.5px !important;
        padding: 3px 8px !important;
        letter-spacing: 0.3px !important;
    }

    .trending-page-title {
        font-size: 22px !important;
        font-weight: 800 !important;
        letter-spacing: -0.4px !important;
        margin: 0 0 4px 0 !important;
        line-height: 1.2 !important;
    }

    .trending-hero-desc {
        display: none !important; /* Hide long paragraph to instantly bring content into mobile view */
    }

    /* 2. Full-Width App-Style Segmented View Switcher */
    .trending-view-toggle {
        width: 100% !important;
        display: flex !important;
        gap: 4px !important;
        padding: 4px !important;
        border-radius: 12px !important;
        margin-top: 4px !important;
        box-sizing: border-box !important;
    }

    .trending-view-btn {
        flex: 1 !important;
        justify-content: center !important;
        padding: 7px 10px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
        gap: 6px !important;
    }

    /* 3. Streamlined Horizontal Filter Bars */
    .trending-filter-bar {
        margin-top: 10px !important;
        padding: 8px 10px !important;
        border-radius: 14px !important;
        gap: 8px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .trending-period-tabs {
        display: flex !important;
        gap: 5px !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 2px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .trending-period-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .trending-filter-tab {
        padding: 5px 12px !important;
        font-size: 11.5px !important;
        flex-shrink: 0 !important;
        border-radius: 100px !important;
    }

    .trending-country-filters {
        display: flex !important;
        gap: 5px !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 2px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .trending-country-filters::-webkit-scrollbar {
        display: none !important;
    }

    .trending-country-filters span:first-child {
        font-size: 10px !important;
        margin-right: 2px !important;
    }

    .trending-country-btn {
        padding: 4px 10px !important;
        font-size: 11px !important;
        flex-shrink: 0 !important;
        border-radius: 100px !important;
    }

    /* 4. Section Headers & Swipe Hint */
    .trending-podium-section,
    .trending-actors-podium-section {
        margin-bottom: 20px !important;
    }

    .trending-section-title-wrap {
        margin-bottom: 10px !important;
    }

    .trending-section-title-wrap h2 {
        font-size: 16px !important;
        gap: 6px !important;
    }

    .podium-rank-period-tag {
        font-size: 10.5px !important;
        padding: 2px 7px !important;
    }

    .podium-swipe-hint {
        display: inline-flex !important;
        align-items: center !important;
        gap: 3px !important;
        font-size: 10.5px !important;
        font-weight: 600 !important;
        color: var(--accent-color, #a855f7) !important;
        background: rgba(168, 85, 247, 0.12) !important;
        border: 1px solid rgba(168, 85, 247, 0.25) !important;
        padding: 2px 8px !important;
        border-radius: 100px !important;
        margin-left: auto !important;
    }

    /* 5. Top 3 Spotlight: Horizontal Swipeable Snap Carousel */
    .trending-podium-grid {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 12px !important;
        margin: 0 -12px 14px !important;
        padding: 4px 12px 10px !important;
        scrollbar-width: none !important;
    }

    .trending-podium-grid::-webkit-scrollbar {
        display: none !important;
    }

    .trending-podium-card {
        flex: 0 0 78vw !important;
        max-width: 290px !important;
        scroll-snap-align: start !important;
        border-radius: 18px !important;
        margin: 0 !important;
        border-width: 1px !important;
    }

    .podium-poster-wrap {
        aspect-ratio: 16 / 9 !important;
    }

    .podium-top-badge {
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
    }

    .podium-crown-tag {
        font-size: 9.5px !important;
        padding: 3px 8px !important;
    }

    .podium-views-tag {
        font-size: 9.5px !important;
        padding: 3px 8px !important;
    }

    .podium-big-rank-digit {
        font-size: 48px !important;
        bottom: -6px !important;
        right: 8px !important;
    }

    .podium-card-body {
        padding: 12px 14px !important;
    }

    .podium-card-body > div:first-child {
        gap: 5px !important;
        margin-bottom: 6px !important;
    }

    .podium-country-tag,
    .podium-score-tag,
    .podium-eps-tag {
        font-size: 9.5px !important;
        padding: 1px 6px !important;
    }

    .podium-title {
        font-size: 14.5px !important;
        margin: 0 0 2px 0 !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .podium-native-title {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }

    .podium-cast-snippet {
        font-size: 11px !important;
        margin-bottom: 10px !important;
        -webkit-line-clamp: 1 !important;
    }

    .podium-actions {
        gap: 6px !important;
    }

    .podium-actions .btn {
        padding: 7px 12px !important;
        font-size: 11.5px !important;
    }

    .podium-watch-btn svg {
        width: 13px !important;
        height: 13px !important;
    }

    /* 6. Top 3 Actors Podium Carousel */
    .trending-actor-podium-grid {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 12px !important;
        margin: 0 -12px 14px !important;
        padding: 4px 12px 10px !important;
        scrollbar-width: none !important;
    }

    .trending-actor-podium-grid::-webkit-scrollbar {
        display: none !important;
    }

    .trending-actor-podium-card {
        flex: 0 0 74vw !important;
        max-width: 270px !important;
        scroll-snap-align: start !important;
        border-radius: 18px !important;
        padding: 14px 12px !important;
        margin: 0 !important;
    }

    .actor-podium-rank-tag {
        margin-bottom: 8px !important;
    }

    .actor-podium-rank-tag span {
        font-size: 9.5px !important;
        padding: 2px 9px !important;
    }

    .actor-avatar-ring-wrap {
        width: 72px !important;
        height: 72px !important;
        margin-bottom: 8px !important;
    }

    .actor-crown-icon {
        font-size: 16px !important;
        bottom: -2px !important;
        right: 2px !important;
    }

    .actor-podium-name {
        font-size: 15px !important;
        margin-bottom: 2px !important;
    }

    .actor-podium-country {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }

    .actor-views-metric-pill {
        font-size: 10px !important;
        padding: 3px 10px !important;
        margin-bottom: 10px !important;
        gap: 4px !important;
    }

    .actor-top-drama-box {
        padding: 8px 10px !important;
        margin-bottom: 10px !important;
        border-radius: 10px !important;
    }

    .actor-trending-in-label {
        font-size: 9px !important;
        margin-bottom: 4px !important;
    }

    .actor-top-drama-thumb {
        width: 28px !important;
        height: 38px !important;
        border-radius: 4px !important;
    }

    .actor-drama-title-text {
        font-size: 11.5px !important;
    }

    .actor-character-text {
        font-size: 10px !important;
    }

    .actor-profile-btn {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }

    /* 7. Compact High-Density Ranked List (#4 - #30) */
    .trending-ranked-section h2,
    .trending-actors-list-section h2 {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    .trending-ranked-grid,
    .trending-actors-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .trending-rank-card {
        padding: 7px 10px !important;
        border-radius: 14px !important;
        gap: 10px !important;
    }

    .rank-number-box {
        width: 26px !important;
    }

    .rank-number-digit {
        font-size: 15px !important;
        font-weight: 800 !important;
    }

    .rank-poster-link {
        width: 44px !important;
        height: 62px !important;
        border-radius: 8px !important;
    }

    .rank-details > div:first-child {
        gap: 5px !important;
        margin-bottom: 2px !important;
    }

    .rank-badge-country {
        font-size: 8.5px !important;
        padding: 1px 4px !important;
    }

    .rank-badge-score,
    .rank-badge-eps {
        font-size: 9.5px !important;
    }

    .rank-title {
        font-size: 13.5px !important;
        margin: 0 0 2px 0 !important;
        line-height: 1.25 !important;
    }

    .rank-metrics {
        font-size: 11px !important;
        gap: 6px !important;
    }

    .rank-play-btn {
        width: 32px !important;
        height: 32px !important;
    }

    .rank-play-btn svg {
        width: 12px !important;
        height: 12px !important;
    }

    /* Ranked Actors Card */
    .trending-actor-card {
        padding: 8px 10px !important;
        border-radius: 14px !important;
        gap: 10px !important;
    }

    .actor-rank-badge {
        width: 24px !important;
        font-size: 13px !important;
    }

    .actor-avatar-small-wrap {
        width: 42px !important;
        height: 42px !important;
    }

    .actor-name-row {
        font-size: 13.5px !important;
        margin-bottom: 2px !important;
    }

    .actor-hit-drama-row {
        font-size: 11px !important;
        margin-bottom: 4px !important;
    }

    .actor-meta-stats {
        gap: 4px !important;
    }

    .actor-stat-pill {
        font-size: 9px !important;
        padding: 1px 5px !important;
    }

    .actor-view-icon-btn {
        width: 30px !important;
        height: 30px !important;
    }

    .actor-view-icon-btn svg {
        width: 13px !important;
        height: 13px !important;
    }
}

/* ─── Extra Narrow Mobile (<= 380px) ─── */
@media (max-width: 380px) {
    .trending-podium-card {
        flex: 0 0 84vw !important;
    }

    .trending-actor-podium-card {
        flex: 0 0 82vw !important;
    }

    .rank-poster-link {
        width: 40px !important;
        height: 56px !important;
    }

    .rank-number-box {
        width: 22px !important;
    }

    .rank-number-digit {
        font-size: 13px !important;
    }

    .rank-title {
        font-size: 12.5px !important;
    }

    .actor-avatar-small-wrap {
        width: 38px !important;
        height: 38px !important;
    }
}

/* ==========================================================================
   LEGAL & COMPLIANCE PAGES (DMCA, DISCLAIMER, PRIVACY, TERMS, CONTACT, ABOUT)
   ========================================================================== */

.legal-card {
    background: var(--glass-bg, rgba(22, 17, 32, 0.85));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
}

.legal-body-content h2 {
    color: var(--text-color);
    letter-spacing: -0.3px;
}

.legal-body-content p {
    margin-bottom: 16px;
    color: var(--text-color);
}

.legal-body-content a {
    color: var(--accent-color, #a855f7);
    text-decoration: underline;
    transition: color 0.2s;
}

.legal-body-content a:hover {
    color: #ffffff;
}

.legal-body-content ol,
.legal-body-content ul {
    color: var(--text-color);
}

.legal-body-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #38bdf8;
    font-family: monospace;
}

/* Legal Inputs */
.legal-input:focus {
    border-color: var(--accent-color, #a855f7) !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25) !important;
    background: rgba(255, 255, 255, 0.09) !important;
}

/* Legal Select & Dropdown Options Fix */
select.legal-input,
select.legal-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #0a0a0e !important;
    color: #ffffff !important;
    cursor: pointer;
}

select.legal-input option,
select.legal-select option {
    background-color: #0a0a0e !important;
    color: #ffffff !important;
    padding: 10px 14px;
}

select.legal-input option:checked,
select.legal-select option:checked {
    background-color: #a855f7 !important;
    color: #ffffff !important;
}


/* Enhanced Footer Grid */
.glass-footer {
    position: relative;
    z-index: 10;
}

.footer-links-list li {
    margin-bottom: 4px;
}

.footer-links-list a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links-list a:hover {
    color: var(--text-color);
    transform: translateX(4px);
}

.footer-safe-harbor-badge {
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
}

/* Light mode overrides for legal pages & footer */
html.light-mode .legal-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

html.light-mode .legal-alert-box.alert-warning {
    background: rgba(254, 243, 199, 0.8) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
}

html.light-mode .legal-alert-box.alert-warning p {
    color: #78350f !important;
}

html.light-mode .legal-form-container {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .legal-input {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #1e293b !important;
}

html.light-mode select.legal-input,
html.light-mode select.legal-select {
    background: #ffffff !important;
    color: #1e293b !important;
}

html.light-mode select.legal-input option,
html.light-mode select.legal-select option {
    background: #ffffff !important;
    color: #1e293b !important;
}

html.light-mode select.legal-input option:checked,
html.light-mode select.legal-select option:checked {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}


html.light-mode .glass-footer {
    background: rgba(245, 245, 247, 0.95) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .footer-col-disclaimer .glass-panel {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .footer-links-list a {
    color: #64748b;
}

html.light-mode .footer-links-list a:hover {
    color: #0f172a;
}

/* Footer Responsive Breakpoints */
@media (max-width: 991px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 30px !important;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .legal-card {
        padding: 24px 18px !important;
    }
}

/* ==========================================================================
   Drama Card Image Sizing & Responsive Grid System
   ========================================================================== */

/* Prevent horizontal overflow on entire mobile viewport */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Hide any empty ad slots automatically */
.aniglass-ad-slot:empty,
.aniglass-ad-slot > :empty {
    display: none !important;
}

/* 1. Responsive Grid System:
      - Mobile (< 680px): Strictly 2 columns (never overflows or cuts off)
      - Tablet Portrait (680px - 991px): 3 columns
      - Tablet Landscape / Small Laptop (992px - 1239px): 4 columns
      - Standard Desktop (1240px - 1499px): 5 columns
      - Wide Desktop (1500px+): 6 columns
*/
.drama-grid,
.anime-grid,
#library-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

@media (min-width: 680px) {
    .drama-grid,
    .anime-grid,
    #library-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
    }
}

@media (min-width: 992px) {
    .drama-grid,
    .anime-grid,
    #library-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
    }
}

@media (min-width: 1240px) {
    .drama-grid,
    .anime-grid,
    #library-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 22px !important;
    }
}

@media (min-width: 1500px) {
    .drama-grid,
    .anime-grid,
    #library-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 24px !important;
    }
}

/* 2. Card Container Proportions */
.drama-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    position: relative !important;
    min-width: 0 !important; /* CRITICAL: Prevents grid column blowout */
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 20px;
}

/* 3. Poster Anchor / Frame - strictly locked to 2:3 ratio */
.drama-card .anime-card-link {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 2 / 3 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.2), box-shadow 0.35s ease;
}

.drama-card:hover .anime-card-link {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55), 0 0 20px rgba(168, 85, 247, 0.25);
}

/* 4. Poster Image - strictly locked to 2:3 ratio, object-fit: cover */
.drama-card .anime-card-link img,
.drama-card img.skeleton,
.drama-card img {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    aspect-ratio: 2 / 3 !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 16px !important;
    transition: opacity 0.3s ease;
}

/* 5. Card Metadata & Typography */
.drama-card .anime-card-info {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0 !important;
}

.drama-card .anime-card-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    min-height: 38px;
    word-break: break-word;
}

/* 6. Mobile Layout Polish: Eliminate excessive vertical voids and fix bottom nav overlap */
#browse-all-section {
    scroll-margin-top: 80px;
}

@media (max-width: 768px) {
    #browse-all-section {
        margin-bottom: 25px !important;
        scroll-margin-top: 70px !important;
    }

    .site-main {
        padding-bottom: 30px !important;
    }

    .site-footer {
        margin-top: 25px !important;
        padding-top: 35px !important;
        padding-bottom: 130px !important; /* CRITICAL: Prevents floating bottom nav from covering footer copyright & legal links */
    }

    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
        margin-bottom: 28px !important;
    }
}

/* 7. Liquid Mobile Navigation: Proportional sizing on narrow mobile screens */
@media (max-width: 430px) {
    .liquid-bottom-container {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
        gap: 6px;
        left: 50% !important;
        transform: translateX(-50%) translateZ(0) !important;
        -webkit-transform: translateX(-50%) translateZ(0) !important;
        width: auto !important;
        max-width: calc(100vw - 16px) !important;
    }

    .liquid-nav-main {
        padding: 3px 4px;
    }

    .liquid-nav-item {
        width: 54px;
        height: 48px;
        font-size: 9.5px;
    }

    .liquid-nav-item svg {
        width: 18px;
        height: 18px;
        margin-bottom: 2px !important;
    }

    .liquid-nav-circle {
        width: 50px;
        height: 50px;
    }

    .liquid-nav-circle svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 360px) {
    .liquid-bottom-container {
        bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        gap: 4px;
    }

    .liquid-nav-item {
        width: 46px;
        height: 44px;
        font-size: 8.5px;
    }

    .liquid-nav-item svg {
        width: 16px;
        height: 16px;
    }

    .liquid-nav-circle {
        width: 44px;
        height: 44px;
    }
}

/* ==========================================================================
   8. MOBILE COMPACT SIZE: UPCOMING SCHEDULE & DRAMA EPISODE SCHEDULE
   ========================================================================== */

@media (max-width: 640px) {
    /* --- 1. Upcoming Page: Hero Header & Live Radar --- */
    .upcoming-page-container {
        padding-top: 15px !important;
        padding-bottom: 80px !important;
    }

    .upcoming-hero-header {
        margin-bottom: 16px !important;
    }

    .upcoming-hero-header .page-title {
        font-size: 22px !important;
        margin-bottom: 6px !important;
        letter-spacing: -0.5px !important;
        line-height: 1.25 !important;
    }

    .upcoming-hero-header p {
        font-size: 12.5px !important;
        line-height: 1.45 !important;
        max-width: 100% !important;
    }

    .upcoming-badge-pill,
    .upcoming-clock-pill {
        font-size: 10px !important;
        padding: 2.5px 8px !important;
        letter-spacing: 0.4px !important;
    }

    /* --- 2. Upcoming Filter Bar: Touch Horizontal Swipe --- */
    .upcoming-filter-bar {
        margin-top: 14px !important;
        padding: 6px 10px !important;
        border-radius: 12px !important;
        gap: 8px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .upcoming-type-tabs {
        display: flex !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        flex-wrap: nowrap !important;
        padding-bottom: 2px !important;
    }

    .upcoming-type-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .upcoming-tab-btn {
        padding: 5px 10px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .upcoming-day-filters {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        padding-bottom: 2px !important;
    }

    .upcoming-day-filters::-webkit-scrollbar {
        display: none !important;
    }

    .upcoming-day-btn {
        padding: 3px 8px !important;
        font-size: 10px !important;
        min-width: 30px !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
    }

    /* --- 3. Upcoming Dramas Grid: Compact Horizontal Cards --- */
    .upcoming-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .upcoming-card {
        flex-direction: row !important;
        align-items: stretch !important;
        border-radius: 12px !important;
        min-height: 125px !important;
        max-height: none !important;
        overflow: hidden !important;
        border-width: 1px !important;
    }

    .upcoming-poster-wrap {
        width: 96px !important;
        min-width: 96px !important;
        max-width: 96px !important;
        height: auto !important;
        aspect-ratio: auto !important;
        align-self: stretch !important;
        position: relative !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
    }

    .upcoming-poster-img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
    }

    .upcoming-top-badges {
        top: 4px !important;
        left: 4px !important;
        right: 4px !important;
        gap: 4px !important;
    }

    .upcoming-tag-ongoing,
    .upcoming-tag-premiere {
        font-size: 8px !important;
        padding: 2px 5px !important;
        gap: 3px !important;
        letter-spacing: 0 !important;
        border-radius: 4px !important;
    }

    .upcoming-pulse-dot-red {
        width: 5px !important;
        height: 5px !important;
    }

    .upcoming-score-badge {
        font-size: 8.5px !important;
        padding: 1px 4px !important;
        border-radius: 4px !important;
    }

    .upcoming-bottom-progress {
        bottom: 4px !important;
        left: 4px !important;
        right: 4px !important;
    }

    .upcoming-progress-pill {
        font-size: 8px !important;
        padding: 1.5px 4px !important;
        border-radius: 4px !important;
        max-width: 88px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
    }

    .upcoming-body {
        padding: 8px 10px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    .upcoming-meta-row {
        gap: 4px !important;
        margin-bottom: 2px !important;
    }

    .upcoming-country-badge,
    .upcoming-network-badge {
        font-size: 9.5px !important;
        padding: 1px 5px !important;
        border-radius: 4px !important;
    }

    .upcoming-title {
        font-size: 13.5px !important;
        font-weight: 700 !important;
        margin: 0 0 2px 0 !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .upcoming-native-title {
        font-size: 10.5px !important;
        margin-bottom: 4px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .upcoming-airing-info {
        padding: 3px 6px !important;
        margin-bottom: 4px !important;
        border-radius: 6px !important;
        font-size: 10.5px !important;
    }

    .upcoming-date-line {
        margin-bottom: 0 !important;
        gap: 4px !important;
        font-size: 10.5px !important;
    }

    .upcoming-date-line svg {
        width: 11px !important;
        height: 11px !important;
    }

    .upcoming-time-badge {
        font-size: 9px !important;
        padding: 0 4px !important;
    }

    .upcoming-cadence-line {
        display: none !important;
    }

    /* Compact Mini Countdown in Upcoming Cards */
    .upcoming-countdown-container {
        padding: 3px 6px !important;
        margin-bottom: 5px !important;
        border-radius: 6px !important;
    }

    .countdown-digit-boxes {
        gap: 4px !important;
    }

    .countdown-digit-boxes .cbox {
        min-width: 24px !important;
        padding: 1.5px 3px !important;
        border-radius: 4px !important;
    }

    .countdown-digit-boxes .c-val {
        font-size: 11.5px !important;
        line-height: 1 !important;
    }

    .countdown-digit-boxes .c-lbl {
        font-size: 6.5px !important;
        margin-top: 1px !important;
        letter-spacing: 0 !important;
    }

    .countdown-digit-boxes .c-sep {
        font-size: 9px !important;
    }

    .countdown-airing-status {
        font-size: 9.5px !important;
        padding: 1px 0 !important;
    }

    .upcoming-pending {
        font-size: 9.5px !important;
        padding: 2px 0 !important;
    }

    .upcoming-actions {
        gap: 5px !important;
        margin-top: auto !important;
    }

    .upcoming-watch-btn {
        padding: 4px 8px !important;
        font-size: 10.5px !important;
        font-weight: 700 !important;
        border-radius: 6px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .upcoming-qv-btn,
    .upcoming-mylist-btn {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        border-radius: 6px !important;
        padding: 0 !important;
    }

    .upcoming-qv-btn svg,
    .upcoming-mylist-btn svg {
        width: 12px !important;
        height: 12px !important;
    }

    /* --- 4. Single Drama Page: Airing Schedule Banner (Compact) --- */
    .drama-schedule-banner {
        padding: 9px 11px !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
    }

    .dsb-top-row {
        gap: 6px !important;
        margin-bottom: 5px !important;
    }

    .dsb-pill {
        font-size: 9px !important;
        padding: 1.5px 6px !important;
        letter-spacing: 0.4px !important;
    }

    .dsb-ep-title {
        font-size: 12.5px !important;
    }

    .dsb-network-tag {
        font-size: 9px !important;
        padding: 1px 5px !important;
        border-radius: 4px !important;
    }

    .dsb-info-row {
        font-size: 10.5px !important;
        margin-bottom: 6px !important;
        gap: 4px !important;
    }

    .dsb-date svg {
        width: 12px !important;
        height: 12px !important;
    }

    .dsb-cadence {
        font-size: 10px !important;
    }

    .dsb-countdown {
        padding: 3px 6px !important;
        margin-bottom: 0 !important;
        border-radius: 6px !important;
    }

    .dsb-countdown .countdown-digit-boxes {
        gap: 4px !important;
    }

    .dsb-countdown .countdown-digit-boxes .cbox {
        min-width: 24px !important;
        padding: 1.5px 3px !important;
        border-radius: 4px !important;
    }

    .dsb-countdown .countdown-digit-boxes .c-val {
        font-size: 11.5px !important;
    }

    .dsb-countdown .countdown-digit-boxes .c-lbl {
        font-size: 6.5px !important;
        margin-top: 1px !important;
    }

    .dsb-countdown .countdown-digit-boxes .c-sep {
        font-size: 9px !important;
    }

    /* --- 5. Single Drama: Airing Specs Row in Overview Tab --- */
    .drama-airing-specs-row {
        font-size: 11px !important;
        gap: 6px !important;
        margin-top: 2px !important;
    }

    .schedule-specs-badge {
        font-size: 10.5px !important;
        padding: 2px 7px !important;
        border-radius: 6px !important;
    }

    /* --- 6. Single Drama: Right Column Episodes Panel & Header --- */
    .drama-episodes-panel {
        padding: 14px 12px !important;
        border-radius: 14px !important;
    }

    .server-segmented-control {
        gap: 4px !important;
        padding: 3px !important;
        border-radius: 8px !important;
    }

    .server-tab {
        padding: 4px 10px !important;
        font-size: 11px !important;
        border-radius: 6px !important;
    }

    #episodes-container {
        gap: 7px !important;
        max-height: 460px !important;
        padding-right: 2px !important;
    }

    /* --- 7. Single Drama: Episode Cards (Compact Size on Mobile) --- */
    .episode-card {
        height: 56px !important;
        min-height: 56px !important;
        gap: 9px !important;
        border-radius: 9px !important;
    }

    .episode-card .ep-thumb-wrapper {
        width: 84px !important;
        min-width: 84px !important;
        max-width: 84px !important;
        height: 100% !important;
    }

    .episode-card .ep-play-circle div,
    .episode-card .ep-lock-circle div,
    .episode-card .ep-uploading-circle div {
        width: 22px !important;
        height: 22px !important;
        border-width: 1.5px !important;
    }

    .episode-card .ep-play-circle svg,
    .episode-card .ep-lock-circle svg,
    .episode-card .ep-uploading-circle svg {
        width: 10px !important;
        height: 10px !important;
    }

    .episode-card .ep-badge-pill {
        font-size: 8px !important;
        padding: 1px 4.5px !important;
        bottom: 3px !important;
        left: 3px !important;
        border-radius: 4px !important;
    }

    .episode-card .ep-card-details {
        padding-right: 8px !important;
    }

    .episode-card .ep-card-title {
        font-size: 12.5px !important;
        margin-bottom: 1px !important;
        line-height: 1.2 !important;
    }

    .episode-card .ep-server-tag {
        font-size: 8.5px !important;
        padding: 1px 5px !important;
        border-radius: 4px !important;
    }

    .episode-card .ep-card-subtitle {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

    /* --- 8. Single Drama: Seasons & Dub Language Pills (Compact on Mobile) --- */
    .drama-seasons-block,
    .drama-languages-block {
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
    }

    .season-pill-btn {
        padding: 4px 10px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
    }

    .lang-mini-badge {
        padding: 3px 8px !important;
        font-size: 10.5px !important;
    }
}

@media (max-width: 380px) {
    .upcoming-poster-wrap {
        width: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
    }

    .upcoming-body {
        padding: 6px 8px !important;
    }

    .upcoming-title {
        font-size: 12px !important;
    }

    .countdown-digit-boxes .cbox {
        min-width: 20px !important;
        padding: 1px 2px !important;
    }

    .countdown-digit-boxes .c-val {
        font-size: 10px !important;
    }

    .episode-card {
        height: 52px !important;
        min-height: 52px !important;
        gap: 7px !important;
    }

    .episode-card .ep-thumb-wrapper {
        width: 74px !important;
        min-width: 74px !important;
        max-width: 74px !important;
    }

    .episode-card .ep-card-title {
        font-size: 11.5px !important;
    }

    .episode-card .ep-card-subtitle {
        font-size: 9.5px !important;
    }
}

/* ─── Instant Navigation Top Micro-Progress Bar ─── */
#aniglass-top-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #ec4899, #8b5cf6, #38bdf8);
    z-index: 99999999;
    pointer-events: none;
    transition: width 0.2s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.25s ease;
    opacity: 0;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.8), 0 0 4px rgba(139, 92, 246, 0.9);
}

/* ─── Instant Shimmer Skeleton Placeholders ─── */
@keyframes aniglassShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.skeleton-card-pulse {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
}
.skeleton-card-pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: aniglassShimmer 1.4s infinite ease-in-out;
}

/* ==========================================================================
   ANIGLASS ULTRA-HIGH SPEED HARDWARE & MOBILE GPU PERFORMANCE ENGINE
   (Virtualized Rendering, 60 FPS Scroll, Hardware Compositing & Adaptive Glass)
   ========================================================================== */

/* ─── 1. Virtualized DOM Layout & Rendering (65% Faster Paint & RAM Saving) ─── */
.drama-card,
.anime-card,
.actor-card,
.trending-row-card,
.ranking-card,
.recommendation-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 340px;
}

/* Horizontal scroll containers must NOT use content-visibility: auto to prevent height stretching & spacing bugs on swipe */
.horizontal-scroll .drama-card,
.horizontal-scroll .anime-card,
.horizontal-scroll .top-rated-card-item,
.horizontal-scroll .carousel-card-col,
.horizontal-scroll > div {
    content-visibility: visible !important;
    contain-intrinsic-size: none !important;
}

.comment-item,
.episode-btn,
.actor-strip-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 55px;
}

/* ─── 2. Dedicated Hardware GPU Compositing Layers (Eliminates Jitter) ─── */
.site-header,
.glass-bottom-nav,
.modal-content,
.filter-modal-content,
.notifications-modal-content,
#sidebar-panel,
#aniglass-top-progress {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ─── 3. Adaptive Mobile Glass Engine (Prevents GPU Fill Rate Throttling) ─── */
@media (max-width: 768px) {
    :root {
        --lg-blur: blur(10px) saturate(130%) !important;
    }
    .glass-bg,
    .glass-panel,
    .lg-glass,
    .lg-glass-deep,
    .modal-content,
    .filter-modal-content,
    .notifications-modal-content,
    .site-header {
        backdrop-filter: blur(10px) saturate(130%) !important;
        -webkit-backdrop-filter: blur(10px) saturate(130%) !important;
    }
}

/* ─── 4. Low-Power & Reduced Motion Instant Fallback ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .glass-bg,
    .glass-panel,
    .lg-glass,
    .lg-glass-deep {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(6, 6, 9, 0.98) !important;
    }
}

/* ─── 5. Silky Smooth Touch Panning for Horizontal Lists ─── */
.drama-slider,
.trending-scroll-container,
.carousel-container,
.cast-scroll-row,
.country-pill-container,
.genre-pill-container {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* ─── 6. App-Exclusive Download Manager & Offline Player Styles ─── */
.app-only-element {
    display: none;
}

.download-badge-counter {
    position: absolute;
    top: -4px;
    right: -8px;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
    border: 1.5px solid #050508;
    line-height: 1;
    z-index: 5;
}

@keyframes dlBadgePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
    }
    70% {
        transform: scale(1.18);
        box-shadow: 0 0 0 8px rgba(168, 85, 247, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
    }
}

.download-badge-counter.has-active-downloads {
    animation: dlBadgePulse 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.app-ep-download-icon-btn:hover {
    background: rgba(168, 85, 247, 0.3) !important;
    border-color: rgba(168, 85, 247, 0.6) !important;
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.app-ep-download-icon-btn:active {
    transform: scale(0.95);
}

.hero-download-app-btn:hover {
    background: rgba(168, 85, 247, 0.28) !important;
    border-color: rgba(168, 85, 247, 0.65) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.35);
}

.downloads-modal-content::-webkit-scrollbar {
    width: 6px;
}
.downloads-modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.downloads-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}












