/* =========================================================
   48ST Fan Hub - CSS with Dark/Light Theme Support
   ========================================================= */

/* Light Theme (Default) */
:root {
  --red: #e0102b;
  --red-dark: #b70c22;
  --red-light: #fff0f1;
  --gold: #f5c344;
  --gold-dark: #d9a520;
  --ink: #17151a;
  --muted: #6b6670;
  --line: #ece7ea;
  --bg: #fafafa;
  --card: #ffffff;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(23,21,26,0.08);
  --shadow-lg: 0 16px 40px rgba(23,21,26,0.12);
  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --header-h: 68px;
  --content-max: 1180px;
}

/* Dark Theme */
[data-theme="dark"] {
  --red: #ff3b5c;
  --red-dark: #e0102b;
  --red-light: #2a1520;
  --gold: #ffd666;
  --gold-dark: #f5c344;
  --ink: #f0f0f0;
  --muted: #a0a0a0;
  --line: #333333;
  --bg: #121212;
  --card: #1e1e1e;
  --shadow: 0 6px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.4);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 84px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--red); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  height: var(--header-h);
  padding: 0 20px;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .topbar {
  background: rgba(30,30,30,.92);
}

.topbar .brand { display: flex; align-items: center; gap: 8px; }
.topbar .brand h1 { font-family: var(--font-display); font-size: 21px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.topbar .brand .accent { color: var(--red); }
.topbar .brand svg { display: block; flex-shrink: 0; }

/* Inline nav links */
.nav-links {
  display: none;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--red-light); color: var(--red); }
.nav-links a.active { background: var(--red-light); color: var(--red); }

.topbar .actions { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--red-light);
}
.btn-ghost-icon {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: color .15s ease, border-color .15s ease, background-color 0.3s ease;
}
.btn-ghost-icon:hover { color: var(--red); border-color: var(--red-light); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: none;
  font-weight: 600; font-size: 15px; transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 8px 18px rgba(224,16,43,0.28); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--red); border: 1.5px solid var(--red); }

[data-theme="dark"] .btn-outline {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}

.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--red) 0%, #8f0a1e 100%);
  color: #fff; padding: 44px 20px 40px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; top: -40%; right: -12%;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,195,68,.32) 0%, rgba(245,195,68,0) 70%);
}
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 700; opacity: .8; margin-bottom: 10px;
}
.hero h2 { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1.25; margin: 0 0 12px; }
.hero p { font-size: 14px; opacity: .88; margin: 0 0 22px; max-width: 520px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-primary { background: #fff; color: var(--red); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.hero-actions .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,.12); }

/* ---------- Sections ---------- */
.section { padding: 28px 20px; max-width: var(--content-max); margin: 0 auto; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-head h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 0; display: flex; align-items: center; }
.see-all { font-size: 13px; font-weight: 600; color: var(--red); }

/* ---------- News cards ---------- */
.news-scroll { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.news-scroll::-webkit-scrollbar { display: none; }
.news-card {
  flex: 0 0 260px; scroll-snap-align: start;
  background: var(--card); border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--line); transition: box-shadow .2s ease, transform .15s ease, background-color 0.3s ease;
}
.news-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.news-card .body { padding: 16px; }
.news-card .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--red); letter-spacing: .5px; }
.news-card h4 { font-size: 15px; font-weight: 700; margin: 8px 0 10px; line-height: 1.35; }
.news-card .date { font-size: 12px; color: var(--muted); }

/* ---------- Show cards ---------- */
.show-card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.show-card {
  background: var(--card); border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--line); transition: box-shadow .2s ease, transform .15s ease, background-color 0.3s ease;
}
.show-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.show-card .poster-wrap { position: relative; background: var(--line); aspect-ratio: 16/9; overflow: hidden; }
.show-card .poster-wrap img { width: 100%; height: 100%; object-fit: cover; }
.team-pill-corner {
  position: absolute; top: 10px; left: 10px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 5px;
  backdrop-filter: blur(6px);
}
.team-LOVE { background: rgba(224,16,43,.85); }
.team-DREAM { background: rgba(37,99,235,.85); }
.team-PASSION { background: rgba(217,119,6,.85); }
.team-TRAINEE { background: rgba(107,102,112,.85); }
.team-JKT48 { background: rgba(23,21,26,.75); }

