/* RegionFlix - Complete Styles */

:root {
    --bg: #141414; --bg-alt: #000; --surface: #181818; --surface-hover: #333;
    --border: #404040; --text: #fff; --text-secondary: #b3b3b3; --text-muted: #808080;
    --accent: #e50914; --accent-hover: #f40612; --success: #46d369;
    --radius: 4px; --max-width: 1400px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.4;
    min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }

/* Header */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(0,0,0,0.9); padding: 0 60px; height: 68px;
    display: flex; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.site-header.home-transparent {
    background: transparent; border-bottom: none;
    transition: background 0.3s, border-bottom 0.3s;
}
.site-header.scrolled { background: rgba(0,0,0,0.9); border-bottom: 1px solid rgba(255,255,255,0.04); }
.header-inner { max-width: var(--max-width); margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 28px; font-weight: 900; letter-spacing: -1px; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.logo:hover { color: var(--text); opacity: 0.8; }
.logo .nf { color: var(--accent); }

.nav-link { color: var(--text-secondary); font-size: 14px; font-weight: 400; letter-spacing: 0.3px; transition: color 0.2s; }
.nav-link:hover { color: var(--text); }

.main-content { flex: 1; padding-top: 0; width: 100%; overflow-x: hidden; }

/* Footer */
.site-footer { padding: 40px 60px; text-align: center; font-size: 12px; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.04); }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* Hero */
.home-hero {
    position: relative; min-height: 85vh;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; background: var(--bg-alt);
    margin-top: -68px; padding-top: 68px;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; background: var(--bg-alt); }
