/**
 * TMDB Browser Styles
 * Styles for the TMDB movie browser with infinite scroll
 * @version 1.1.0
 */

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Forum&family=Poppins:wght@400;600;700&family=Playfair+Display:wght@600&display=swap');

/* ===== RESET & BASE ===== */

* {
    margin: 0;
    padding: 0;
    body.theme-glass {
        --font-body: var(--font-glass-body);
        --font-title: var(--font-glass-display);
        --app-background: radial-gradient(140% 140% at 18% 12%, #ffffff 0%, #f5f6fa 45%, #ecf0f7 100%);
        --app-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(246, 249, 255, 0.72) 55%, rgba(244, 246, 252, 0.42) 100%);
        --app-grain: none;
        --text-primary: rgba(24, 28, 36, 0.94);
        --text-secondary: rgba(86, 96, 116, 0.74);
        --heading-gradient: linear-gradient(120deg, rgba(140, 158, 255, 0.88), rgba(92, 107, 192, 0.88));
        --header-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.58) 35%, rgba(255, 255, 255, 0.08) 100%);
        --panel-background: rgba(255, 255, 255, 0.54);
        --panel-border: 1px solid rgba(220, 225, 236, 0.6);
        --panel-shadow: 0 20px 32px rgba(15, 23, 42, 0.12);
        --panel-blur: 32px;
        --accent-primary: rgba(108, 132, 255, 0.85);
        --accent-secondary: rgba(142, 165, 255, 0.78);
        --accent-soft: rgba(120, 140, 255, 0.12);
        --accent-contrast: rgba(54, 65, 94, 0.7);
        --quick-nav-bg: rgba(255, 255, 255, 0.55);
        --quick-nav-border: 1px solid rgba(212, 220, 235, 0.5);
        --segmented-background: rgba(240, 244, 255, 0.65);
        --segmented-thumb: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(224, 234, 255, 0.82));
        --segmented-thumb-shadow: 0 12px 24px rgba(96, 112, 152, 0.18);
        --movie-card-background: rgba(255, 255, 255, 0.68);
        --movie-card-border: 1px solid rgba(214, 222, 235, 0.7);
        --movie-card-hover-shadow: 0 24px 40px rgba(58, 72, 112, 0.16);
        --movie-poster-fallback: rgba(172, 186, 214, 0.18);
        --chip-background: rgba(245, 247, 255, 0.75);
        --chip-border: 1px solid rgba(220, 226, 240, 0.6);
        --button-primary-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(229, 234, 255, 0.92));
        --button-primary-color: rgba(36, 44, 64, 0.86);
        --button-secondary-bg: rgba(244, 246, 252, 0.85);
        --button-secondary-border: 1px solid rgba(216, 222, 236, 0.7);
        --button-secondary-color: rgba(70, 82, 105, 0.78);
        --stat-chip-accent: rgba(128, 152, 255, 0.75);
        --theme-toggle-bg: rgba(255, 255, 255, 0.58);
        --theme-toggle-border: 1px solid rgba(210, 218, 232, 0.55);
        --theme-toggle-thumb: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(228, 232, 255, 0.9));
        --theme-toggle-shadow: 0 16px 32px rgba(56, 72, 112, 0.18);
        --overlay-scrim: rgba(18, 24, 36, 0.32);
        --overlay-panel-bg: rgba(255, 255, 255, 0.65);
        --overlay-panel-border: 1px solid rgba(214, 222, 236, 0.6);
        --overlay-panel-shadow: 0 36px 60px rgba(34, 46, 78, 0.16);
        --overlay-heading-color: rgba(100, 120, 190, 0.9);
        --overlay-text: rgba(46, 55, 77, 0.88);
        --stats-background: rgba(255, 255, 255, 0.6);
        --stats-border: 1px solid rgba(214, 222, 236, 0.6);
        --stats-shadow: 0 16px 30px rgba(62, 78, 120, 0.12);
        --filter-bar-bg: rgba(248, 250, 255, 0.72);
        --filter-bar-border: 1px solid rgba(216, 222, 235, 0.6);
        --filter-chip-bg: rgba(244, 246, 252, 0.8);
        --filter-chip-border: 1px solid rgba(216, 222, 235, 0.55);
        --filter-chip-hover: rgba(229, 234, 246, 0.8);
        --stat-color-info: rgba(112, 140, 210, 0.85);
        --stat-color-success: rgba(110, 180, 162, 0.85);
        --stat-color-warning: rgba(226, 190, 130, 0.85);
        --form-control-bg: rgba(255, 255, 255, 0.82);
        --form-control-border: 1px solid rgba(210, 218, 232, 0.65);
        --form-control-focus: 1px solid rgba(128, 152, 255, 0.65);
        --form-option-bg: rgba(255, 255, 255, 0.95);
        --form-option-color: rgba(38, 46, 68, 0.88);
    }
    --app-grain-opacity: 0.18;
    --app-grain-blend: screen;
    --text-primary: rgba(248, 247, 255, 0.96);
    --text-secondary: rgba(210, 208, 226, 0.72);
    --heading-gradient: linear-gradient(135deg, #ff8a05 0%, #ff3358 48%, #ae00ff 100%);
    --header-gradient: linear-gradient(180deg, rgba(12, 12, 20, 0.95) 0%, rgba(12, 12, 20, 0.78) 60%, rgba(12, 12, 20, 0) 100%);
    --panel-background: rgba(19, 19, 29, 0.82);
    --panel-border: 1px solid rgba(255, 255, 255, 0.08);
    --panel-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    --panel-blur: 12px;
    --accent-primary: #ff3358;
    --accent-secondary: #ff8a05;
    --accent-soft: rgba(255, 51, 88, 0.12);
    --accent-contrast: rgba(255, 180, 200, 0.85);
    --quick-nav-bg: rgba(18, 18, 28, 0.92);
    --quick-nav-border: 1px solid rgba(255, 255, 255, 0.08);
    --segmented-background: rgba(255, 255, 255, 0.08);
    --segmented-thumb: linear-gradient(135deg, rgba(255, 51, 88, 0.92), rgba(177, 0, 255, 0.88));
    --segmented-thumb-shadow: 0 16px 38px rgba(255, 51, 88, 0.45);
    --movie-card-background: linear-gradient(160deg, rgba(22, 22, 32, 0.95), rgba(15, 15, 25, 0.9));
    --movie-card-border: 1px solid rgba(255, 255, 255, 0.06);
    --movie-card-hover-shadow: 0 28px 60px rgba(255, 51, 88, 0.35);
    --movie-poster-fallback: rgba(94, 26, 59, 0.4);
    --chip-background: rgba(255, 255, 255, 0.05);
    --chip-border: 1px solid rgba(255, 255, 255, 0.12);
    --button-primary-bg: linear-gradient(135deg, #ff3358 0%, #ff8a05 100%);
    --button-primary-color: #fff;
    --button-secondary-bg: rgba(255, 255, 255, 0.08);
    --button-secondary-border: 1px solid rgba(255, 255, 255, 0.14);
    --button-secondary-color: rgba(248, 247, 255, 0.85);
    --stat-chip-accent: rgba(255, 51, 88, 0.85);
    --theme-toggle-bg: rgba(24, 24, 34, 0.85);
    --theme-toggle-border: 1px solid rgba(255, 255, 255, 0.08);
    --theme-toggle-thumb: linear-gradient(135deg, rgba(255, 51, 88, 0.95), rgba(177, 0, 255, 0.85));
    --theme-toggle-shadow: 0 18px 38px rgba(255, 51, 88, 0.35);
    --overlay-scrim: rgba(4, 4, 9, 0.86);
    --overlay-panel-bg: linear-gradient(160deg, rgba(22, 22, 32, 0.95), rgba(12, 12, 22, 0.92));
    --overlay-panel-border: 1px solid rgba(255, 255, 255, 0.08);
    --overlay-panel-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    --overlay-heading-color: var(--accent-primary);
    --overlay-text: rgba(235, 232, 244, 0.82);
    --stats-background: rgba(19, 19, 28, 0.92);
    --stats-border: 1px solid rgba(255, 255, 255, 0.08);
    --stats-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
    --filter-bar-bg: rgba(18, 18, 25, 0.75);
    --filter-bar-border: 1px solid rgba(255, 255, 255, 0.05);
    --filter-chip-bg: rgba(255, 255, 255, 0.08);
    --filter-chip-border: 1px solid rgba(255, 255, 255, 0.15);
    --filter-chip-hover: rgba(255, 255, 255, 0.16);
    --stat-color-info: rgba(120, 188, 255, 0.95);
    --stat-color-success: rgba(150, 255, 190, 0.95);
    --stat-color-warning: rgba(255, 190, 120, 0.95);
    --form-control-bg: rgba(34, 34, 48, 0.65);
    --form-control-border: 1px solid rgba(255, 255, 255, 0.12);
    --form-control-focus: 1px solid rgba(255, 51, 88, 0.65);
    --form-option-bg: rgba(18, 18, 25, 0.96);
    --form-option-color: rgba(240, 240, 255, 0.92);
    --modal-primary-bg: var(--button-primary-bg);
    --modal-primary-hover: brightness(1.08);
    --modal-secondary-bg: rgba(255, 255, 255, 0.12);
    --modal-secondary-border: 1px solid rgba(255, 255, 255, 0.18);
    --modal-secondary-hover: rgba(255, 255, 255, 0.2);
}

    html,
    body,
    body.theme-cinematic,
    body.theme-glass,
    body.theme-noir {
        background-color: #000;
        background-image: none;
    }

    *, *::before, *::after {
        box-sizing: border-box;
    }

html {
    scrollbar-gutter: stable both-edges;
        max-width: 100vw;
        overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
        width: 100%;
    min-height: 100vh;
    overflow-y: scroll;
    overscroll-behavior-x: none;
        max-width: 100vw;
        margin: 0 auto;
        padding-top: 56px;
    font-family: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body.theme-glass {
    --font-body: var(--font-glass-body);
    --font-title: var(--font-glass-display);
    --app-background: linear-gradient(160deg, #f5f6fa 0%, #eef1f6 55%, #ffffff 100%);
    --app-overlay: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 249, 252, 0.78) 65%, rgba(245, 246, 249, 0.35) 100%);
    --app-grain: none;
    --text-primary: rgba(28, 32, 38, 0.94);
    --text-secondary: rgba(92, 104, 122, 0.72);
    --heading-gradient: linear-gradient(120deg, rgba(128, 168, 255, 0.92), rgba(94, 138, 255, 0.92));
    --header-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.6) 55%, rgba(255, 255, 255, 0.1) 100%);
    --panel-background: rgba(255, 255, 255, 0.68);
    --panel-border: 1px solid rgba(199, 205, 217, 0.62);
    --panel-shadow: 0 24px 48px rgba(40, 52, 92, 0.16);
    --panel-blur: 28px;
    --accent-primary: rgba(122, 154, 255, 0.9);
    --accent-secondary: rgba(160, 185, 255, 0.85);
    --accent-soft: rgba(116, 147, 242, 0.12);
    --accent-contrast: rgba(54, 84, 160, 0.75);
    --quick-nav-bg: rgba(255, 255, 255, 0.72);
    --quick-nav-border: 1px solid rgba(208, 214, 226, 0.6);
    --segmented-background: rgba(232, 235, 244, 0.7);
    --segmented-thumb: linear-gradient(135deg, rgba(148, 178, 255, 0.95), rgba(110, 144, 255, 0.92));
    --segmented-thumb-shadow: 0 18px 34px rgba(102, 136, 255, 0.28);
    --movie-card-background: rgba(255, 255, 255, 0.82);
    --movie-card-border: 1px solid rgba(204, 210, 222, 0.72);
    --movie-card-hover-shadow: 0 26px 48px rgba(58, 84, 136, 0.18);
    --movie-poster-fallback: rgba(146, 168, 214, 0.32);
    --chip-background: rgba(242, 244, 250, 0.86);
    --chip-border: 1px solid rgba(211, 217, 231, 0.7);
    --button-primary-bg: linear-gradient(135deg, rgba(144, 174, 255, 0.98), rgba(108, 142, 255, 0.95));
    --button-primary-color: rgba(26, 32, 46, 0.92);
    --button-secondary-bg: rgba(236, 239, 247, 0.82);
    --button-secondary-border: 1px solid rgba(204, 210, 222, 0.7);
    --button-secondary-color: rgba(64, 76, 100, 0.82);
    --stat-chip-accent: rgba(128, 158, 255, 0.85);
    --theme-toggle-bg: rgba(242, 244, 250, 0.88);
    --theme-toggle-border: 1px solid rgba(206, 212, 225, 0.7);
    --theme-toggle-thumb: linear-gradient(135deg, rgba(150, 180, 255, 0.98), rgba(120, 150, 255, 0.92));
    --theme-toggle-shadow: 0 16px 30px rgba(120, 152, 255, 0.24);
    --overlay-scrim: rgba(28, 36, 48, 0.45);
    --overlay-panel-bg: rgba(255, 255, 255, 0.82);
    --overlay-panel-border: 1px solid rgba(208, 214, 226, 0.68);
    --overlay-panel-shadow: 0 40px 80px rgba(34, 46, 78, 0.18);
    --overlay-heading-color: rgba(92, 126, 220, 0.95);
    --overlay-text: rgba(55, 63, 82, 0.9);
    --stats-background: rgba(255, 255, 255, 0.78);
    --stats-border: 1px solid rgba(210, 216, 228, 0.65);
    --stats-shadow: 0 18px 36px rgba(40, 52, 92, 0.14);
    --filter-bar-bg: rgba(245, 247, 252, 0.86);
    --filter-bar-border: 1px solid rgba(204, 210, 222, 0.68);
    --filter-chip-bg: rgba(236, 240, 248, 0.92);
    --filter-chip-border: 1px solid rgba(205, 210, 224, 0.7);
    --filter-chip-hover: rgba(213, 219, 235, 0.8);
    --stat-color-info: rgba(124, 156, 236, 0.95);
    --stat-color-success: rgba(120, 194, 168, 0.92);
    --stat-color-warning: rgba(228, 190, 120, 0.92);
    --form-control-bg: rgba(248, 250, 255, 0.92);
    --form-control-border: 1px solid rgba(206, 212, 225, 0.75);
    --form-control-focus: 1px solid rgba(128, 158, 255, 0.75);
    --form-option-bg: rgba(255, 255, 255, 0.98);
    --form-option-color: rgba(47, 56, 74, 0.9);
    --modal-primary-bg: var(--button-primary-bg);
    --modal-primary-hover: brightness(1.05);
    --modal-secondary-bg: rgba(236, 239, 247, 0.88);
    --modal-secondary-border: 1px solid rgba(206, 212, 225, 0.72);
    --modal-secondary-hover: rgba(214, 219, 232, 0.85);
}

