/* =============================================================
   ANIWEEK — main.css  (tokens · reset · header · nav · footer)
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg:           #0a0a0f;
  --bg-surface:   #12121a;
  --bg-raised:    #1a1a28;
  --bg-card:      #15151e;

  --accent:       #7c3aed;
  --accent-light: #9d5cf5;
  --accent-glow:  rgba(124,58,237,.35);
  --cyan:         #06b6d4;
  --cyan-glow:    rgba(6,182,212,.3);
  --green:        #10b981;
  --green-glow:   rgba(16,185,129,.4);
  --amber:        #f59e0b;

  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #475569;

  --border:       rgba(255,255,255,.06);
  --border-hi:    rgba(255,255,255,.12);
  --glass:        rgba(18,18,26,.75);

  --r-sm:  3px;
  --r-md:  6px;
  --r-lg:  9px;
  --r-xl:  12px;
  --r-2xl: 18px;

  --ease: cubic-bezier(.4,0,.2,1);
  --fast: 150ms;
  --base: 250ms;
  --slow: 400ms;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--accent-light); }
img { display: block; max-width: 100%; }

/* ── SITE HEADER ─────────────────────────────────────────────── */
.site-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: 28px 0 20px;
}

/* Aurora orbs */
.aurora-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .14;
  animation: aurora 10s ease-in-out infinite;
}
.aurora-1 { width: 550px; height: 380px; background: radial-gradient(#7c3aed, transparent); top: -160px; left: -80px; animation-delay: 0s; }
.aurora-2 { width: 480px; height: 300px; background: radial-gradient(#06b6d4, transparent); top: -80px; right: 80px;  animation-delay: 3.5s; }
.aurora-3 { width: 350px; height: 220px; background: radial-gradient(#7c3aed, #06b6d4, transparent); bottom: -80px; left: 42%; animation-delay: 1.8s; }
@keyframes aurora {
  0%,100% { transform: translate(0,0) scale(1); }
  40%      { transform: translate(25px,-18px) scale(1.06); }
  70%      { transform: translate(-15px,10px) scale(.94); }
}

.header-content {
  position: relative; z-index: 1;
  max-width: 1680px; margin: 0 auto;
  padding: 0 32px;
}
.header-top {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name {
  font-size: 21px; font-weight: 800; letter-spacing: -.5px;
  background: linear-gradient(135deg,#f1f5f9 0%,#a78bfa 50%,#06b6d4 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.logo-tagline { font-size: 10px; font-weight: 400; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; }

/* Nav */
.main-nav {
  display: flex; gap: 3px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px;
  backdrop-filter: blur(12px);
}
.nav-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  transition: all var(--base) var(--ease);
  position: relative;
}
.nav-btn:hover { color: var(--text); background: var(--bg-raised); }
.nav-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 14px var(--accent-glow);
}
.nav-btn svg {
  flex-shrink: 0;
}
.watchlist-badge {
  display: none; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--cyan); color: var(--bg); font-size: 11px; font-weight: 700;
  border-radius: 999px;
}
.watchlist-badge.show { display: flex; }

/* Search */
.search-wrapper { position: relative; margin-left: auto; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-input {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 999px; padding: 9px 16px 9px 36px;
  color: var(--text); font-family: inherit; font-size: 13.5px;
  width: 230px; transition: all var(--base) var(--ease);
  backdrop-filter: blur(10px);
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus {
  outline: none; border-color: var(--accent); width: 290px;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Header meta row */
.header-meta {
  margin-top: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.week-label { font-size: 14px; font-weight: 500; color: var(--text-2); }
.live-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--green);
}
.live-dot-anim {
  display: block; width: 7px; height: 7px;
  background: var(--green); border-radius: 50%;
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px var(--green); }
  50%      { opacity: .6; transform: scale(.85); box-shadow: 0 0 2px var(--green); }
}
.tz-badge {
  font-size: 11px; color: var(--text-3); padding: 3px 9px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 999px;
}



/* ── GENRE FILTER BAR ────────────────────────────────────────── */
.filter-bar {
  max-width: 1680px; margin: 0 auto;
  padding: 0 32px 14px;
}
.filter-scroll {
  display: flex; gap: 7px;
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: 4px;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.genre-chip {
  padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-2);
  white-space: nowrap; transition: all var(--fast) var(--ease); flex-shrink: 0;
}
.genre-chip:hover { border-color: var(--border-hi); color: var(--text); background: var(--bg-surface); }
.genre-chip.active {
  background: linear-gradient(135deg, var(--accent), #5b21b6);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* ── STATS BAR ───────────────────────────────────────────────── */
.stats-bar {
  max-width: 1680px; margin: 0 auto 16px;
  padding: 0 32px;
  display: flex; gap: 24px; flex-wrap: wrap;
}
.stat {
  display: flex; flex-direction: column;
  padding: 10px 18px; border-radius: var(--r-lg);
  background: var(--bg-surface); border: 1px solid var(--border);
}
.stat-n { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-l { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }

/* ── ERROR / EMPTY ───────────────────────────────────────────── */
.error-box, .empty-state {
  max-width: 400px; margin: 40px auto; text-align: center;
  padding: 32px 24px; border-radius: var(--r-lg);
  background: var(--bg-surface); border: 1px solid var(--border);
}
.error-emoji, .empty-emoji { font-size: 40px; margin-bottom: 12px; }
.error-box h2, .empty-state h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.error-box p, .empty-state p { font-size: 13px; color: var(--text-2); margin-bottom: 16px; }
.btn-retry {
  padding: 10px 24px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--accent), #5b21b6);
  color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: transform var(--fast) var(--ease);
}
.btn-retry:hover { transform: translateY(-1px); }

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.8); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fade-in var(--base) var(--ease);
}
.modal-box {
  background: var(--bg-raised); border: 1px solid var(--border-hi);
  border-radius: var(--r-xl); width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  position: relative; animation: slide-up var(--base) var(--ease);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.modal-close-btn {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  transition: all var(--fast) var(--ease);
}
.modal-close-btn:hover { background: var(--bg-raised); color: var(--text); border-color: var(--border-hi); }

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 32px; margin-top: 48px;
}
.footer-inner {
  max-width: 1680px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-3);
}
.footer-sep { opacity: .4; }
.footer-note { color: var(--text-3); }

/* ── BOTTOM NAV (mobile app-style) ──────────────────────────── */
.bottom-nav { display: none; }  /* desktop: hidden */

/* ── MOBILE SEARCH PANEL ─────────────────────────────────────── */
.mobile-search-panel {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10,10,15,.98);
  backdrop-filter: blur(12px);
  padding: 16px;
  overflow-y: auto;
}
.mobile-search-inner { 
  width: 100%; 
  max-width: 600px;
  margin: 0 auto;
}
.mobile-search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-raised);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 9px 8px 9px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  position: sticky;
  top: 0;
  z-index: 10;
}
.mobile-search-results {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 80px;
  width: 100%;
}
/* Force horizontal layout for cards in search */
.mobile-search-results .anime-card {
  opacity: 1 !important;
  transform: none !important;
  display: flex !important;
  flex-direction: row !important;
  width: 100%;
  height: 120px;
  background: var(--bg-surface);
  border-color: var(--border);
  overflow: hidden;
}
.mobile-search-results .card-cover {
  width: 90px !important;
  height: 100% !important;
  flex-shrink: 0;
}
.mobile-search-results .card-body {
  flex: 1;
  padding: 10px 12px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.mobile-search-results .card-title {
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-search-results .card-genres,
.mobile-search-results .stream-bar {
  display: none !important; /* Hide extra clutter in list view */
}
.mobile-search-results .pin-btn {
  top: 6px; right: 6px;
  opacity: 1 !important;
}
.mobile-search-bar > svg { color: var(--text-3); flex-shrink: 0; width: 16px; height: 16px; }
.mobile-search-input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  font-family: inherit; font-size: 15px; color: var(--text);
  line-height: 1;
}
.mobile-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.mobile-search-input::placeholder { color: var(--text-3); }
/* X button — small circle inside the pill on the right */
.mobile-search-close-btn {
  flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.mobile-search-close-btn:hover { background: rgba(255,255,255,.18); color: var(--text); }
.mobile-search-close-btn svg { width: 14px; height: 14px; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { padding-bottom: 74px; }   /* room for bottom nav */

  /* Header */
  .header-content { padding: 0 16px; }
  .header-top { flex-wrap: wrap; gap: 10px; }
  .main-nav { display: none; }      /* bottom nav replaces this */
  .search-wrapper { display: none; } /* search is in bottom nav */

  /* Logo */
  .logo-tagline { display: none; }
  .logo-name { font-size: 19px; }
  .logo-icon { width: 30px; height: 30px; }

  /* Header meta */
  .header-meta { gap: 10px; flex-wrap: wrap; }
  .week-label { font-size: 13px; }

  /* Stats */
  .stats-bar {
    padding: 0 16px 12px;
    gap: 10px;
  }
  .stat { flex: 1; min-width: 0; padding: 10px 12px; }
  .stat-n { font-size: 20px; }
  .stat-l { font-size: 10px; }

  /* Filter bar */
  .filter-bar { padding: 0 16px 12px; }

  /* Footer */
  .site-footer { padding: 16px; margin-top: 24px; }
  .footer-inner { font-size: 12px; gap: 6px; flex-wrap: wrap; }

  /* Bottom nav */
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: rgba(18,18,26,.95);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(20px);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    gap: 0;
  }
  .bnav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 4px; padding: 6px 12px; position: relative;
    color: var(--text-3); font-size: 11px; font-weight: 500;
    border-radius: 0; transition: color var(--fast) var(--ease);
  }
  .bnav-item svg { transition: transform var(--fast) var(--ease); }
  .bnav-item:hover { color: var(--text-2); }
  .bnav-item.active { color: var(--accent-light); }
  .bnav-item.active svg { transform: scale(1.1); }
  .bnav-badge {
    display: none; position: absolute; top: 4px; left: 50%;
    transform: translateX(6px);
    min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--cyan); color: var(--bg); font-size: 10px;
    font-weight: 700; border-radius: 999px; align-items: center;
    justify-content: center;
  }
  .bnav-badge.show { display: flex; }
}

@media (max-width: 520px) {
  .site-header { padding: 12px 0 8px; }
  .header-top { justify-content: space-between; }
  .header-meta { margin-top: 8px; }
}

