/* ============================================================
   ChandaWatch — Global Styles
   Aesthetic: Civic clarity · Light authority · Bengali warmth
   Font: Hind Siliguri (Bengali) + Syne (UI headings)
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:         #f5f6f8;
  --bg-card:    #ffffff;
  --bg-raised:  #eef0f3;
  --border:     #dde1e7;
  --border-alt: #e8eaed;

  --text:       #1a1d23;
  --text-muted: #6b7280;
  --text-dim:   #adb5bd;

  --red:        #d63031;
  --red-soft:   rgba(214, 48, 49, 0.08);
  --red-glow:   rgba(214, 48, 49, 0.25);

  --amber:      #e17055;
  --amber-soft: rgba(225, 112, 85, 0.1);

  --green:      #00b894;
  --green-soft: rgba(0, 184, 148, 0.1);

  --blue:       #0984e3;
  --blue-soft:  rgba(9, 132, 227, 0.1);

  --accent:     #c0392b;
  --accent-alt: #d63031;

  --radius:     8px;
  --radius-lg:  14px;
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);

  --font-bn:    'Hind Siliguri', sans-serif;
  --font-ui:    'Syne', sans-serif;

  --sidebar-w:  340px;
  --header-h:   60px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-bn);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-alt); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
button { font-family: var(--font-bn); cursor: pointer; }
input, select, textarea { font-family: var(--font-bn); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-raised); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 34px; height: 34px;
  background: var(--red);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px var(--red-glow);
  flex-shrink: 0;
}
.logo-text {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.logo-text span { color: var(--red); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--bg-raised);
  text-decoration: none;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px var(--red-glow);
}
.btn-primary:hover:not(:disabled) {
  background: #c0392b;
  box-shadow: 0 4px 16px var(--red-glow);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-success {
  background: var(--green);
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #219a52; }
.btn-amber {
  background: var(--amber);
  color: #000;
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius);
}

/* ── Status Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.badge-review  { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber); }
.badge-verified { background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }
.badge-disputed { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }
.badge-published { background: var(--blue-soft); color: var(--blue); border: 1px solid var(--blue); }
.badge-locked    { background: rgba(139,148,158,0.15); color: var(--text-muted); border: 1px solid var(--border); }
.badge-rejected  { background: #fef2f2; color: #9b1c1c; border: 1px solid #fecaca; }

/* ── Form Elements ─────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-control {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: var(--font-bn);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.form-control::placeholder { color: var(--text-dim); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control option { background: #ffffff; color: var(--text); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 0.78rem; color: var(--text-dim); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-alt);
}
.modal-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
}
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-alt);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-close:hover { color: var(--text); background: var(--bg-raised); }

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Alerts & Toasts ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 0.88rem;
  max-width: 320px;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
  pointer-events: all;
}
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error   { border-left: 3px solid var(--red); }
.toast.toast-info    { border-left: 3px solid var(--blue); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading Spinner ───────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utilities ─────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-muted { color: var(--text-muted); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.74rem; }
.fw-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border-alt); margin: 4px 0; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .modal { max-width: 100%; }
  .header-nav .nav-link { display: none; }
  .header-nav .nav-link.mobile-show { display: flex; }
}