/* =========================================================
   Where to Watch — shared styles for every page (base.html)
   Page-specific styles live in each template's {% block extra_css %}.
   ========================================================= */

:root {
    --bg-main: #050511;
    --bg-secondary: #0c1020;
    --bg-card: rgba(255, 255, 255, 0.04);
    --accent-cyan: #35f5ff;
    --accent-magenta: #ff3af2;
    --accent-purple: #9b5bff;
    --text-main: #f5f5f5;
    --text-muted: #a2a2b5;
    --border-soft: rgba(255, 255, 255, 0.1);
    --radius-lg: 18px;
    --shadow-neon: 0 0 18px rgba(53, 245, 255, 0.45);
    --gradient: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
    --gradient-button: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top, #151530 0, #050511 45%, #020208 100%) fixed;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a { color: var(--accent-cyan); }
img { max-width: 100%; }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Header ---------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 16px clamp(16px, 4vw, 40px);
    border-bottom: 1px solid var(--border-soft);
    background: rgba(5, 5, 17, 0.75);
    backdrop-filter: blur(8px);
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 10;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    white-space: nowrap;
}
.site-logo-icon { display: block; border-radius: 8px; flex: 0 0 auto; }
.site-logo-text {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.04em;
}
.site-logo:hover .site-logo-icon { filter: drop-shadow(0 0 8px rgba(53, 245, 255, 0.6)); }

.header-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 999px;
    transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--accent-cyan); background: rgba(255, 255, 255, 0.04); }

/* ---------- Search form (header + home hero) ---------- */
.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(8, 10, 25, 0.9);
    padding: 6px 6px 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 0 14px rgba(9, 255, 215, 0.18);
    max-width: 100%;
}

.search-form input[type="search"] {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.95rem;
    width: 220px;
    min-width: 0;
    flex: 1;
}
.search-form input::placeholder { color: var(--text-muted); }

.region-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml;utf8,<svg fill='%2335f5ff' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'><polygon points='0,0 20,0 10,12'/></svg>") no-repeat right 10px center / 10px;
    border: 1px solid rgba(53, 245, 255, 0.3);
    border-radius: 999px;
    padding: 7px 28px 7px 12px;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    cursor: pointer;
    max-width: 170px;
}
.region-select:focus { outline: none; border-color: var(--accent-cyan); box-shadow: var(--shadow-neon); }
.region-select option { background: var(--bg-secondary); color: var(--text-main); }

.btn {
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--gradient-button);
    color: #050511;
    cursor: pointer;
    box-shadow: var(--shadow-neon);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 22px rgba(53, 245, 255, 0.7); }

/* ---------- Main ---------- */
.site-main {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px);
}

.panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 30px rgba(53, 245, 255, 0.15);
    padding: clamp(20px, 4vw, 40px);
}

.page-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    margin: 0 0 8px;
}

.muted { color: var(--text-muted); }

.error {
    background-color: rgba(229, 9, 20, 0.18);
    color: #ffb3b3;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #e50914;
    margin: 0 0 16px;
}

.back-link {
    display: inline-block;
    color: var(--accent-cyan);
    text-decoration: none;
    margin-bottom: 20px;
}
.back-link:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
    padding: 24px clamp(16px, 4vw, 40px) calc(24px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent-cyan); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
    .site-header { justify-content: center; }
    .header-right { width: 100%; justify-content: center; }
    .site-header .search-form { width: 100%; }
    .search-form input[type="search"] { width: auto; }
    .region-select { max-width: 120px; }
}
