/* AniGlass Base Styles & Utilities */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0d0914;
    /* Deep violet-black */
    --text-color: #ffffff;
    --text-muted: #9ca3af;
    /* Soft gray */
    --glass-bg: rgba(30, 20, 45, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --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: #6e6e73;
    --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(30, 20, 45, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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%;
}

@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: 240px !important;
        background-position: top center !important;
        border-radius: 20px 20px 0 0 !important;
        position: relative !important;
    }

    .qv-image-section::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60%;
        background: linear-gradient(to top, rgba(20, 20, 20, 1) 0%, rgba(20, 20, 20, 0) 100%);
        border-radius: 0;
    }

    html.light-mode .qv-image-section::after {
        background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%) !important;
    }

    .qv-content-section {
        width: 100% !important;
        padding: 0 15px 15px !important;
        /* Remove top padding */
        margin-top: -30px !important;
        /* Pull up over the gradient */
        position: relative !important;
        z-index: 2 !important;
        /* Sit above gradient */
        border-radius: 0 0 20px 20px !important;
    }

    .qv-content-section h2 {
        font-size: 20px !important;
        margin-bottom: 8px !important;
        line-height: 1.2 !important;
    }

    .qv-content-section p {
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
        margin-bottom: 12px !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
    }
}

/* Sidebar nav links */
html.light-mode .sidebar-menu-list a {
    color: #1d1d1f;
}

html.light-mode .sidebar-menu-list a:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Modal and Overlays */
html.light-mode .modal-overlay,
html.light-mode #search-modal {
    background: rgba(245, 245, 247, 0.7) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
}

/* Quick View modal layout text and backgrounds */
html.light-mode #quick-view-body {
    color: #1d1d1f !important;
    background: transparent !important;
}

html.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 {
    color: #1d1d1f !important;
    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 20px 40px rgba(0, 0, 0, 0.1) !important;
}

html.light-mode .modal-close {
    color: #1d1d1f !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !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.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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(10, 10, 10, 0.75);
    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: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 999;
}

.liquid-nav-main {
    display: flex;
    align-items: center;
    border-radius: 100px;
    padding: 6px;
    background: rgba(30, 20, 45, 0.45);
    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(30, 20, 45, 0.75);
    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: #e5e5ea;
    /* Light gray track from screenshot */
    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: #1d1d1f;
}

.server-tab.active {
    background: #ffffff;
    color: #1d1d1f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* White pill with soft shadow */
}

html.light-mode .server-tab.active {
    background: #ffffff;
    color: #1d1d1f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Glass Segmented Control (Tabs) */
.glass-segmented-control {
    display: inline-flex;
    background: rgba(30, 20, 45, 0.5);
    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;
}

/* 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 {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding-bottom: 20px;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll>* {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

.horizontal-scroll .anime-card,
.horizontal-scroll>div {
    width: 150px;
    flex-shrink: 0;
}

/* 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(30, 20, 45, 0.5);
    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;
    /* Stacks ad text and images instead of side-by-side */
    justify-content: center;
    align-items: center;
    background: var(--glass-bg);
    /* Add glass background for empty space */
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    position: relative;
}

.aniglass-ad-slot>* {
    max-width: 100%;
    border-radius: 12px;
    display: block;
}

.aniglass-ad-slot img,
.aniglass-ad-slot iframe {
    object-fit: contain;
    max-width: 100%;
    height: auto;
}

/* Specific Ad Banner Sizes */
.ad-size-468x60 {
    max-width: 468px;
    max-height: 60px;
    margin: 0 auto;
}

.ad-size-300x250 {
    max-width: 300px;
    max-height: 250px;
    margin: 0 auto;
}

.ad-size-728x90 {
    max-width: 728px;
    max-height: 90px;
    margin: 0 auto;
}

.ad-size-320x50 {
    max-width: 320px;
    max-height: 50px;
    margin: 0 auto;
}

.ad-size-adaptive {
    width: 100%;
}

/* 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;
}

/* Top Rated Numbers */
.top-rated-rank {
    position: absolute;
    left: -25px;
    bottom: 15px;
    font-size: 90px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.08);
    line-height: 0.8;
    z-index: -1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
}

html.light-mode .top-rated-rank {
    color: rgba(0, 0, 0, 0.05);
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.15);
}

/* 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;
}

.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;
    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;
}

/* Live Search Results Styling */
#live-search-input {
    background: rgba(30, 20, 45, 0.45) !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(30, 20, 45, 0.45);
    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(30, 20, 45, 0.45);
    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(30, 20, 45, 0.45);
    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(30, 20, 45, 0.65);
    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);
}