/* ============================================================
   KATA Platform — Global Stylesheet
   Mobile-first, Elegan & Literary
   ============================================================ */

/* ── VARIABLES ── */
:root {
  --ink:      #1c160e;
  --ink-2:    #3a2f1f;
  --ink-3:    #6b5a42;
  --ink-4:    #a8977e;
  --ink-5:    #d4c8b4;
  --parch:    #faf6ef;
  --parch-2:  #f3ede2;
  --parch-3:  #ede4d5;
  --card:     #fffdf8;
  --gold:     #b8832a;
  --gold-lt:  #f0dba0;
  --gold-dk:  #7a520e;
  --green:    #2e7d32;
  --green-bg: #e8f5e9;
  --red:      #c62828;
  --red-bg:   #ffebee;
  --blue:     #1565c0;
  --blue-bg:  #e3f2fd;
  --border:   rgba(160,130,80,0.18);
  --border-2: rgba(160,130,80,0.30);
  --ff-d: 'Cormorant Garamond', serif;
  --ff-b: 'DM Sans', sans-serif;
  --r:    10px;
  --r-lg: 16px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--ff-b); background: var(--parch); color: var(--ink); min-height: 100vh; overflow-x: hidden; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--ff-b); cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 2px; }

/* ── TOP BAR ── */
.top-bar {
  position: sticky; top: 0; z-index: 90;
  background: rgba(250,246,239,0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 54px; padding: 0 16px;
  display: flex; align-items: center; gap: 12px;
}
.logo {
  font-family: var(--ff-d); font-size: 1.5rem; font-weight: 700;
  color: var(--ink); line-height: 1; letter-spacing: -.01em;
}
.logo span { color: var(--gold); }
.desktop-nav { display: none; }
.top-bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Coin badge */
.coin-badge {
  display: flex; align-items: center; gap: 5px;
  background: var(--parch-2); border: 1px solid var(--border-2);
  padding: 5px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500; color: var(--gold-dk);
}
.coin-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

/* Notif */
.notif-wrap { position: relative; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); transition: background .15s; position: relative;
}
.icon-btn:active { background: var(--parch-2); }
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.8; }
.notif-count {
  position: absolute; top: 2px; right: 2px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 600;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid var(--parch);
}

/* Avatar dropdown */
.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--border-2); cursor: pointer; flex-shrink: 0;
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials {
  width: 100%; height: 100%; background: var(--parch-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-d); font-size: .85rem; font-weight: 700; color: var(--gold-dk);
}
.avatar-menu-wrap { position: relative; }
.avatar-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); min-width: 200px;
  box-shadow: 0 8px 24px rgba(28,22,14,.12);
  display: none; z-index: 200;
  animation: dropIn .2s ease;
}
.avatar-dropdown.open { display: block; }
@keyframes dropIn { from{opacity:0;transform:translateY(-8px);} to{opacity:1;transform:none;} }
.avatar-dropdown-header {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.dropdown-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.dropdown-email { font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.dropdown-item {
  display: block; padding: 10px 14px;
  font-size: 13px; color: var(--ink-2);
  transition: background .12s;
}
.dropdown-item:hover { background: var(--parch-2); }
.dropdown-divider { height: 1px; background: var(--border); }
.dropdown-item-danger { color: var(--red); }
.btn-login-header {
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  padding: 7px 14px; border-radius: var(--r);
  transition: background .15s;
}
.btn-login-header:hover { background: var(--parch-2); }
.btn-daftar-header {
  font-size: 13px; font-weight: 500;
  background: var(--ink); color: var(--parch);
  padding: 7px 16px; border-radius: var(--r);
  transition: background .15s;
}
.btn-daftar-header:hover { background: var(--ink-2); }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,246,239,0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex; height: 60px;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; font-size: 10px; font-weight: 500;
  color: var(--ink-4); letter-spacing: .03em;
  position: relative; transition: color .18s;
}
.nav-item.active { color: var(--ink); }
.nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 2px;
  background: var(--gold); border-radius: 0 0 2px 2px;
}
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.6; }
.bottom-spacer { height: 76px; }