body.theme-noir {
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-title: 'Forum', 'Playfair Display', serif;
    --app-background: radial-gradient(circle at top, #0f0c14 0%, #050307 70%, #020104 100%);
    --app-overlay: linear-gradient(160deg, rgba(12, 10, 16, 0.96) 0%, rgba(9, 7, 12, 0.98) 60%, rgba(6, 5, 9, 1) 100%);
    --app-grain-opacity: 0.14;
    --app-grain-blend: soft-light;
    --text-primary: rgba(245, 232, 214, 0.96);
    --text-secondary: rgba(210, 198, 176, 0.7);
    --heading-gradient: linear-gradient(125deg, #f5d47d 0%, #c08f3c 58%, #6d4b1f 100%);
    --header-gradient: linear-gradient(180deg, rgba(18, 14, 22, 0.95) 0%, rgba(14, 11, 18, 0.72) 65%, rgba(10, 7, 11, 0) 100%);
    --panel-background: rgba(22, 18, 24, 0.9);
    --panel-border: 1px solid rgba(245, 212, 125, 0.18);
    --panel-shadow: 0 32px 70px rgba(0, 0, 0, 0.62);
    --panel-blur: 14px;
    --accent-primary: #f5d47d;
    --accent-secondary: #1f6f8b;
    --accent-soft: rgba(245, 212, 125, 0.12);
    --accent-contrast: rgba(245, 212, 125, 0.9);
    --quick-nav-bg: rgba(24, 20, 26, 0.88);
    --quick-nav-border: 1px solid rgba(245, 212, 125, 0.2);
    --segmented-background: rgba(35, 30, 38, 0.6);
    --segmented-thumb: linear-gradient(130deg, rgba(245, 212, 125, 0.9), rgba(111, 78, 55, 0.85));
    --segmented-thumb-shadow: 0 20px 36px rgba(245, 212, 125, 0.3);
    --movie-card-background: linear-gradient(160deg, rgba(26, 20, 28, 0.96), rgba(14, 10, 16, 0.9));
    --movie-card-border: 1px solid rgba(245, 212, 125, 0.14);
    --movie-card-hover-shadow: 0 32px 62px rgba(32, 24, 20, 0.55);
    --movie-poster-fallback: rgba(74, 54, 33, 0.45);
    --chip-background: rgba(245, 212, 125, 0.08);
    --chip-border: 1px solid rgba(245, 212, 125, 0.22);
    --button-primary-bg: linear-gradient(135deg, #f5d47d 0%, #c08f3c 100%);
    --button-primary-color: rgba(32, 22, 16, 0.92);
    --button-secondary-bg: rgba(32, 28, 34, 0.65);
    --button-secondary-border: 1px solid rgba(245, 212, 125, 0.22);
    --button-secondary-color: rgba(238, 226, 210, 0.85);
    --stat-chip-accent: rgba(245, 212, 125, 0.85);
    --theme-toggle-bg: rgba(26, 22, 30, 0.82);
    --theme-toggle-border: 1px solid rgba(245, 212, 125, 0.22);
    --theme-toggle-thumb: linear-gradient(135deg, rgba(245, 212, 125, 0.92), rgba(111, 78, 55, 0.85));
    --theme-toggle-shadow: 0 18px 36px rgba(245, 212, 125, 0.28);
    --overlay-scrim: rgba(6, 5, 8, 0.93);
    --overlay-panel-bg: linear-gradient(160deg, rgba(20, 16, 22, 0.96), rgba(12, 9, 14, 0.94));
    --overlay-panel-border: 1px solid rgba(245, 212, 125, 0.2);
    --overlay-panel-shadow: 0 40px 80px rgba(0, 0, 0, 0.62);
    --overlay-heading-color: rgba(245, 212, 125, 0.9);
    --overlay-text: rgba(240, 226, 210, 0.82);
    --stats-background: rgba(20, 16, 22, 0.9);
    --stats-border: 1px solid rgba(245, 212, 125, 0.2);
    --stats-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    --filter-bar-bg: rgba(22, 18, 24, 0.82);
    --filter-bar-border: 1px solid rgba(245, 212, 125, 0.2);
    --filter-chip-bg: rgba(245, 212, 125, 0.1);
    --filter-chip-border: 1px solid rgba(245, 212, 125, 0.24);
    --filter-chip-hover: rgba(245, 212, 125, 0.18);
    --stat-color-info: rgba(188, 224, 255, 0.95);
    --stat-color-success: rgba(151, 211, 181, 0.95);
    --stat-color-warning: rgba(245, 183, 112, 0.95);
    --form-control-bg: rgba(28, 22, 30, 0.72);
    --form-control-border: 1px solid rgba(245, 212, 125, 0.24);
    --form-control-focus: 1px solid rgba(245, 212, 125, 0.55);
    --form-option-bg: rgba(20, 16, 22, 0.96);
    --form-option-color: rgba(245, 228, 198, 0.9);
    --modal-primary-bg: linear-gradient(135deg, rgba(245, 212, 125, 0.92), rgba(154, 105, 52, 0.9));
    --modal-primary-hover: brightness(1.05);
    --modal-secondary-bg: rgba(30, 24, 32, 0.64);
    --modal-secondary-border: 1px solid rgba(245, 212, 125, 0.2);
    --modal-secondary-hover: rgba(245, 212, 125, 0.2);
}

/* ===== HEADER ===== */

header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 10px clamp(14px, 3vw, 36px) !important;
    background: rgba(10, 15, 30, 0.5) !important;
    backdrop-filter: blur(32px) saturate(110%) !important;
    border-bottom: 0.5px solid rgba(79, 172, 254, 0.15) !important;
    z-index: 1000 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(12px, 2vw, 24px);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.logo {
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'San Francisco', sans-serif;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.03em;
    color: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 10px;
    border: 0.5px solid rgba(79, 172, 254, 0.3);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.15);
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.header-category {
    flex: 0 1 auto;
}

.header-year-slider {
    flex: 0 1 auto;
    min-width: 180px;
}

.header-year-slider input[type="range"] {
    width: 100%;
    cursor: pointer;
}

body.theme-glass header {
    background: rgba(10, 15, 30, 0.55) !important;
    backdrop-filter: blur(36px) saturate(115%) !important;
    border-bottom: 0.5px solid rgba(79, 172, 254, 0.18) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18) !important;
}

.masthead-copy h1 {
    font-size: 1.1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'San Francisco', sans-serif;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(79, 172, 254, 0.9));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    padding: 8px 16px;
    border-radius: 12px;
    border: 0.5px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    display: inline-block;
    white-space: nowrap;
}

.masthead-copy {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: center;
}

body.theme-glass .masthead-copy h1 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(79, 172, 254, 0.9));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: none;
}

