/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0d14;
  --bg2:       #13131f;
  --bg3:       #1a1a2e;
  --surface:   #1e1e30;
  --surface2:  #252540;
  --border:    #2e2e4a;
  --text:      #e8e8f0;
  --text-muted:#8888aa;
  --accent1:   #7c3aed;
  --accent2:   #2563eb;
  --accent-g:  linear-gradient(135deg, #7c3aed, #2563eb);
  --green:     #22c55e;
  --yellow:    #eab308;
  --blue:      #3b82f6;
  --gray:      #6b7280;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --font:      'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3 { line-height: 1.2; }

/* ── Layout ── */
.container { width: min(1200px, 100%); margin-inline: auto; padding-inline: 1.25rem; }

/* ── Header ── */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(13,13,20,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-block: .875rem; }

.logo { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.5px; }
.logo-icon { font-size: 1.3rem; background: var(--accent-g); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-dot { background: var(--accent-g); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav a { color: var(--text-muted); font-size: .9rem; font-weight: 500; transition: color .2s; }
.nav a:hover { color: var(--text); }
.lang-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: .3rem .85rem; font-size: .82rem; transition: background .2s; }
.lang-btn:hover { background: var(--surface2); color: var(--text); }

/* ── Hero ── */
.hero { position: relative; padding: 5rem 0 4rem; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124,58,237,.18) 0%, transparent 70%), radial-gradient(ellipse 60% 40% at 80% 100%, rgba(37,99,235,.12) 0%, transparent 60%); pointer-events: none; }
.hero-content { position: relative; text-align: center; }

.hero-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; letter-spacing: -1.5px; margin-bottom: .75rem; }
.gradient-text { background: var(--accent-g); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2.5rem; max-width: 560px; margin-inline: auto; }

/* ── Search ── */
.search-form { position: relative; max-width: 680px; margin-inline: auto; }
.search-form--compact { max-width: 100%; margin-bottom: 1.25rem; }

.search-box { display: flex; align-items: center; background: var(--surface); border: 1.5px solid var(--border); border-radius: 50px; padding: .35rem .35rem .35rem 1.25rem; gap: .5rem; transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: var(--accent1); box-shadow: 0 0 0 3px rgba(124,58,237,.2); }

.search-icon { font-size: 1.1rem; flex-shrink: 0; }
.search-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: var(--font); font-size: 1rem; min-width: 0; }
.search-input::placeholder { color: var(--text-muted); }

.search-btn { background: var(--accent-g); color: #fff; border: none; border-radius: 40px; padding: .6rem 1.5rem; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: opacity .2s, transform .15s; }
.search-btn:hover { opacity: .9; transform: translateY(-1px); }
.search-btn:active { transform: translateY(0); }

/* ── Autocomplete ── */
.autocomplete-list { position: absolute; top: calc(100% + .5rem); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); z-index: 50; }
.autocomplete-list.hidden { display: none; }
.autocomplete-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; cursor: pointer; transition: background .15s; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--surface2); }
.autocomplete-item img { width: 32px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.autocomplete-item-info { flex: 1; min-width: 0; }
.autocomplete-title { font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.autocomplete-meta { font-size: .78rem; color: var(--text-muted); }

/* ── Platform pills (hero) ── */
.platform-logos { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 2rem; }
.platform-pill { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: .3rem .85rem; font-size: .8rem; color: var(--text-muted); }

/* ── Features ── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; padding-block: 3rem; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; }
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; }
.feature-card p { color: var(--text-muted); font-size: .9rem; }

/* ── Results ── */
.results-page { padding-block: 2rem; }
.results-header { margin-bottom: 1.5rem; }
.results-count { color: var(--text-muted); font-size: .9rem; margin-top: .75rem; }
.results-count strong { color: var(--text); }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1rem; }

.result-card { display: flex; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .875rem; transition: border-color .2s, transform .15s, box-shadow .2s; }
.result-card:hover { border-color: var(--accent1); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124,58,237,.15); }

