/* ==============================================================================
   MISZTI Kft. — Tri-Mode Theme System
   Modes: light | medium (DEFAULT) | dark
   ============================================================================== */

:root {
  /* Default: Medium Theme (Sötétszürke / Slate-800 - Alapértelmezett) */
  --bg-body: #1E293B;
  --bg-surface: #0F172A;
  --bg-card: rgba(15, 23, 42, 0.88);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --bg-input: #090D16;
  --bg-badge: rgba(14, 165, 233, 0.12);
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --border-color: #334155;
  --border-subtle: #1E293B;
  --border-highlight: rgba(14, 165, 233, 0.45);
  --accent-cyan: #0EA5E9;
  --accent-cyan-bright: #00D2FF;
  --grid-line: rgba(255, 255, 255, 0.045);
  --header-bg: rgba(30, 41, 59, 0.92);
  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
}

html.theme-light {
  /* Light Theme (Világos - Kristálytiszta, magas kontraszt, prémium papír és pala tónusok) */
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-input: #FFFFFF;
  --bg-badge: rgba(2, 132, 199, 0.08);
  --text-primary: #0F172A;      /* Deep obsidian slate - 100% olvasható, éles kontraszt */
  --text-secondary: #334155;    /* Slate-700 - mély, kifogástalanul olvasható folyó szöveg */
  --text-muted: #64748B;        /* Slate-500 */
  --border-color: #CBD5E1;      /* Slate-300 - tiszta, határozott elválasztók */
  --border-subtle: #E2E8F0;     /* Slate-200 */
  --border-highlight: rgba(2, 132, 199, 0.5);
  --accent-cyan: #0284C7;       /* Cyan-600 */
  --accent-cyan-bright: #0369A1;/* Cyan-700 */
  --grid-line: rgba(15, 23, 42, 0.05);
  --header-bg: rgba(255, 255, 255, 0.95);
  --card-shadow: 0 8px 30px -4px rgba(15, 23, 42, 0.08), 0 2px 8px -2px rgba(15, 23, 42, 0.04);
}

html.theme-medium {
  /* Medium Theme (Közepes - Alapértelmezett, elegáns mélypala) */
  --bg-body: #1E293B;
  --bg-surface: #0F172A;
  --bg-card: rgba(15, 23, 42, 0.9);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --bg-input: #090D16;
  --bg-badge: rgba(14, 165, 233, 0.12);
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --border-color: #334155;
  --border-subtle: #1E293B;
  --border-highlight: rgba(14, 165, 233, 0.4);
  --accent-cyan: #0EA5E9;
  --accent-cyan-bright: #00D2FF;
  --grid-line: rgba(255, 255, 255, 0.045);
  --header-bg: rgba(30, 41, 59, 0.92);
  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
}

html.theme-dark {
  /* Dark Theme (Mély Obszidián Sötét) */
  --bg-body: #090D16;
  --bg-surface: #0F172A;
  --bg-card: rgba(15, 23, 42, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: #05080E;
  --bg-badge: rgba(0, 210, 255, 0.1);
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border-color: #1E293B;
  --border-subtle: #131B2A;
  --border-highlight: rgba(0, 210, 255, 0.35);
  --accent-cyan: #00D2FF;
  --accent-cyan-bright: #38BDF8;
  --grid-line: rgba(255, 255, 255, 0.035);
  --header-bg: rgba(9, 13, 22, 0.9);
  --card-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.75);
}

/* Base Body Application */
body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Global Typography Inheritance */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
}

.theme-text-primary {
  color: var(--text-primary) !important;
}

.theme-text-secondary {
  color: var(--text-secondary) !important;
}

.theme-text-muted {
  color: var(--text-muted) !important;
}

.theme-surface {
  background-color: var(--bg-surface);
  transition: background-color 0.25s ease;
}

.theme-card {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--card-shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.theme-card-hover:hover {
  background-color: var(--bg-card-hover);
}

.theme-input {
  background-color: var(--bg-input);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.theme-border {
  border-color: var(--border-color) !important;
}

.theme-badge {
  background-color: var(--bg-badge);
  border-color: var(--border-color);
  color: var(--accent-cyan);
}

.bg-blueprint {
  background-size: 36px 36px;
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
}

/* --------------------------------------------------------------------------
   Defensive Light-Mode Overrides (Garantálja a 100%-os olvashatóságot)
   -------------------------------------------------------------------------- */
html.theme-light .text-white {
  color: var(--text-primary) !important;
}

html.theme-light .text-slate-100,
html.theme-light .text-slate-200 {
  color: var(--text-primary) !important;
}

html.theme-light .text-slate-300,
html.theme-light .text-slate-400 {
  color: var(--text-secondary) !important;
}

html.theme-light .bg-slate-900,
html.theme-light .bg-slate-950,
html.theme-light .bg-slate-800 {
  background-color: var(--bg-card) !important;
}

html.theme-light .border-slate-800,
html.theme-light .border-slate-700 {
  border-color: var(--border-color) !important;
}

/* Kivételek a gombokra és aktív jelvényekre, ahol világos háttéren is sötét a betű */
html.theme-light .bg-cyan-500,
html.theme-light .bg-cyan-600 {
  color: #020617 !important;
}

html.theme-light .bg-cyan-500 .text-white,
html.theme-light .bg-cyan-600 .text-white {
  color: #020617 !important;
}

/* Subtle glow effect for cyan accents */
.glow-cyan-sm {
  box-shadow: 0 0 15px -3px rgba(14, 165, 233, 0.35);
}