body.theme-glass header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.90) 0%, rgba(248, 249, 252, 0.82) 100%);
    border-bottom: 0.5px solid rgba(214, 222, 236, 0.3);
    box-shadow: 0 2px 8px rgba(72, 96, 140, 0.06);
}

body.theme-noir header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0) 35%);
    mix-blend-mode: screen;
    pointer-events: none;
}

body.theme-noir .masthead-copy {
    position: relative;
    padding: clamp(14px, 2.2vw, 20px) clamp(18px, 3vw, 26px);
    background: radial-gradient(circle at 30% 30%, rgba(64, 34, 29, 0.78) 0%, rgba(32, 18, 26, 0.9) 55%, rgba(14, 9, 16, 0.94) 100%);
    border-radius: 14px;
    border: 1px solid rgba(245, 212, 125, 0.24);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(245, 212, 125, 0.15),
        inset 0 0 0 8px rgba(32, 18, 24, 0.45);
}

body.theme-noir .masthead-copy::before,
body.theme-noir .masthead-copy::after {
    content: "";
    position: absolute;
    left: clamp(18px, 3vw, 32px);
    right: clamp(18px, 3vw, 32px);
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        rgba(245, 212, 125, 0.92) 0px,
        rgba(245, 212, 125, 0.92) 8px,
        rgba(135, 88, 42, 0.35) 8px,
        rgba(135, 88, 42, 0.35) 14px
    );
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(245, 212, 125, 0.35);
    opacity: 0.75;
    pointer-events: none;
}

