/* ========================================
   LENTERA CENDEKIA — Premium Earth-Tone Design System
   ======================================== */

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

:root {
  /* ---- Core palette (polished earth tones) ---- */
  --bg:       #0a0806;
  --bg-alt:   #100c09;
  --card:     rgba(22, 17, 13, .72);
  --card-solid: #16110d;
  --text:     #f5ede8;
  --text-soft: #e8ddd6;
  --muted:    #b09a8f;
  --accent:   #e8854a;           /* warm amber-orange */
  --accent-glow: rgba(232,133,74,.25);
  --accent-2: #d4a056;           /* gold */
  --accent-3: #c46a3a;           /* deep terracotta */
  --stroke:   rgba(62,46,36,.45);
  --stroke-light: rgba(255,210,180,.08);
  --shadow:   0 8px 32px rgba(0,0,0,.35);
  --shadow-glow: 0 0 40px rgba(232,133,74,.08);
  --radius:   16px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  /* ---- Transitions ---- */
  --ease-smooth: cubic-bezier(.4,0,.2,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);
  --tr-fast:  .2s var(--ease-smooth);
  --tr-med:   .35s var(--ease-smooth);
  --tr-slow:  .5s var(--ease-smooth);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 500px at 65% 0%, rgba(52,32,18,.5), transparent 70%),
    radial-gradient(600px 400px at 20% 90%, rgba(42,25,12,.3), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Links ---- */
a { color: #ffd2bf; text-decoration: none; transition: color var(--tr-fast); }
a:hover { color: var(--accent); text-decoration: none; }

/* ---- Container ---- */
.container { width: min(1180px, 92vw); margin: 0 auto; position: relative; z-index: 1; }

/* ---- Section ---- */
.section { padding: 32px 0; }

/* ============ NAVBAR ============ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,8,6,.7);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--stroke);
  transition: background var(--tr-med), box-shadow var(--tr-med);
}
.navbar.scrolled {
  background: rgba(10,8,6,.92);
  box-shadow: 0 4px 30px rgba(0,0,0,.4);
}
.navbar .navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1rem;
  color: var(--text) !important;
  text-decoration: none !important;
}
.brand img.logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(232,133,74,.2));
}
.navlinks { display: flex; align-items: center; gap: 4px; }
.navlinks a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .9rem;
  color: var(--muted);
  transition: color var(--tr-fast), background var(--tr-fast);
}
.navlinks a::after {
  content: '';
  position: absolute; bottom: 2px; left: 50%; width: 0; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--tr-med), left var(--tr-med);
}
.navlinks a:hover, .navlinks a.active {
  color: var(--text);
  background: rgba(255,210,180,.06);
}
.navlinks a:hover::after, .navlinks a.active::after {
  width: 60%; left: 20%;
}

/* ============ CARDS ============ */
.card {
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: transform var(--tr-med), box-shadow var(--tr-med), border-color var(--tr-med);
}
.card:hover {
  border-color: rgba(232,133,74,.15);
  box-shadow: var(--shadow), var(--shadow-glow);
}

/* ============ GRID ============ */
.grid { display: grid; gap: 18px; }
.grid.auto-fit-280 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ============ ROW ============ */
.row { display: flex; align-items: center; gap: 10px; }

/* ============ BUTTONS ============ */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--tr-fast);
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--x,50%) var(--y,50%), rgba(255,255,255,.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}
.btn:hover::after { opacity: 1; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #fff;
  box-shadow: 0 4px 20px rgba(232,133,74,.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(232,133,74,.35);
}
.btn-outline {
  background: transparent;
  color: #ffd8c7;
  border: 1px solid rgba(62,46,36,.5);
}
.btn-outline:hover {
  background: rgba(255,210,180,.06);
  border-color: rgba(232,133,74,.3);
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

/* ============ FORMS ============ */
input, select, textarea {
  width: 100%;
  background: rgba(16,12,9,.8);
  border: 1px solid rgba(62,46,36,.4);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast), background var(--tr-fast);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px rgba(232,133,74,.08);
  background: rgba(20,15,11,.9);
}
input::placeholder, textarea::placeholder {
  color: rgba(176,154,143,.5);
}
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: .88rem;
  color: var(--muted);
}

/* ============ TABLE ============ */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid rgba(62,46,36,.3); }
th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }

/* ============ BADGE ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .78rem; font-weight: 600;
  background: rgba(62,46,36,.35);
  border: 1px solid rgba(62,46,36,.5);
  color: #ffcaa8;
  padding: 4px 10px;
  border-radius: 999px;
  transition: all var(--tr-fast);
}

/* ============ UTILITIES ============ */
.muted { color: var(--muted); }
.section-title {
  margin: 0 0 16px 0;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-center {
  min-height: calc(100vh - 120px);
  display: flex; align-items: center; justify-content: center;
}
.card.auth { max-width: 480px; margin: 0 auto; }

/* ============ COVER IMAGE ============ */
.card img.cover {
  width: 100%; height: 280px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke-light);
  margin-bottom: 12px;
  transition: transform var(--tr-med);
}
.card:hover img.cover { transform: scale(1.02); }

