/* ==========================================================================
   Baran Çelik ve Galvaniz SAN. LTD. ŞTİ. — Dijital Baran
   Ortak Tasarım Değişkenleri (tokens.css v16 — Baran Birleşik Tasarım Sistemi)
   Varsayılan: Açık Tema (#f3f5f8 -> #eaf0f7) • İsteğe Bağlı: Baran Lacivert Koyu Tema (#16264a -> #1b2f5c)
   ========================================================================== */

:root {
  /* Tipografi (Baran Kurumsal Aydınlık Tasarım Sistemi) */
  --font-display: "Barlow", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-main: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", ui-monospace, monospace;

  /* Boşluk & Köşe Yarıçapları */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
  --card-radius: 14px;
  --icon-radius: 12px;

  /* Baran Marka Renkleri */
  --brand: #f68b1e;
  --brand-strong: #e0700a;
  --brand-soft: #ffb15c;
  --steel-blue: #1d4ed8;

  /* Hareket */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   AÇIK TEMA (Varsayılan) — Baran Kurumsal Açık Sistem
   -------------------------------------------------------------------------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;

  /* Yüzey & Arka Plan (Apple Editorial Light) */
  --bg-canvas: #F5F5F7;
  --bg-end: #F5F5F7;
  --bg-base: #F5F5F7;
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-1: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #F1F5F9;
  --surface-card: #FFFFFF;
  --surface-elevated: #F8FAFC;
  --surface-muted: #F1F5F9;
  --surface-solid-muted: #F1F5F9;
  --surface-glass: #FFFFFF;
  --hero-glass: #FFFFFF;
  --surface-input: #F8FAFC;
  --surface-hover: #EDF2F8;

  /* Kart & İkon Yüzeyleri */
  --glass-blur: 0px;
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --glass-edge: #d8dee7;
  --glass-edge-strong: #718198;
  --glow-warm: rgba(29, 78, 216, 0.06);
  --glow-cool: rgba(29, 78, 216, 0.06);
  --spotlight: rgba(29, 78, 216, 0.04);
  --icon-tile: linear-gradient(155deg, #ffffff 0%, #f3f6fa 60%, #e7ecf2 100%);
  --icon-tile-border: #d8dee7;

  /* Metin Renkleri (WCAG AAA Derin Lacivert Mürekkep) */
  --text-primary: #0B192C;
  --text: #0B192C;
  --text-title: #0F2342;
  --text-secondary: #2C3E55;
  --text-2: #2C3E55;
  --text-muted: #475B74;
  --muted: #475B74;
  --ink-on-accent: #FFFFFF;

  /* Kenarlık & Gölge */
  --border-color: #D5DFEC;
  --border: #D5DFEC;
  --border-subtle: #D5DFEC;
  --border-strong: #BCC9DA;

  --shadow-sm: 0 1px 3px rgba(21, 42, 73, 0.08);
  --shadow-card: 0 2px 8px rgba(21, 42, 73, 0.06), 0 8px 20px -12px rgba(21, 42, 73, 0.14);
  --shadow-card-hover: 0 12px 32px rgba(21, 42, 73, 0.13);
  --shadow-dialog: 0 24px 60px -12px rgba(21, 42, 73, 0.28);

  /* Etkileşim & Odak (Safir Mavisi #0055B3) */
  --focus-ring: #0055B3;
  --focus: #0055B3;
  --accent: #0055B3;
  --accent-primary: #0055B3;
  --accent-primary-hover: #004999;
  --accent-primary-bg: #EAF2FD;
  --accent-primary-border: #8EB4E3;
  --accent-gradient: linear-gradient(180deg, #0A70DC 0%, #0055B3 100%);

  /* Durum Renkleri */
  --status-ok: #146735;
  --status-ok-bg: #e8f7ed;
  --status-ok-border: #a7f3d0;
  --status-ok-dot: #10b981;

  --status-warn: #854609;
  --status-warn-bg: #fff3d6;
  --status-warn-border: #fde68a;
  --status-warn-dot: #f59e0b;

  --status-danger: #a91e30;
  --status-danger-bg: #fdebef;
  --status-danger-border: #fca5a5;

  /* 4 Kategori Renk Sistemi (Açık Tema) */
  --cat-erp: #146735;
  --cat-erp-text: #146735;
  --cat-erp-bg: #e8f7ed;
  --cat-erp-border: #a7f3d0;

  --cat-iletisim: #1d4ed8;
  --cat-iletisim-text: #1d4ed8;
  --cat-iletisim-bg: #e8efff;
  --cat-iletisim-border: #bfdbfe;

  --cat-operasyon: #0e7490;
  --cat-operasyon-text: #0e7490;
  --cat-operasyon-bg: #ecfeff;
  --cat-operasyon-border: #a5f3fc;

  --cat-kurumsal: #c2410c;
  --cat-kurumsal-text: #c2410c;
  --cat-kurumsal-bg: #fff4e8;
  --cat-kurumsal-border: #fdc897;

  /* Favori Yıldız Rengi */
  --fav-active: #b45309;
  --fav-active-bg: #fff3d6;
  --fav-active-border: #fcd34d;

  /* Kaydırma Çubuğu & Modal */
  --scrollbar-track: #eef2f6;
  --scrollbar-thumb: #8a9ab0;
  --dialog-backdrop: rgb(222 232 248 / 0.88);
}

/* --------------------------------------------------------------------------
   KOYU TEMA — Baran Kurumsal Lacivert (Kamera & Envanter ile Birebir)
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  /* Yüzey & Arka Plan */
  --bg-canvas: #16264a;
  --bg-end: #1b2f5c;
  --bg-base: #16264a;
  --bg: #16264a;
  --surface: #1a2d57;
  --surface-1: #1a2d57;
  --surface-2: #203764;
  --surface-3: #26417a;
  --surface-card: #1a2d57;
  --surface-elevated: #203764;
  --surface-muted: #203764;
  --surface-solid-muted: #203764;
  --surface-glass: #1a2d57;
  --hero-glass: #1a2d57;
  --surface-input: #203764;
  --surface-hover: #2c4b82;

  /* Kart & İkon Yüzeyleri */
  --glass-blur: 0px;
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glass-edge: rgba(148, 163, 184, 0.22);
  --glass-edge-strong: #7e98bd;
  --glow-warm: rgba(147, 197, 253, 0.08);
  --glow-cool: rgba(147, 197, 253, 0.08);
  --spotlight: rgba(147, 197, 253, 0.06);
  --icon-tile: linear-gradient(155deg, #26417a 0%, #203764 60%, #16264a 100%);
  --icon-tile-border: rgba(148, 163, 184, 0.25);

  /* Metin Renkleri (WCAG AA >= 4.5:1) */
  --text-primary: #f1f5ff;
  --text: #f1f5ff;
  --text-secondary: #cbd7ed;
  --text-2: #cbd7ed;
  --text-muted: #a9b8d8;
  --muted: #a9b8d8;
  --ink-on-accent: #101d32;

  /* Kenarlık & Gölge */
  --border-color: rgba(148, 163, 184, 0.2);
  --border: #2c4b82;
  --border-subtle: rgba(148, 163, 184, 0.2);
  --border-strong: #7e98bd;

  --shadow-sm: 0 2px 8px rgb(5 14 34 / 0.22);
  --shadow-card: 0 8px 24px rgb(5 14 34 / 0.25);
  --shadow-card-hover: 0 16px 36px rgb(5 14 34 / 0.38);
  --shadow-dialog: 0 24px 64px rgb(5 14 34 / 0.55);

  /* Etkileşim & Odak */
  --focus-ring: #93c5fd;
  --focus: #93c5fd;
  --accent: #93c5fd;
  --accent-primary: #93c5fd;
  --accent-primary-hover: #bfd9ff;
  --accent-primary-bg: rgb(96 165 250 / 0.16);
  --accent-primary-border: rgba(147, 197, 253, 0.38);
  --accent-gradient: linear-gradient(135deg, #bfd9ff 0%, #93c5fd 55%, #60a5fa 100%);

  /* Durum Renkleri */
  --status-ok: #6ee7b7;
  --status-ok-bg: rgb(52 211 153 / 0.14);
  --status-ok-border: rgba(110, 231, 183, 0.34);
  --status-ok-dot: #6ee7b7;

  --status-warn: #fbd679;
  --status-warn-bg: rgb(251 191 36 / 0.14);
  --status-warn-border: rgba(251, 214, 121, 0.34);
  --status-warn-dot: #fbd679;

  --status-danger: #ffacba;
  --status-danger-bg: rgb(251 113 133 / 0.16);
  --status-danger-border: rgba(255, 172, 186, 0.38);

  /* 4 Kategori Renk Sistemi (Koyu Tema) */
  --cat-erp: #6ee7b7;
  --cat-erp-text: #6ee7b7;
  --cat-erp-bg: rgb(52 211 153 / 0.14);
  --cat-erp-border: rgba(110, 231, 183, 0.32);

  --cat-iletisim: #93c5fd;
  --cat-iletisim-text: #93c5fd;
  --cat-iletisim-bg: rgb(96 165 250 / 0.16);
  --cat-iletisim-border: rgba(147, 197, 253, 0.32);

  --cat-operasyon: #67e8f9;
  --cat-operasyon-text: #67e8f9;
  --cat-operasyon-bg: rgb(34 211 238 / 0.14);
  --cat-operasyon-border: rgba(103, 232, 249, 0.32);

  --cat-kurumsal: #ffb15c;
  --cat-kurumsal-text: #ffb15c;
  --cat-kurumsal-bg: rgb(246 139 30 / 0.16);
  --cat-kurumsal-border: rgba(255, 177, 92, 0.34);

  /* Favori Yıldız Rengi */
  --fav-active: #fbd679;
  --fav-active-bg: rgb(251 191 36 / 0.14);
  --fav-active-border: rgba(251, 214, 121, 0.38);

  /* Kaydırma Çubuğu & Modal */
  --scrollbar-track: #16264a;
  --scrollbar-thumb: #667fa6;
  --dialog-backdrop: rgb(10 19 41 / 0.82);
}

/* Kategori Değişken Eşlemeleri */
[data-category="erp-is"],
.card-erp {
  --cat: var(--cat-erp);
  --cat-text: var(--cat-erp-text);
  --cat-bg: var(--cat-erp-bg);
  --cat-border: var(--cat-erp-border);
}

[data-category="iletisim"],
.card-iletisim {
  --cat: var(--cat-iletisim);
  --cat-text: var(--cat-iletisim-text);
  --cat-bg: var(--cat-iletisim-bg);
  --cat-border: var(--cat-iletisim-border);
}

[data-category="operasyon"],
.card-operasyon {
  --cat: var(--cat-operasyon);
  --cat-text: var(--cat-operasyon-text);
  --cat-bg: var(--cat-operasyon-bg);
  --cat-border: var(--cat-operasyon-border);
}

[data-category="kurumsal"],
.card-kurumsal {
  --cat: var(--cat-kurumsal);
  --cat-text: var(--cat-kurumsal-text);
  --cat-bg: var(--cat-kurumsal-bg);
  --cat-border: var(--cat-kurumsal-border);
}

/* Yazdırmada Her Zaman Açık Tema */
@media print {
  :root,
  :root[data-theme="dark"],
  :root[data-theme="light"] {
    color-scheme: light;
    --bg-canvas: #ffffff;
    --bg-end: #ffffff;
    --bg-base: #ffffff;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-1: #ffffff;
    --surface-2: #f8fafc;
    --surface-card: #ffffff;
    --surface-elevated: #f8fafc;
    --surface-muted: #f1f5f9;
    --surface-solid-muted: #f1f5f9;
    --surface-glass: #ffffff;
    --hero-glass: #ffffff;
    --surface-input: #ffffff;
    --glass-highlight: none;
    --text-primary: #111827;
    --text: #111827;
    --text-secondary: #334155;
    --text-2: #334155;
    --text-muted: #475569;
    --muted: #475569;
    --ink-on-accent: #ffffff;
    --border-color: #cbd5e1;
    --border: #cbd5e1;
    --border-subtle: #e2e8f0;
    --border-strong: #94a3b8;
    --accent-primary: #1d4ed8;
    --accent-primary-bg: #e8efff;
    --accent-primary-border: #bfdbfe;
    --cat-erp: #146735;
    --cat-erp-text: #146735;
    --cat-erp-bg: #e8f7ed;
    --cat-erp-border: #a7f3d0;
    --cat-iletisim: #1d4ed8;
    --cat-iletisim-text: #1d4ed8;
    --cat-iletisim-bg: #e8efff;
    --cat-iletisim-border: #bfdbfe;
    --cat-operasyon: #0e7490;
    --cat-operasyon-text: #0e7490;
    --cat-operasyon-bg: #ecfeff;
    --cat-operasyon-border: #a5f3fc;
    --cat-kurumsal: #c2410c;
    --cat-kurumsal-text: #c2410c;
    --cat-kurumsal-bg: #fff4e8;
    --cat-kurumsal-border: #fed7aa;
    --status-ok: #146735;
    --status-ok-bg: #e8f7ed;
    --status-ok-border: #a7f3d0;
    --status-warn: #854609;
    --status-warn-bg: #fff3d6;
    --status-warn-border: #fde68a;
    --shadow-sm: none;
    --shadow-card: none;
    --shadow-card-hover: none;
    --shadow-dialog: none;
  }
}