body.theme-noir .masthead-copy::before {
    top: clamp(10px, 2.2vw, 16px);
}

body.theme-noir .masthead-copy::after {
    bottom: clamp(10px, 2.2vw, 16px);
}

body.theme-noir .masthead-copy h1 {
    position: relative;
    display: inline-block;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    background: linear-gradient(120deg, #fff5d6 0%, #f5d47d 28%, #cf8c35 62%, #ffe4ba 88%, #f5d47d 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow:
        0 1px 0 #f8e9c4,
        0 2px 0 #d29b46,
        0 4px 0 #9c6429,
        0 8px 16px rgba(0, 0, 0, 0.45);
}

body.theme-noir .masthead-copy h1::after {
    content: "";
    position: absolute;
    inset: 62% -12px -12px;
    background: linear-gradient(180deg, rgba(15, 10, 8, 0), rgba(58, 34, 22, 0.45));
    border-radius: 10px;
    filter: blur(5px);
    opacity: 0.55;
    pointer-events: none;
}

body.theme-noir .subtitle {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
    color: rgba(245, 228, 198, 0.8);
    font-size: clamp(0.75rem, 1.2vw, 0.88rem);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.subtitle {
    color: rgba(86, 96, 116, 0.8);
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    letter-spacing: -0.01em;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.theme-glass .subtitle {
    color: rgba(86, 96, 116, 0.85);
}



@media (max-width: 700px) {
    .header-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 900px) {
    .quick-categories__inner {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .quick-categories__meta {
        justify-content: center;
    }

    .quick-categories {
        padding-inline: clamp(12px, 4vw, 24px);
    }
}

@media (max-width: 600px) {
    .quick-categories__meta {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .quick-categories__meta .toolbar-pill {
        width: 100%;
    }

    .edit-filters-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== QUICK CATEGORIES NAVIGATION ===== */

.quick-categories {
    display: flex !important;
    flex-direction: column;
    gap: clamp(12px, 2vw, 18px);
    padding: clamp(12px, 2vw, 18px) clamp(16px, 4vw, 32px);
    background: var(--quick-nav-bg);
    border-bottom: var(--quick-nav-border);
    position: sticky;
    top: 0;
    z-index: 95;
    width: 100%;
}

.quick-categories__inner {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: clamp(12px, 3vw, 32px);
    align-items: center;
    width: 100%;
}

.quick-categories__control {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.quick-categories__control::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.quick-categories__meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(8px, 1.6vw, 16px);
    flex-wrap: wrap;
}

.quick-categories .ios-segmented {
    width: min(880px, 100%);
    background: var(--segmented-background);
    border: 1px solid transparent;
    box-shadow: var(--segmented-thumb-shadow);
    gap: 6px;
}

body.theme-glass .quick-categories .ios-segmented {
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(140deg, rgba(15, 23, 42, 0.7), rgba(59, 130, 246, 0.2));
    box-shadow:
        0 22px 42px rgba(8, 16, 32, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(150%);
}

.quick-categories .ios-segmented__thumb {
    background: var(--segmented-thumb);
    box-shadow: var(--segmented-thumb-shadow);
}

body.theme-glass .quick-categories .ios-segmented__thumb {
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.95), rgba(147, 197, 253, 0.85));
    box-shadow:
        0 18px 32px rgba(37, 99, 235, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.quick-categories .ios-segmented__option {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 18px;
    letter-spacing: 0.02em;
}

.quick-categories .ios-segmented__option:hover {
    color: var(--text-primary);
}

.quick-categories .ios-segmented__option--active {
    color: var(--text-primary) !important;
}

.quick-categories .ios-segmented__option:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.toolbar-pill {
    background: var(--filter-chip-bg);
    border: var(--filter-chip-border);
    padding: 8px 14px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 96px;
    transition: background var(--transition-fast), border var(--transition-fast);
}

.toolbar-pill__label {
    font-size: 0.65rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.toolbar-pill__value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

.toolbar-pill--year {
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

body.theme-glass .toolbar-pill {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: linear-gradient(130deg, rgba(15, 23, 42, 0.75), rgba(37, 99, 235, 0.18));
    backdrop-filter: blur(18px) saturate(145%);
    box-shadow:
        0 14px 24px rgba(8, 16, 32, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(12, 28, 64, 0.55);
}

/* ===== CONTAINER & LAYOUT ===== */

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 40px;
}

.movie-row {
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-in;
}
body.theme-glass .overlay-content {
    border-radius: 28px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.72), rgba(59, 130, 246, 0.16));
    box-shadow:
        0 32px 64px rgba(8, 16, 32, 0.56),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(28px) saturate(160%);
}

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

/* ===== MOVIE GRID ===== */

.movies-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 12px;
    width: 100%;
}

body.theme-glass .movie-card {
    border-radius: 18px;
    border: 0.5px solid rgba(214, 222, 236, 0.3);
    background: transparent;
    box-shadow:
        0 16px 32px rgba(68, 88, 130, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
}

body.theme-glass .movie-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
    pointer-events: none;
    opacity: 0.9;
    z-index: 0;
}

body.theme-glass .movie-card > * {
    position: relative;
    z-index: 1;
    width: 100%;
}

body.theme-glass .movie-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow:
        0 32px 58px rgba(72, 96, 140, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border-color: rgba(198, 208, 226, 0.75);
}

.movie-card {
    cursor: pointer;
    transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-fast);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--movie-card-background);
    position: relative;
    width: 100%;
    height: 100%;
    border: var(--movie-card-border);
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--movie-card-hover-shadow);
    z-index: 10;
}

body.theme-glass .movie-info {
    padding: 7px 9px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.72), rgba(226, 234, 255, 0.4));
    border: 0.5px solid rgba(214, 222, 236, 0.4);
    border-radius: 10px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 12px 24px rgba(72, 96, 140, 0.12);
    height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body.theme-glass .movie-title {
    letter-spacing: 0.02em;
    font-weight: 600;
    color: rgba(30, 42, 64, 0.9);
    font-size: 0.8rem;
    line-height: 1.2;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 30px;
    max-height: 30px;
}

body.theme-glass .movie-rating {
    color: rgba(59, 130, 246, 0.82);
    font-weight: 500;
    font-size: 0.75rem;
    min-height: 14px;
    max-height: 14px;
    display: flex;
    align-items: center;
}

body.theme-glass .movie-poster {
    border-radius: 16px;
    overflow: hidden;
    border: none;
    background: transparent;
    box-shadow: none;
    width: 100%;
    height: 100%;
}

.movie-poster {
    width: 100%;
    height: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--movie-poster-fallback);
}

.movie-info {
    padding: 12px;
}

.movie-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-title);
    letter-spacing: 0.02em;
}