.result-poster { position: relative; flex-shrink: 0; width: 80px; }
.result-poster img { width: 80px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); }
.poster-placeholder { width: 80px; height: 120px; background: var(--bg3); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.poster-placeholder--lg { width: 100%; height: 300px; font-size: 4rem; }

.media-badge { position: absolute; bottom: 4px; left: 4px; background: rgba(0,0,0,.75); backdrop-filter: blur(4px); color: #fff; font-size: .65rem; font-weight: 700; padding: .15rem .4rem; border-radius: 4px; text-transform: uppercase; letter-spacing: .3px; }
.media-badge--lg { position: static; font-size: .75rem; padding: .25rem .65rem; border-radius: 20px; }

.result-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.result-title { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-year { font-size: .8rem; color: var(--text-muted); }
.result-rating { display: flex; align-items: center; gap: .25rem; font-size: .85rem; }
.star { color: var(--yellow); }
.result-overview { font-size: .82rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Detail page ── */
.detail-page { position: relative; }
.detail-backdrop { position: absolute; top: 0; left: 0; right: 0; height: 480px; background-size: cover; background-position: center top; }
.backdrop-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(13,13,20,.6) 0%, var(--bg) 100%); }

.detail-content { position: relative; padding-top: 2.5rem; padding-bottom: 3rem; }
.detail-main { display: grid; grid-template-columns: 260px 1fr; gap: 2.5rem; align-items: start; }

@media (max-width: 700px) {
  .detail-main { grid-template-columns: 1fr; }
  .detail-poster { display: flex; justify-content: center; }
  .detail-backdrop { height: 300px; }
}

.poster-img { width: 260px; border-radius: var(--radius); box-shadow: 0 8px 40px rgba(0,0,0,.6); }

.detail-badges { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.year-badge { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: .2rem .65rem; font-size: .8rem; color: var(--text-muted); }

.detail-title { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 900; letter-spacing: -.5px; margin-bottom: .5rem; }
.detail-tagline { color: var(--text-muted); font-style: italic; margin-bottom: 1rem; }

.detail-rating { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; }
.star-lg { color: var(--yellow); font-size: 1.4rem; }
.rating-value { font-size: 1.5rem; font-weight: 800; }
.rating-max { color: var(--text-muted); font-size: .9rem; }
.rating-count { color: var(--text-muted); font-size: .82rem; }

.genres { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.genre-tag { background: var(--surface2); border-radius: 20px; padding: .25rem .75rem; font-size: .8rem; }

.detail-section { margin-bottom: 1.75rem; }
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .875rem; color: var(--text); }
.detail-overview { color: var(--text-muted); line-height: 1.8; }

/* ── Providers ── */
.provider-group { margin-bottom: 1.25rem; }
.provider-group-title { margin-bottom: .6rem; }

.providers-list { display: flex; flex-direction: column; gap: .5rem; }
.provider-item { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .65rem 1rem; }
.provider-logo { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.provider-name { flex: 1; font-weight: 500; font-size: .95rem; }
.provider-price { font-weight: 700; font-size: .95rem; color: var(--text); }

/* Provider badges */
.provider-badge, .provider-type-badge {
  display: inline-block; border-radius: 20px; padding: .2rem .65rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.provider-badge--green, .badge-green { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.provider-badge--yellow, .badge-yellow { background: rgba(234,179,8,.15); color: var(--yellow); border: 1px solid rgba(234,179,8,.3); }
.provider-badge--blue, .badge-blue { background: rgba(59,130,246,.15); color: var(--blue); border: 1px solid rgba(59,130,246,.3); }
.provider-badge--gray, .badge-gray { background: rgba(107,114,128,.15); color: #9ca3af; border: 1px solid rgba(107,114,128,.3); }

.not-available { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; color: var(--text-muted); }
.not-available-icon { font-size: 1.5rem; }

.justwatch-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--accent2); font-size: .85rem; margin-top: .5rem; transition: color .2s; }
.justwatch-link:hover { color: #60a5fa; }

.credits-line { font-size: .88rem; color: var(--text-muted); }
.credits-line strong { color: var(--text); }

/* ── Blog ── */
.blog-page, .blog-post-page { padding-block: 2.5rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; font-weight: 800; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.blog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color .2s, transform .15s; display: flex; flex-direction: column; }
.blog-card:hover { border-color: var(--accent1); transform: translateY(-2px); }
.blog-card-img img { width: 100%; height: 200px; object-fit: cover; }
.blog-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.blog-date { font-size: .78rem; color: var(--text-muted); }
.blog-card-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.blog-card-excerpt { font-size: .85rem; color: var(--text-muted); flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { font-size: .82rem; color: var(--accent2); font-weight: 600; margin-top: auto; }

/* Blog post */
.blog-article { max-width: 760px; margin-inline: auto; }
.article-hero-img { border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.article-hero-img img { width: 100%; max-height: 400px; object-fit: cover; }
.article-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; font-size: .85rem; color: var(--text-muted); }
.article-rating { color: var(--yellow); }
.article-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 900; margin-bottom: .75rem; letter-spacing: -.5px; }
.article-excerpt { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.7; }
.article-platforms { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.5rem; font-size: .9rem; }
.article-body { color: var(--text-muted); line-height: 1.85; font-size: .97rem; }
.article-body h2, .article-body h3 { color: var(--text); margin: 1.5rem 0 .75rem; }
.article-body p { margin-bottom: 1rem; }
.article-cta { margin: 2rem 0; text-align: center; }
.article-keywords { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.keyword-tag { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: .15rem .5rem; font-size: .72rem; color: var(--text-muted); }
.back-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-muted); font-size: .88rem; margin-top: 2rem; transition: color .2s; }
.back-link:hover { color: var(--text); }

/* ── Buttons ── */
.btn-primary { display: inline-block; background: var(--accent-g); color: #fff; border-radius: 40px; padding: .7rem 1.75rem; font-size: .95rem; font-weight: 600; transition: opacity .2s, transform .15s; }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); padding-block: 1.5rem; text-align: center; }
.site-footer p { font-size: .82rem; color: var(--text-muted); }
.site-footer a { color: var(--text-muted); text-decoration: underline; }
.footer-disclaimer { margin-top: .4rem; font-size: .74rem; opacity: .6; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero { padding: 3rem 0 2.5rem; }
  .search-btn { padding: .55rem 1rem; font-size: .82rem; }
  .results-grid { grid-template-columns: 1fr; }
  .nav a:not(.lang-btn) { display: none; }
}
