/* ============================================================
   EcoLag AI — base.css
   Variables · Reset · Typography · Animations
   ============================================================ */

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

/* ── CSS VARIABLES ── */
:root {
  /* Brand greens */
  --g1: #008753;
  --g2: #00A859;
  --g3: #00C46A;

  /* Accents */
  --y:  #FFC72C;
  --red: #EF4444;
  --orange: #F97316;
  --blue: #3B82F6;
  --purple: #8B5CF6;

  /* Dark backgrounds */
  --dark:  #0A1628;
  --dark2: #0F1E35;
  --dark3: #162440;

  /* Card backgrounds */
  --card:  #1A2B45;
  --card2: #1F3352;

  /* Text */
  --muted: #7A9BBF;
  --light: #F0F6FF;

  /* Borders */
  --border:  rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.13);

  /* Spacing scale */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 40px;

  /* Radius */
  --r-sm: 9px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Font families */
  --font-head: 'Montserrat', sans-serif;
  --font-body: 'Poppins', sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--dark);
  color: white;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 135, 83, 0.35);
  border-radius: 10px;
}

/* ── TYPOGRAPHY ── */
.h1 { font-family: var(--font-head); font-weight: 900; font-size: 28px; }
.h2 { font-family: var(--font-head); font-weight: 800; font-size: 22px; }
.h3 { font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.h4 { font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 10px; }
.text-muted { color: var(--muted); }
.text-green { color: var(--g2); }
.text-yellow { color: var(--y); }
.text-red   { color: var(--red); }
.font-mono  { font-family: var(--font-head); }
.font-bold  { font-weight: 700; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 135, 83, 0.3); }
  50%       { box-shadow: 0 0 50px rgba(0, 135, 83, 0.6); }
}
@keyframes fall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh)  rotate(720deg); opacity: 0; }
}
@keyframes countup {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── ANIMATION UTILITY CLASSES ── */
.au  { animation: fadeUp 0.5s ease both; }
.au1 { animation: fadeUp 0.5s 0.08s ease both; }
.au2 { animation: fadeUp 0.5s 0.16s ease both; }
.au3 { animation: fadeUp 0.5s 0.24s ease both; }
.fade-in { animation: fadeIn 0.25s ease; }

/* ── SPINNER ── */
.spinner {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(0, 135, 83, 0.2);
  border-top-color: var(--g1);
  animation: spin 0.9s linear infinite;
  display: inline-block;
}
.spinner-sm {
  width: 18px; height: 18px;
  border-width: 2px;
}
.spinner-red { border-top-color: var(--red); }

/* ── CONFETTI ── */
.confetti-piece {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  top: -10px;
  animation: fall linear forwards;
}

/* ── TOAST ── */
#toast {
  display: none;
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--g1);
  color: white;
  padding: 11px 22px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  white-space: nowrap;
  animation: fadeUp 0.3s ease;
}

/* ── LOCATION BADGE ── */
.loc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 135, 83, 0.15);
  border: 1px solid rgba(0, 135, 83, 0.3);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--g2);
}
.loc-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--g2);
  animation: pulse 1.5s ease infinite;
  flex-shrink: 0;
}


/* ══ LIGHT / DARK MODE ══════════════════════════════════════ */
:root {
  --mode-transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light mode overrides */
body.light {
  --bg:      #F0F4F1;
  --dark2:   #FFFFFF;
  --dark3:   #F5F7F5;
  --card:    #FFFFFF;
  --border:  rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.12);
  --muted:   #6B7280;
  color: #1a2e1a;
}
body.light .stat-card,
body.light .card,
body.light .modal-box   { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
body.light .nav-item    { color: #374151; }
body.light .nav-item:hover { background: rgba(0,135,83,0.08); }
body.light #sidebar     { background: #FFFFFF; border-right: 1px solid #E5E7EB; }
body.light #topbar,
body.light #bottomnav   { background: rgba(255,255,255,0.95); border-color: #E5E7EB; }
body.light .input-wrap  { background: #F9FAFB; border-color: #D1D5DB; }
body.light input,
body.light select       { color: #111827; }
body.light .tbl td,
body.light .tbl th      { color: #374151; border-color: #E5E7EB; }
body.light .tbl thead tr { background: #F9FAFB; }
body.light .su-name,
body.light .topbar-title { color: #111827; }
body.light .filter-select { background: #F9FAFB; color: #111827; border-color: #D1D5DB; }
body.light .search-input  { background: #F9FAFB; color: #111827; }
body.light .tag           { border-color: rgba(0,0,0,0.1); }
body.light .btn-ghost     { background: rgba(0,0,0,0.05); color: #374151; }
body.light .nav-logo,
body.light .brand         { color: #111827; }
body.light #auth-page     { background: linear-gradient(150deg,#f0faf4,#e8f5e9,#f0f4ff) !important; }
body.light .auth-card,
body.light .gov-auth-card { background: #FFFFFF; border-color: rgba(0,135,83,0.2); }
body.light .gov-auth-brand,
body.light .auth-brand    { color: #111827; }
body.light .lbl           { color: #374151; }

/* Theme toggle button */
#theme-toggle { transition: all 0.2s; }
body.light #theme-toggle { background: rgba(0,0,0,0.06); color: #374151; }