.movie-rating {
    font-size: 0.8rem;
    color: var(--accent-contrast, #ffd700);
}

/* ===== LOADING INDICATOR ===== */

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Hide initial page loading spinner until JS shows it */
#loading {
    display: none;
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== OVERLAY STYLES ===== */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-scrim, rgba(0, 0, 0, 0.92));
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    max-width: 900px;
    margin: 50px auto;
    padding: 40px;
    background: var(--overlay-panel-bg);
    border-radius: var(--radius-lg);
    border: var(--overlay-panel-border);
    box-shadow: var(--overlay-panel-shadow);
    position: relative;
    animation: slideUp 0.4s ease;
}

.overlay-content.has-backdrop {
    background: rgba(6, 10, 20, 0.92);
    overflow: hidden;
}

.overlay-content.has-backdrop::before,
.overlay-content.has-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.overlay-content.has-backdrop::before {
    background-image: var(--overlay-background-image, none);
    background-size: cover;
    background-position: center;
    filter: saturate(1.1);
    opacity: 0.45;
}

.overlay-content.has-backdrop::after {
    background: linear-gradient(180deg, rgba(4, 8, 16, 0.8) 0%, rgba(4, 8, 16, 0.9) 45%, rgba(4, 8, 16, 0.97) 100%);
}