.show-card .body { padding: 16px; }
.show-card h4 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.datetime-row { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.datetime-row span { display: flex; align-items: center; gap: 5px; }

.member-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.member-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  background: var(--red-light); font-size: 12px; font-weight: 600; color: var(--red);
}
.member-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.member-chip.is-birthday { background: linear-gradient(135deg, #fff7e6 0%, #fff0f1 100%); border: 1px solid var(--gold); }
.birthday-cake-icon { width: 14px; height: 14px; color: var(--gold); }

.show-status-row { padding-top: 8px; border-top: 1px solid var(--line); }
.status-text { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.status-text.ongoing { color: var(--red); }
.status-text.finished { color: var(--muted); }

.mini-countdown { display: flex; align-items: center; gap: 4px; }
.mini-countdown .u { text-align: center; }
.mini-countdown .n { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--red); line-height: 1; }
.mini-countdown .l { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-top: 2px; }
.mini-countdown .sep { font-size: 16px; font-weight: 700; color: var(--muted); margin: 0 2px; }

/* ---------- Simple list ---------- */
.simple-list { display: flex; flex-direction: column; gap: 2px; }
.simple-list-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border-radius: var(--radius-md);
  transition: background .15s ease;
}
.simple-list-item:hover { background: var(--red-light); }
.thumb-slot { flex-shrink: 0; width: 52px; }
.date-box {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  background: var(--red-light); display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--red);
}
.date-box .d { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1; }
.date-box .m { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.content { flex: 1; min-width: 0; }
.content h4 { font-size: 15px; font-weight: 600; margin: 0; line-height: 1.4; }
.meta-row { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.meta-row span { display: flex; align-items: center; gap: 5px; }

.type-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.type-SHOW { background: var(--red-light); color: var(--red); }
.type-EXCLUSIVE { background: #eef6ff; color: #2563eb; }
.type-EVENT { background: #f0fdf4; color: #16a34a; }
.type-OTHER { background: var(--red-light); color: var(--red); }

[data-theme="dark"] .type-EXCLUSIVE { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .type-EVENT { background: #14532d; color: #4ade80; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; border: 1px solid var(--line);
  transition: all .15s ease;
}
.tab:hover { color: var(--red); border-color: var(--red-light); }
.tab.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ---------- Filters ---------- */
.simple-filter-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.simple-filter-row button {
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--muted); border: 1px solid var(--line); background: var(--card);
  transition: all .15s ease;
}
.simple-filter-row button:hover { color: var(--red); border-color: var(--red-light); }
.simple-filter-row button.active { background: var(--red); color: #fff; border-color: var(--red); }

.mini-filter-row { display: flex; gap: 10px; margin-bottom: 18px; }
.mini-filter-row select {
  flex: 1; padding: 10px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  font-size: 13px; background: var(--card); color: var(--ink);
  appearance: none;
}

/* ---------- Load more ---------- */
.load-more-arrow {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius-md);
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 600;
  transition: all .15s ease; margin-top: 16px;
}
.load-more-arrow:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: var(--radius-lg);
  padding: 32px 28px; border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.auth-card .logo { text-align: center; margin-bottom: 20px; }
.auth-card h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; text-align: center; margin: 0 0 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  font-size: 14px; background: var(--bg); color: var(--ink);
  transition: border-color .15s ease, background-color 0.3s ease;
}
.field input::placeholder { color: var(--muted); }
.field input:focus { outline: none; border-color: var(--red); }

.form-msg { font-size: 13px; margin-bottom: 14px; padding: 10px 12px; border-radius: var(--radius-sm); display: none; }
.form-msg.error { display: block; background: #fdeceb; color: #b3261e; }
.form-msg.success { display: block; background: #e8f8ee; color: #1a8a45; }

[data-theme="dark"] .form-msg.error { background: #3d1a1a; color: #fca5a5; }
[data-theme="dark"] .form-msg.success { background: #1a3d2a; color: #86efac; }

.auth-switch { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 18px; }
.auth-switch a { color: var(--red); font-weight: 700; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .bottom-nav {
  background: rgba(30,30,30,.96);
}

.bottom-nav a {
  position: relative;
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: var(--muted); font-weight: 600; padding: 6px 0;
  transition: color .15s ease;
}
.bottom-nav a.active { color: var(--red); }
.bottom-nav a.active::before {
  content: "";
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,195,68,.55) 0%, rgba(245,195,68,0) 72%);
}
.bottom-nav svg { width: 22px; height: 22px; }

/* ---------- Profile ---------- */
.profile-header {
  display: flex; align-items: center; gap: 18px;
  padding: 28px 20px; max-width: var(--content-max); margin: 0 auto;
}
.profile-header .avatar-wrap { position: relative; flex-shrink: 0; }
.profile-header .avatar-lg {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--red-light); background: var(--line);
}
.profile-header .avatar-edit-btn {
  position: absolute; bottom: -2px; right: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--red); color: #fff; border: 3px solid var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.profile-header h2 { margin: 0 0 4px; font-size: 20px; font-family: var(--font-display); }
.profile-header .email { font-size: 13px; color: var(--muted); }

.settings-section { max-width: var(--content-max); margin: 0 auto; padding: 24px 20px; }
.settings-section h3 { font-family: var(--font-display); font-size: 16px; margin: 0 0 12px; }
.settings-list {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow); margin-bottom: 22px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  font-size: 14.5px; font-weight: 500;
  transition: background-color 0.3s ease;
}
.settings-row:last-child { border-bottom: none; }
.settings-row .row-left { display: flex; align-items: center; gap: 12px; }
.settings-row .row-left i { width: 18px; color: var(--red); font-size: 15px; }
.settings-row .row-right { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.settings-row.clickable { cursor: pointer; transition: background .15s ease; }
.settings-row.clickable:hover { background: var(--red-light); }
.settings-row.danger .row-left i, .settings-row.danger .row-left { color: var(--red-dark); }

.inline-form { padding: 4px 18px 16px; border-bottom: 1px solid var(--line); }
.inline-form .field { margin-bottom: 12px; }
.inline-form .field:last-of-type { margin-bottom: 14px; }

/* Avatar picker modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(23,21,26,.55); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  background: var(--card); width: 100%; max-width: 460px;
  border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 82vh; overflow-y: auto;
  transition: background-color 0.3s ease;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: var(--radius-lg); }
}
.modal-sheet h4 { font-family: var(--font-display); font-size: 17px; margin: 0 0 16px; display: flex; align-items: center; justify-content: space-between; }
.modal-sheet .close-btn { background: none; border: none; font-size: 18px; color: var(--muted); }
.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.avatar-grid button {
  background: none; border: 3px solid transparent; border-radius: 50%; padding: 0; overflow: hidden;
}
.avatar-grid button.selected { border-color: var(--red); }
.avatar-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: var(--line); }

.logout-btn {
  width: 100%; padding: 14px; border-radius: var(--radius-md); border: 1.5px solid #fdeceb;
  background: #fff; color: var(--red-dark); font-weight: 700; font-size: 14.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.logout-btn:hover { background: #fdeceb; }

[data-theme="dark"] .logout-btn {
  background: #3d1a1a;
  border-color: #5c2a2a;
  color: #fca5a5;
}

/* ---------- Empty / loading ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px; }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-md); }

[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #2a2a2a 25%, #333333 37%, #2a2a2a 63%); }

@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Responsive: tablet ---------- */
@media (min-width: 640px) {
  .news-scroll { display: grid; grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .news-card { flex: unset; }
}

/* ---------- Responsive: desktop ---------- */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .nav-links { display: flex; }
  .bottom-nav { display: none; }
  .hero { border-radius: 0 0 32px 32px; padding: 56px 20px 48px; }
  .hero .container { max-width: 640px; }
  .hero h2 { font-size: 36px; }
  .hero p { font-size: 15.5px; }
  .section { padding: 40px 20px; }
  .section-head h3 { font-size: 21px; }
  .news-scroll { grid-template-columns: repeat(3, 1fr); }
  .schedule-list-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .auth-card { max-width: 420px; box-shadow: var(--shadow-lg); }
}

@media (min-width: 1280px) {
  .news-scroll { grid-template-columns: repeat(4, 1fr); }
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.nav-links a, .bottom-nav a{
  display:flex;
  align-items:center;
  gap:6px;
}
.bottom-nav a{
  flex-direction:column;
  gap:2px;
}
.brand-logo{
  width:34px;
  height:34px;
  object-fit:contain;
  display:block;
}