.hero-bg-img {
    position: absolute; inset: 0;
    background-image: url(/static/bg.jpg);
    background-size: cover; background-position: center;
    background-repeat: no-repeat; opacity: 1;
    filter: brightness(0.35) saturate(1.0);
}
.hero-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(20,20,20,0.3) 0%, rgba(20,20,20,0.5) 50%, #141414 100%);
}
.hero-overlay::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(229,9,20,0.06) 0%, transparent 70%);
}
.hero-content-center {
    position: relative; z-index: 2;
    width: 100%; max-width: 720px; padding: 0 32px; text-align: center;
}
.hero-badge {
    display: inline-block; font-size: 12px; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--accent); margin-bottom: 20px;
    padding: 4px 14px; border: 1px solid rgba(229,9,20,0.3);
    border-radius: 20px; background: rgba(229,9,20,0.08);
}
.hero-content-center h1 {
    font-size: clamp(36px, 6vw, 64px); font-weight: 900;
    letter-spacing: -2px; line-height: 1.1; margin-bottom: 16px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.hero-content-center .hero-sub {
    font-size: clamp(16px, 2vw, 20px); color: rgba(255,255,255,0.7);
    margin-bottom: 40px; text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

/* Search box */
.search-box { display: flex; gap: 0; max-width: 600px; margin: 0 auto; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 30px rgba(0,0,0,0.4); }
.search-box input {
    flex: 1; padding: 18px 24px; font-size: 17px;
    background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.1);
    border-right: none; color: var(--text); outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.search-box input:focus { border-color: var(--accent); background: rgba(0,0,0,0.85); }
.search-box input::placeholder { color: var(--text-muted); }
.search-box button {
    padding: 18px 36px; font-size: 17px; background: var(--accent);
    color: #fff; border: none; cursor: pointer; font-weight: 700;
    letter-spacing: 1px; transition: background 0.2s;
}
.search-box button:hover { background: var(--accent-hover); }

/* Quick tags */
.quick-tags { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 32px; }
.quick-tag {
    padding: 8px 18px; background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 100px;
    color: rgba(255,255,255,0.6); font-size: 13px; cursor: pointer;
    transition: all 0.25s; white-space: nowrap; backdrop-filter: blur(4px);
}
.quick-tag:hover {
    background: rgba(229,9,20,0.12); border-color: rgba(229,9,20,0.25);
    color: #fff; transform: translateY(-2px);
}

/* Content Rows */
.content-row { padding: 20px 60px 10px; max-width: var(--max-width); margin: 0 auto; width: 100%; }
.content-row h2 {
    font-size: 20px; font-weight: 700; margin-bottom: 12px;
    letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px;
    border-left: 3px solid var(--accent); padding-left: 12px;
}
.row-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none; }
.row-scroll::-webkit-scrollbar { display: none; }
.row-card {
    flex-shrink: 0; width: 180px; height: 270px; position: relative; cursor: pointer;
    border-radius: calc(var(--radius) + 2px); overflow: hidden; scroll-snap-align: start;
    background: var(--surface); border: 1px solid rgba(255,255,255,0.04);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.row-card:hover { transform: scale(1.07); z-index: 10; box-shadow: 0 8px 30px rgba(0,0,0,0.6); }
.row-card img { width: 100%; height: 100%; object-fit: cover; }
.row-card .row-card-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 40px; color: var(--text-muted); background: linear-gradient(135deg, var(--surface), #222);
    flex-direction: column; gap: 4px;
}
.row-card .row-card-label { font-size: 12px; color: var(--text-muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-card .row-card-title {
    position: absolute; bottom: 8px; left: 8px; right: 8px; font-size: 12px; font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-skeleton { display: flex; gap: 8px; }
.row-skeleton .skel-card {
    flex-shrink: 0; width: 180px; height: 270px; border-radius: var(--radius);
    background: linear-gradient(90deg, var(--surface) 0%, #222 50%, var(--surface) 100%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Search Results */
.search-status { padding: 0 60px; max-width: var(--max-width); margin: 0 auto 8px; width: 100%; font-size: 13px; color: var(--text-muted); }
.results-section { padding: 8px 60px 40px; max-width: var(--max-width); margin: 0 auto; width: 100%; }
.results-section h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 8px; }
.result-card {
    position: relative; cursor: pointer; border-radius: var(--radius); overflow: hidden;
    aspect-ratio: 2/3; background: var(--surface); transition: transform 0.3s;
}
.result-card:hover { transform: scale(1.08); z-index: 5; box-shadow: 0 8px 30px rgba(0,0,0,0.6); }
.result-card .card-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-card .card-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 48px; background: linear-gradient(135deg, var(--surface) 0%, var(--surface-hover) 100%); color: var(--text-muted);
}
.result-card .card-info {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 12px 12px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.85) 40%, #000 100%);
    opacity: 0; transition: opacity 0.3s;
}
.result-card:hover .card-info { opacity: 1; }
.card-info .card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-info .card-meta { font-size: 11px; color: var(--text-secondary); display: flex; gap: 6px; align-items: center; }
.card-info .card-rating { color: #f5c518; font-weight: 700; }
.card-info .card-countries { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.no-results { text-align: center; padding: 80px 20px; color: var(--text-secondary); font-size: 18px; }

/* Detail Page */
.detail-page { position: relative; }
.detail-hero { padding: 100px 60px 60px; position: relative; min-height: 500px; display: flex; align-items: flex-end; background-size: cover; background-position: center top; background-repeat: no-repeat; }
.detail-hero .hero-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 0%, rgba(20,20,20,0.8) 30%, rgba(20,20,20,0.4) 60%, rgba(20,20,20,0.2) 100%); }
.detail-hero .hero-content { position: relative; z-index: 2; max-width: var(--max-width); margin: 0 auto; width: 100%; display: flex; gap: 40px; align-items: flex-end; }
.detail-hero .hero-poster { width: 220px; border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,0.5); flex-shrink: 0; }
.detail-hero .hero-info { flex: 1; }
.detail-hero .hero-info h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 800; margin-bottom: 8px; letter-spacing: -1px; text-shadow: 2px 2px 4px rgba(0,0,0,0.6); }
.detail-hero .hero-meta { font-size: 15px; color: var(--text-secondary); display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.detail-hero .hero-meta .meta-dot { width: 4px; height: 4px; background: var(--text-muted); border-radius: 50%; }
.detail-hero .hero-rating { color: #f5c518; font-weight: 700; }
.back-btn { position: fixed; top: 80px; left: 60px; z-index: 100; background: rgba(0,0,0,0.6); border: none; color: var(--text); width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; backdrop-filter: blur(10px); }
.back-btn:hover { background: rgba(255,255,255,0.15); }

/* Countries Section */
.countries-section { padding: 40px 60px 60px; max-width: var(--max-width); margin: 0 auto; width: 100%; }
.countries-section h2 { font-size: 22px; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.3px; }
.countries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.country-card { background: var(--surface); border-radius: var(--radius); padding: 14px 12px; text-align: center; transition: background 0.2s, transform 0.15s; cursor: default; overflow: hidden; position: relative; border: 1px solid rgba(255,255,255,0.04); }
.country-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--success); border-radius: 0 2px 2px 0; }
.country-card:hover { background: var(--surface-hover); transform: translateY(-2px); }
.country-card .flag { font-size: 30px; margin-bottom: 6px; }
.country-card .name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.country-card .code { font-size: 11px; color: var(--text-muted); }
.country-card .audio-info { font-size: 11px; color: var(--text-muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.available-count { font-size: 16px; color: var(--text-muted); margin-bottom: 24px; }
.available-count strong { color: var(--success); font-size: 24px; }

/* Loading / Error */
.loading-placeholder { text-align: center; padding: 60px; color: var(--text-muted); }
.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; margin-right: 10px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-msg { background: rgba(229,9,20,0.15); border: 1px solid rgba(229,9,20,0.3); color: #ff8080; padding: 16px 20px; border-radius: var(--radius); text-align: center; max-width: 500px; margin: 20px auto; }
.retry-btn { display: inline-block; margin-left: 8px; padding: 4px 12px; background: var(--accent); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; }
.retry-btn:hover { background: var(--accent-hover); }

/* Back to Top */
.back-to-top { position: fixed; bottom: 40px; right: 40px; z-index: 999; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; border: none; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(20px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; box-shadow: 0 4px 16px rgba(229,9,20,0.4); }
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--accent-hover); }

/* Responsive */
@media (max-width: 768px) {
    .site-header { padding: 0 20px; }
    .home-hero { min-height: 70vh; }
    .search-box input { padding: 14px 18px; font-size: 15px; }
    .search-box button { padding: 14px 24px; font-size: 15px; }
    .content-row { padding: 16px 20px 8px; }
    .row-card { width: 140px; height: 210px; }
    .row-skeleton .skel-card { width: 140px; height: 210px; }
    .search-status { padding: 0 20px; }
    .results-section { padding: 8px 20px 30px; }
    .results-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .detail-hero { padding: 80px 20px 30px; min-height: 380px; }
    .detail-hero .hero-content { flex-direction: column; align-items: center; gap: 20px; }
    .detail-hero .hero-poster { width: 160px; }
    .detail-hero .hero-info h1 { font-size: 26px; text-align: center; }
    .detail-hero .hero-meta { justify-content: center; }
    .countries-section { padding: 20px 20px 40px; }
    .countries-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .back-btn { top: 72px; left: 16px; }
    .back-to-top { bottom: 20px; right: 20px; width: 42px; height: 42px; font-size: 18px; }
}