.overlay-content.has-backdrop > * {
    position: relative;
    z-index: 1;
}

.overlay-content.has-backdrop .overlay-controls {
    z-index: 60;
}

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

.overlay-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 50;
}

.overlay-close,
.overlay-close-all {
    background: var(--button-primary-bg);
    border: none;
    height: 40px;
    border-radius: 20px;
    color: var(--button-primary-color, #fff);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    padding: 0 20px;
    font-weight: 500;
}

.overlay-close {
    width: 40px;
    padding: 0;
    font-size: 1.5rem;
}

.overlay-close:hover,
.overlay-close-all:hover {
    filter: brightness(1.08);
}

.overlay-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.overlay-stream-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--button-primary-bg);
    color: var(--button-primary-color, #fff);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        filter var(--transition-fast);
    box-shadow: var(--theme-toggle-shadow, 0 18px 36px rgba(59, 130, 246, 0.28));
}

.overlay-stream-btn span {
    display: inline-flex;
    align-items: center;
}

.overlay-stream-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.overlay-stream-btn:active {
    transform: translateY(-1px);
}

.overlay-backdrop-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    background: linear-gradient(165deg, rgba(5, 9, 18, 0.85), rgba(17, 29, 52, 0.65));
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    min-height: 260px;
}

.overlay-backdrop {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    object-position: center;
    display: block;
    background: transparent;
}