/* ============ READER ============ */
.reader-wrap { display: flex; justify-content: center; }
.reader {
  width: min(100%, 960px); height: 80vh;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============ TOAST ============ */
.toast-stack {
  position: fixed; top: 16px; right: 16px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 260px; max-width: 380px;
  background: rgba(22,17,13,.95);
  backdrop-filter: blur(12px);
  color: #ffe9e0;
  border: 1px solid rgba(62,46,36,.5);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(20px);
  animation: toast-in .35s var(--ease-smooth) forwards;
}
.toast.ok { border-left-color: #4ade80; }
.toast.err { border-left-color: #f87171; }
@keyframes toast-in { to { opacity: 1; transform: none; } }

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 150;
}
.modal {
  width: min(520px, 92vw);
  background: rgba(22,17,13,.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  animation: modal-in .3s var(--ease-smooth);
}
.modal h3 { margin-top: 0; }
@keyframes modal-in {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ============ HAMBURGER ============ */
.hamburger {
  display: none;
  width: 42px; height: 38px;
  border: 1px solid rgba(62,46,36,.4);
  border-radius: var(--radius-xs);
  background: rgba(22,17,13,.6);
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: background var(--tr-fast);
}
.hamburger:hover { background: rgba(62,46,36,.3); }
.hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-soft);
  border-radius: 2px;
  transition: all .3s var(--ease-smooth);
  transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s var(--ease-smooth), transform .6s var(--ease-smooth);
}
.reveal.from-left { transform: translateX(-30px); }
.reveal.from-right { transform: translateX(30px); }
.reveal.from-scale { transform: scale(.92); }
.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--stroke);
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
.site-footer a { color: var(--accent-2); }
.site-footer a:hover { color: var(--accent); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .navbar .navbar-inner { height: 58px; }
  .grid.auto-fit-280 { grid-template-columns: 1fr; }
  .card img.cover { height: 220px; }
  .navlinks {
    position: absolute; top: 58px; right: 0; left: 0;
    display: none; flex-direction: column;
    background: rgba(14,10,8,.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--stroke);
    padding: 12px 16px;
    z-index: 99;
  }
  .navlinks.open { display: flex; animation: nav-slide .3s var(--ease-smooth); }
  @keyframes nav-slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
  .navlinks a {
    margin: 4px 0;
    background: rgba(22,17,13,.6);
    border: 1px solid rgba(62,46,36,.3);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
  }
  .navlinks a::after { display: none; }
  .hamburger { display: flex; }
}

/* ============ RESPONSIVE TABLE ============ */
.responsive-table { width: 100%; border-collapse: collapse; }
.responsive-table thead th { padding: 10px 12px; border-bottom: 1px solid rgba(62,46,36,.3); text-align: left; white-space: nowrap; }
.responsive-table td { padding: 10px 12px; border-bottom: 1px solid rgba(62,46,36,.3); vertical-align: middle; }
@media (max-width: 900px) {
  .responsive-table thead { display: none; }
  .responsive-table tbody tr {
    display: block; margin-bottom: 12px;
    border: 1px solid var(--stroke); border-radius: var(--radius-sm);
    padding: 8px;
    background: var(--card);
  }
  .responsive-table tbody tr td {
    display: flex; justify-content: space-between;
    padding: 10px; background: transparent; border-bottom: none;
  }
  .responsive-table tbody tr td[data-label]::before {
    content: attr(data-label); color: var(--muted); margin-right: 8px; font-weight: 600;
  }
  .responsive-table tbody tr td .row { flex-direction: row; gap: 8px; }
  .responsive-table tbody tr td .row form { display: flex; align-items: center; gap: 8px; }
  .responsive-table tbody tr td .row select { min-width: 110px; }
}

/* Detail page */
#detailBody .detail-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,0.03); }
#detailBody .detail-row b { min-width: 110px; flex: 0 0 auto; color: var(--muted); }
#detailBody .detail-row .val { flex: 1 1 auto; word-break: break-word; }
#detailBody .coord-text { display: block; margin-bottom: 8px; word-break: break-word; }
#detailBody a.maps-link {
  display: inline-block; margin-top: 6px; margin-bottom: 6px;
  padding: 8px 14px; border: 1px solid rgba(62,46,36,.4); border-radius: var(--radius-xs);
  color: #ffd2bf; text-decoration: none; background: transparent;
}
#detailBody a.maps-link:hover { background: rgba(62,46,36,.3); }

/* ============ RIPPLE EFFECT ============ */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  transform: scale(0);
  animation: ripple-anim .5s linear;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* ============ LOADING SPINNER ============ */
.btn-loading {
  pointer-events: none;
  opacity: .7;
}
.btn-loading::before {
  content: '';
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
