/* ══════════════════════════════════════════════════════════════
   LEXINDOR ICON SYSTEM  ·  icons.css  ·  v2.0 — Doodle Set
   Hand-drawn doodle SVG sprite — usage:
     <svg class="lex-icon"><use href="#lex-icon-search"/></svg>

   Stroke color uses currentColor; the gold offset highlight
   uses --lex-doodle-gold / --lex-doodle-gold-solid (defined here
   so that dark-mode + light-mode both look right out of the box).
   ══════════════════════════════════════════════════════════════ */

:root {
  /* v2 palette — light: Trowulan Forest stroke + gold offset on cream paper */
  --lex-doodle-ink:         #1F3A2A;   /* Trowulan Forest */
  --lex-doodle-gold:        rgba(212,165,50,0.55);
  --lex-doodle-gold-solid:  rgba(212,165,50,0.7);
  --lex-doodle-paper:       #FBF6EA;   /* knockout fill = page paper */
}

/* v2 dark mode: inverted — Heritage Gold stroke + Padi Emerald offset on dark
   warm paper, so the doodles read clearly on dark surfaces. */
[data-theme="dark"] {
  --lex-doodle-ink:         #D4A532;   /* Heritage Gold */
  --lex-doodle-gold:        rgba(46,110,79,0.55);   /* Padi Emerald offset */
  --lex-doodle-gold-solid:  rgba(58,138,99,0.85);
  --lex-doodle-paper:       #15110A;   /* dark warm paper */
}

/* ── Base icon element ──────────────────────────────────────── */
/* The doodle stroke is `currentColor`. Default icon colour is the themed
   ink, but anywhere a wrapper sets `color` (nav links, buttons, badges)
   the icon naturally picks that up. */
.lex-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  color: var(--lex-doodle-ink);
  vertical-align: middle;
  flex-shrink: 0;
  overflow: visible;
  pointer-events: none;
}

/* When sitting inside a coloured container (nav link, button), inherit
   that color instead of the doodle ink so icons match their surroundings. */
.lex-nav-link .lex-icon,
.lex-nav-sub-link .lex-icon,
.lex-nav-link--btn .lex-icon,
.lex-btn .lex-icon,
.btn .lex-icon,
.lex-badge .lex-icon,
.badge .lex-icon,
.lex-section-action .lex-icon,
.widget-link .lex-icon {
  color: currentColor;
}

/* Top-nav icons get a touch bigger so they read at a glance in the
   header strip. Sub-links keep the default to stay quiet in dropdowns. */
.lex-nav-link > .lex-icon {
  width: 26px;
  height: 26px;
}

/* SVG inside .lex-icon — fill the wrapper */
.lex-icon svg {
  width: 100%;
  height: 100%;
}

/* ── Size variants ──────────────────────────────────────────── */
.lex-icon-xs  { width: 12px; height: 12px; }
.lex-icon-sm  { width: 16px; height: 16px; }
.lex-icon-md  { width: 24px; height: 24px; }
.lex-icon-lg  { width: 32px; height: 32px; }
.lex-icon-xl  { width: 48px; height: 48px; }
.lex-icon-2xl { width: 64px; height: 64px; }

/* ── Color variants ─────────────────────────────────────────── */
.lex-icon-blue   { color: #8B5A2B; }
.lex-icon-gold   { color: #C9A84C; }
.lex-icon-silver { color: #C0C0C0; }
.lex-icon-green  { color: #22C55E; }
.lex-icon-amber  { color: #F59E0B; }
.lex-icon-red    { color: #EF4444; }
.lex-icon-muted  { color: #888888; }
.lex-icon-white  { color: #FAF3E2; }
.lex-icon-black  { color: #0A0A0A; }

/* Semantic status colors (matching Lexindor's CSS vars) */
.lex-icon-berlaku { color: #1A6B3C; }
.lex-icon-dicabut { color: #9B2226; }
.lex-icon-diubah  { color: #A07C2A; }

/* ── Nav link icon helper ───────────────────────────────────── */
.lex-nav-link .lex-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -2px;
}

/* ── Button icon helper ─────────────────────────────────────── */
.btn .lex-icon {
  width: 16px;
  height: 16px;
  margin-right: 2px;
  vertical-align: -1px;
}

.btn-sm .lex-icon {
  width: 14px;
  height: 14px;
}

.btn-lg .lex-icon {
  width: 18px;
  height: 18px;
}

/* ── Sector card icon ───────────────────────────────────────── */
.sector-card .lex-icon,
.sg-chip .lex-icon {
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: -3px;
}

/* ── Stat widget icon ───────────────────────────────────────── */
.stat-icon .lex-icon {
  width: 28px;
  height: 28px;
}

/* ── Empty-state icon ───────────────────────────────────────── */
.empty-icon .lex-icon,
.lex-icon-empty {
  width: 40px;
  height: 40px;
  opacity: 0.35;
}

/* ── Badge icon ─────────────────────────────────────────────── */
.badge .lex-icon {
  width: 12px;
  height: 12px;
  margin-right: 3px;
  vertical-align: -1px;
}

/* ── Inline text icon helper ────────────────────────────────── */
.lex-icon-inline {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* ── Spin animation (for refresh/loading) ───────────────────── */
.lex-icon-spin {
  animation: lex-spin 0.8s linear infinite;
}

@keyframes lex-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Pulse animation (for notifications) ───────────────────── */
.lex-icon-pulse {
  animation: lex-pulse 2s ease-in-out infinite;
}

@keyframes lex-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