.overlay-backdrop-badge {
    position: absolute;
    right: 18px;
    bottom: 18px;
    padding: 20px;
    border-radius: 999px;
    background: rgba(12, 20, 38, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 24px rgba(12, 20, 38, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
}

.overlay-backdrop-badge img {
    height: 70px;
    width: auto;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
    z-index: 41;
}

.overlay-header {
    margin-bottom: 20px;
}

.overlay-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: var(--font-title);
    letter-spacing: 0.05em;
}

.overlay-meta {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.overlay-overview {
    line-height: 1.6;
    color: var(--overlay-text);
    margin: 20px 0;
}

.overlay-section {
    margin-top: 30px;
}

.overlay-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--overlay-heading-color);
    font-family: var(--font-title);
    letter-spacing: 0.06em;
}

/* ===== STATS PANEL ===== */

.stats {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--stats-background);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    backdrop-filter: blur(var(--panel-blur));
    border: var(--stats-border);
    box-shadow: var(--stats-shadow);
    z-index: 50;
}
body.theme-glass .stats {
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(59, 130, 246, 0.18));
    box-shadow:
        0 28px 48px rgba(8, 16, 32, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(22px) saturate(150%);
}

.stats div {
    margin-bottom: 5px;
}

.stats strong {
    color: var(--stat-chip-accent);
}