/* ── NOVEL CARD (list style) ── */
.novel-list-card {
  display: flex; gap: 12px; padding: 13px 16px;
  background: var(--card); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.novel-list-card:active { background: var(--parch-2); }
.nlc-cover {
  width: 54px; min-width: 54px; height: 78px;
  border-radius: 3px 8px 8px 3px;
  border: 1px solid var(--border);
  box-shadow: -2px 2px 0 var(--border-2);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 7px 6px 8px; flex-shrink: 0;
}
.nlc-cover::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(to right,rgba(0,0,0,.14),transparent);
}
.nlc-cover-title {
  font-family: var(--ff-d); font-size: .58rem; font-weight: 700;
  color: var(--ink); line-height: 1.2; position: relative; z-index: 1;
}
.nlc-info { flex: 1; min-width: 0; }
.nlc-title {
  font-family: var(--ff-d); font-size: .95rem; font-weight: 700;
  color: var(--ink); line-height: 1.25; margin-bottom: 2px;
}
.nlc-author { font-size: 11px; color: var(--ink-3); margin-bottom: 5px; }
.nlc-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 5px; }
.nlc-tag { font-size: 9px; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--border-2); color: var(--ink-3); background: var(--parch-2); }
.nlc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nlc-rating { font-size: 10px; color: var(--gold-dk); font-weight: 500; }
.nlc-stat  { font-size: 10px; color: var(--ink-4); }
.meta-dot  { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-5); }
.status-pill { font-size: 9px; font-weight: 500; padding: 2px 7px; border-radius: 20px; }
.pill-ongoing { background: var(--green-bg); color: var(--green); }
.pill-tamat   { background: var(--blue-bg); color: var(--blue); }

/* ── COVER COLORS ── */
.cv-1{background:#e8ddc8;} .cv-2{background:#cfe0d4;} .cv-3{background:#cdd5e0;}
.cv-4{background:#e0cdd5;} .cv-5{background:#e0dcc8;} .cv-6{background:#d5cde0;}
.cv-7{background:#cce0d9;} .cv-8{background:#e0d5cd;} .cv-9{background:#d9e0cc;}

/* ── SECTION ── */
.section { padding: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-family: var(--ff-d); font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.section-link { font-size: 12px; color: var(--gold-dk); font-weight: 500; cursor: pointer; }

/* ── CHIP SCROLL ── */
.chip-scroll { overflow-x: auto; padding: 10px 16px 4px; display: flex; gap: 8px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 500; border: 1px solid var(--border-2);
  background: var(--card); color: var(--ink-2); transition: all .15s; cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--ink); color: var(--parch); border-color: var(--ink); }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--ink); color: var(--parch);
  padding: 11px 20px; border-radius: var(--r);
  font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, transform .12s; border: none; cursor: pointer;
}
.btn-primary:active { background: var(--ink-2); transform: scale(.98); }
.btn-outline {
  border: 1px solid var(--border-2); color: var(--ink-2);
  padding: 10px 16px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; background: var(--card);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s; cursor: pointer;
}
.btn-outline:active { background: var(--parch-2); }
.btn-gold {
  background: var(--gold); color: #fff;
  padding: 10px 20px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; border: none; cursor: pointer;
  transition: background .15s;
}
.btn-gold:active { background: var(--gold-dk); }

/* ── DESKTOP ── */
@media (min-width: 768px) {
  .bottom-nav  { display: none; }
  .desktop-nav { display: flex; align-items: center; gap: 6px; }
  .nav-link {
    font-size: 13px; font-weight: 500; color: var(--ink-3);
    padding: 6px 14px; border-radius: var(--r); transition: all .15s;
  }
  .nav-link:hover  { background: var(--parch-2); color: var(--ink); }
  .nav-link.active { color: var(--ink); }
  .top-bar { padding: 0 2rem; height: 60px; }
  .bottom-spacer { height: 40px; }
  .page-wrap { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
}
