/* ==========================================================
   REIKURO ANIME - style.css
   Fondasi: token, reset, layout, header, navigasi,
   dan komponen dasar yang dipakai frontend + admin.
   ========================================================== */

:root {
  --bg: #070B14;
  --bg-2: #0D1424;
  --card: #111C30;
  --primary: #00A8FF;
  --secondary: #1677FF;
  --accent: #38BDF8;
  --text: #F1F5F9;
  --text-2: #94A3B8;
  --border: #1E3554;
  --danger: #F87171;
  --success: #34D399;

  --grad: linear-gradient(135deg, #00A8FF 0%, #1677FF 100%);
  --glow: 0 0 18px rgba(0, 168, 255, .35);
  --glow-soft: 0 0 12px rgba(0, 168, 255, .22);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);

  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 60px;
  --bottom-nav-h: 64px;
  --ease: .2s ease;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg, video, iframe { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(0, 168, 255, .35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

/* Ruang untuk navbar bawah (hanya halaman frontend) */
body[data-page] {
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

/* ---------- Layout ---------- */
.container {
  width: min(100% - 2rem, 1280px);
  margin-inline: auto;
}
.page-content { min-height: 60vh; }

.page-head { padding: 1.5rem 0 .5rem; }
.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.page-subtitle { margin-top: .25rem; color: var(--text-2); font-size: .92rem; }

.section { margin-block: 1.75rem; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}
.section-title {
  position: relative;
  padding-left: .8rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0; top: 15%; bottom: 15%;
  width: 4px;
  border-radius: 4px;
  background: var(--grad);
  box-shadow: var(--glow-soft);
}
.section-more { font-size: .85rem; font-weight: 600; color: var(--primary); }
.section-more:hover { color: var(--accent); }
.section-count { font-size: .85rem; color: var(--text-2); }

.storage-note {
  margin-top: 1.25rem;
  font-size: .8rem;
  color: var(--text-2);
  text-align: center;
}

.site-footer {
  margin-top: 2.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: .8rem;
  color: var(--text-2);
  border-top: 1px solid var(--border);
}

/* ---------- Brand / Logo ---------- */
.brand { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; }
.brand-logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  color: #04111F;
  background: var(--grad);
  box-shadow: var(--glow), inset 0 0 0 1px rgba(255, 255, 255, .25);
  text-shadow: 0 0 6px rgba(255, 255, 255, .5);
}
.brand-logo-lg { width: 48px; height: 48px; font-size: 1.7rem; border-radius: 14px; }
.brand-name {
  font-weight: 800;
  letter-spacing: .08em;
  font-size: .95rem;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(0, 168, 255, .45);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(7, 11, 20, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  width: min(100% - 2rem, 1280px);
  height: var(--header-h);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-search-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--bg-2);
  transition: var(--ease);
}
.header-search-btn:hover { color: var(--primary); border-color: var(--primary); box-shadow: var(--glow-soft); }

/* Navigasi atas (desktop, ditampilkan di responsive.css) */
.main-nav { display: none; align-items: center; gap: .35rem; }
.nav-link {
  padding: .5rem 1rem;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-2);
  transition: var(--ease);
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav-link.active {
  color: var(--primary);
  background: rgba(0, 168, 255, .12);
  box-shadow: var(--glow-soft);
}

/* ---------- Navbar bawah (mobile) ---------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(13, 20, 36, .94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.bottom-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-2);
  transition: var(--ease);
}
.bottom-link.active { color: var(--primary); }
.bottom-link.active svg { filter: drop-shadow(0 0 6px rgba(0, 168, 255, .8)); }
.bottom-link.active::before {
  content: "";
  position: absolute;
  top: 0; left: 28%; right: 28%;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: var(--grad);
  box-shadow: var(--glow);
}

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-primary { color: #04111F; background: var(--grad); box-shadow: var(--glow-soft); }
.btn-primary:hover { box-shadow: var(--glow); filter: brightness(1.08); }
.btn-outline { color: var(--text); background: transparent; border-color: var(--border); }
.btn-outline:hover { color: var(--primary); border-color: var(--primary); box-shadow: var(--glow-soft); }
.btn-outline.is-active, .btn-outline[aria-pressed="true"] {
  color: var(--primary); border-color: var(--primary); background: rgba(0, 168, 255, .1);
}
.btn-ghost { color: var(--text-2); background: transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.btn-danger { color: var(--danger); background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .35); }
.btn-danger:hover { background: rgba(248, 113, 113, .2); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.link-btn { font-size: .88rem; font-weight: 600; color: var(--primary); }
.link-btn:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: .72rem .9rem;
  font-size: 16px; /* cegah zoom otomatis di iOS */
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: var(--ease);
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: #5B6B84; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, .18);
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
}

.form-alert {
  padding: .75rem .95rem;
  margin-bottom: 1rem;
  font-size: .88rem;
  color: var(--danger);
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .35);
  border-radius: 12px;
}
.form-alert.is-success {
  color: var(--success);
  background: rgba(52, 211, 153, .1);
  border-color: rgba(52, 211, 153, .35);
}

/* ---------- Spinner & Skeleton ---------- */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(0, 168, 255, .2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(4, 17, 31, .3);
  border-top-color: #04111F;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(100deg, var(--card) 30%, #19294a 50%, var(--card) 70%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, .75);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow), var(--glow-soft);
  animation: pop .18s ease;
}
.modal-box.modal-lg { max-width: 720px; }
.modal-box h2, .modal-box h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.modal-box p { color: var(--text-2); font-size: .92rem; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-head h2 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Aksesibilitas ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
