/* ═══════════════════════════════════════════════════════
   aksara.css — Base styles halaman Aksara
   Import tambahan: book-card.css, sidebar.css
   punyahanif.id
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600;700;800&family=DM+Mono&family=Gaegu:wght@400;700&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --primary:      #12205c;
  --primary-mid:  #1e3a8a;
  --accent:       #e8c547;
  --accent-soft:  #fef9e7;
  --bg-app:       #f2f0eb;
  --bg-card:      #ffffff;
  --text-main:    #1a1a2e;
  --text-muted:   #7a7a8a;
  --border:       #e4e2dd;
  --radius:       18px;
  --shadow-sm:    0 2px 8px rgba(18, 32, 92, 0.07);
  --shadow-md:    0 8px 32px rgba(18, 32, 92, 0.10);
  --transition:   all 0.28s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ── DARK MODE ── */
body.dark {
  --primary:     #4f86f7;
  --primary-mid: #3b6fd4;
  --accent:      #e8c547;
  --accent-soft: #2a2500;
  --bg-app:      #0f172a;
  --bg-card:     #1e293b;
  --text-main:   #f1f5f9;
  --text-muted:  #94a3b8;
  --border:      #334155;
  --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 8px 32px rgba(0, 0, 0, 0.4);
}

body.dark .toolbar-card,
body.dark .filter-menu     { background: var(--bg-card); border-color: var(--border); color: var(--text-main); }
body.dark .filter-dropdown { background: #1e293b; border-color: var(--border); }
body.dark #mainSearch      { background: #1e293b; border-color: var(--border); color: var(--text-main); }
body.dark #mainSearch:focus { background: #263148; border-color: var(--primary); }
body.dark .filter-menu li:hover   { background: #263148; }
body.dark .dashboard-header h2    { color: var(--primary); }
body.dark .stat-icon              { background: #2a2500; }
body.dark .stat-number            { color: var(--primary); }
body.dark .app-loader             { background: #0f172a; }
body.dark .loader-brand           { color: var(--primary); }

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

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ── DASHBOARD HEADER ── */
.dashboard-header { padding: 48px 0 0; }

.dashboard-header h2 {
  font-family: 'Lora', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.dashboard-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── STAT CARDS (grid di atas katalog) ── */
.stats-grid { display: flex; gap: 16px; margin: 28px 0 0; }

.stat-card {
  flex: 1;
  background: white;
  padding: 22px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  font-size: 1.2rem;
  background: var(--accent-soft);
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
  display: block;
}

/* ── TOOLBAR ── */
.toolbar-card {
  display: flex;
  align-items: center;
  background: white;
  padding: 10px 14px;
  border-radius: 50px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin: 32px 0 28px;
  gap: 12px;
}

.filter-dropdown {
  position: relative;
  background: var(--bg-app);
  padding: 10px 20px;
  border-radius: 40px;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--border);
}

.filter-trigger      { display: flex; align-items: center; gap: 8px; }
.filter-label        { font-weight: 800; color: var(--primary); font-size: 0.72rem; letter-spacing: 0.1em; }
.current-value       { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }

.filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: white;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: none;
  z-index: 1000;
  overflow: hidden;
}

.filter-dropdown.active .filter-menu { display: block; }

.filter-menu li {
  padding: 11px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: var(--text-main);
  transition: var(--transition);
}

.filter-menu li:hover { background: var(--bg-app); color: var(--primary); }

/* ── SEARCH ── */
.search-box { flex: 1; position: relative; }

#mainSearch {
  width: 100%;
  padding: 11px 16px 11px 42px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--bg-app);
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--text-main);
  transition: var(--transition);
}

#mainSearch:focus        { border-color: var(--primary-mid); background: white; }
#mainSearch::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── LOADER ── */
.app-loader {
  position: fixed;
  inset: 0;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  gap: 16px;
  transition: opacity 0.5s;
}

.loader-brand {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid #e8eaf6;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3          { font-family: 'Lora', serif; color: var(--primary); margin-bottom: 8px; }

/* ── SHAKE (passcode salah) ── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}