.stats .stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.stats .stat-value--info {
    color: var(--stat-color-info);
}

.stats .stat-value--success {
    color: var(--stat-color-success);
}

.stats .stat-value--warning {
    color: var(--stat-color-warning);
}

.stats button {
    margin-top: 10px;
    background: var(--button-secondary-bg);
    border: var(--button-secondary-border);
    color: var(--button-secondary-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.stats button:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.stats-divider {
    border-top: var(--filter-bar-border);
    margin: 12px 0;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-chip {
    background: var(--filter-chip-bg);
    border: var(--filter-chip-border);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

body.theme-glass .filter-chip {
    position: relative;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: linear-gradient(130deg, rgba(15, 23, 42, 0.75), rgba(37, 99, 235, 0.18));
    backdrop-filter: blur(18px) saturate(145%);
    box-shadow:
        0 14px 24px rgba(8, 16, 32, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.theme-glass .filter-chip::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    pointer-events: none;
    opacity: 0.65;
}

.filter-chip.removable {
    padding-right: 8px;
    cursor: pointer;
}

.filter-chip.removable:hover {
    background: var(--filter-chip-hover);
    transform: translateY(-1px);
}

.filter-chip.active {
    background: var(--accent-soft);
    border-color: var(--accent-primary);
}

.chip-remove {
    background: rgba(255, 255, 255, 0.16);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin-left: 4px;
    transition: background 0.2s ease;
}

.chip-remove:hover {
    background: var(--accent-primary);
}

body.theme-glass .chip-remove {
    background: rgba(148, 163, 184, 0.35);
    color: rgba(12, 23, 42, 0.85);
}

body.theme-glass .chip-remove:hover {
    background: rgba(96, 165, 250, 0.85);
}

/* ===== MODAL STYLES ===== */

.modal-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.modal-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-section label {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-sort-control {
    display: flex;
    width: 100%;
}

.modal-sort-control .ios-segmented {
    width: 100%;
    max-width: 100%;
}

.modal-select {
    background: var(--form-control-bg);
    border: var(--form-control-border);
    color: var(--text-primary);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.modal-select:hover, 
.modal-select:focus {
    background: var(--filter-chip-hover);
    border: var(--form-control-focus);
    outline: none;
}

.modal-select option {
    background: var(--form-option-bg);
    color: var(--form-option-color);
}

.modal-input {
    background: var(--form-control-bg);
    border: var(--form-control-border);
    color: var(--text-primary);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
}

.modal-input:focus {
    outline: 2px solid transparent;
    border: var(--form-control-focus);
    outline-offset: 2px;
}

.modal-btn {
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: var(--modal-primary-bg);
    color: var(--button-primary-color, #fff);
}

body.theme-glass .modal-btn {
    border-radius: 16px;
    letter-spacing: 0.04em;
    background: linear-gradient(140deg, rgba(59, 130, 246, 0.92), rgba(96, 165, 250, 0.88));
    color: rgba(8, 16, 32, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow:
        0 22px 32px rgba(37, 99, 235, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(20px) saturate(150%);
}

body.theme-glass .modal-btn-secondary {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.7), rgba(59, 130, 246, 0.2));
    color: rgba(224, 231, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

body.theme-glass .modal-btn:hover {
    transform: translateY(-2px);
}

.modal-btn-primary:hover {
    filter: var(--modal-primary-hover);
    transform: translateY(-1px);
}

.modal-btn-secondary {
    background: var(--modal-secondary-bg);
    color: var(--text-primary);
    border: var(--modal-secondary-border);
}

.modal-btn-secondary:hover {
    background: var(--modal-secondary-hover);
}

/* ===== RESPONSIVE GRID: 10 → 5 → 2 → 1 ===== */

/* 10 columns: Extra large screens (1400px+) */
@media (min-width: 1400px) {
    .movies-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 15px;
    }
}

/* 5 columns: Desktop (768px - 1400px) */
@media (max-width: 1400px) {
    .movies-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }
}

/* 2 columns: Tablet (480px - 768px) */
@media (max-width: 768px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .container {
        padding: 15px 20px;
    }
    
    .overlay-content {
        padding: 20px;
        margin: 20px;
    }
    
    .filter-chip {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .masthead-copy h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .quick-categories {
        padding: 12px 15px !important;
    }

    .quick-categories .ios-segmented {
        min-width: 100%;
        gap: 4px;
    }
    
    .quick-categories .ios-segmented__option {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* 1 column: Mobile (under 480px) */
@media (max-width: 480px) {
    .movies-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 15px;
    }
    
    .container {
        padding: 15px;
    }
    
    .movie-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .edit-filters-btn {
        position: fixed;
        top: 15px;
        right: 15px;
        width: auto;
        padding: 8px 16px;
        font-size: 0.8rem;
        z-index: 999;
    }
    
    .filter-chip {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .masthead-copy h1 {
        font-size: 1.7rem;
    }
}
