/* BTEH SCADA & Telemetry System - Custom Styles & Multi-Theme Engine */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Tema Değişkenleri - Koyu (Varsayılan) */
  --bg-app: #09090b;
  --bg-surface: #18181b;
  --bg-surface-elevated: #27272a;
  --border-color: #27272a;
  --border-color-hover: #3f3f46;
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
}

html.light,
html:not(.dark) {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Custom Glassmorphism & Cards */
.scada-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.scada-card:hover {
  border-color: var(--border-color-hover);
}

/* Pulse animation for live data */
@keyframes live-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.animate-live {
  animation: live-pulse 2s infinite ease-in-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-color-hover);
}

/* Modal Backdrop */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

/* ============================================================ */
/* AÇIK TEMA (LIGHT MODE) KAPSAMLI UYARLAMALARI                */
/* ============================================================ */
html.light,
html:not(.dark) {
  color-scheme: light;
}

html.light body,
html:not(.dark) body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

/* Sidebar & Header */
html.light aside,
html:not(.dark) aside {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.04);
}

html.light header,
html:not(.dark) header {
  background-color: rgba(255, 255, 255, 0.92) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

html.light main,
html:not(.dark) main {
  background-color: #f8fafc !important;
}

/* Arka Plan Renk Eşleşmeleri (Background Overrides) */
html.light .bg-zinc-950,
html:not(.dark) .bg-zinc-950 {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html.light .bg-zinc-900,
html:not(.dark) .bg-zinc-900 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html.light .bg-zinc-900\/50,
html.light .bg-zinc-900\/40,
html.light .bg-zinc-900\/90,
html:not(.dark) .bg-zinc-900\/50,
html:not(.dark) .bg-zinc-900\/40,
html:not(.dark) .bg-zinc-900\/90 {
  background-color: rgba(255, 255, 255, 0.85) !important;
}

html.light .bg-zinc-950\/60,
html:not(.dark) .bg-zinc-950\/60 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html.light .bg-zinc-800,
html:not(.dark) .bg-zinc-800 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

html.light .bg-zinc-800\/50,
html.light .bg-zinc-800\/60,
html:not(.dark) .bg-zinc-800\/50,
html:not(.dark) .bg-zinc-800\/60 {
  background-color: #f8fafc !important;
}

/* Kenarlıklar (Borders) */
html.light .border-zinc-800,
html.light .border-zinc-700,
html.light .border-zinc-800\/80,
html.light .border-zinc-800\/60,
html:not(.dark) .border-zinc-800,
html:not(.dark) .border-zinc-700,
html:not(.dark) .border-zinc-800\/80,
html:not(.dark) .border-zinc-800\/60 {
  border-color: #e2e8f0 !important;
}

/* Metin Renkleri (Typography) */
html.light .text-white,
html:not(.dark) .text-white {
  color: #0f172a !important;
}

/* İstisna: Renkli buton ve badge içindeki beyaz yazılar beyaz kalsın */
html.light .bg-red-600 .text-white,
html.light .bg-emerald-600 .text-white,
html.light .bg-blue-600 .text-white,
html.light .bg-amber-600 .text-white,
html.light button.bg-red-600,
html.light button.bg-emerald-600,
html.light button.bg-blue-600,
html.light a.bg-emerald-600,
html:not(.dark) .bg-red-600 .text-white,
html:not(.dark) .bg-emerald-600 .text-white,
html:not(.dark) .bg-blue-600 .text-white,
html:not(.dark) button.bg-red-600,
html:not(.dark) button.bg-emerald-600,
html:not(.dark) button.bg-blue-600 {
  color: #ffffff !important;
}

html.light .text-zinc-100,
html:not(.dark) .text-zinc-100 {
  color: #1e293b !important;
}

html.light .text-zinc-200,
html:not(.dark) .text-zinc-200 {
  color: #334155 !important;
}

html.light .text-zinc-300,
html:not(.dark) .text-zinc-300 {
  color: #475569 !important;
}

html.light .text-zinc-400,
html:not(.dark) .text-zinc-400 {
  color: #64748b !important;
}

html.light .text-zinc-500,
html:not(.dark) .text-zinc-500 {
  color: #94a3b8 !important;
}

/* SCADA Kartları & Dijital Bezel */
html.light .scada-card,
html:not(.dark) .scada-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
}

html.light .scada-card:hover,
html:not(.dark) .scada-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}

html.light .digital-bezel,
html:not(.dark) .digital-bezel {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

/* Tablolar (Tables) */
html.light table thead,
html:not(.dark) table thead {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
}

html.light table tbody tr,
html:not(.dark) table tbody tr {
  border-color: #f1f5f9 !important;
}

html.light table tbody tr:hover,
html:not(.dark) table tbody tr:hover {
  background-color: #f8fafc !important;
}

/* Form Elemanları (Inputs, Selects, Textareas) */
html.light input:not([type="checkbox"]):not([type="radio"]),
html.light select,
html.light textarea,
html:not(.dark) input:not([type="checkbox"]):not([type="radio"]),
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html.light input:focus,
html.light select:focus,
html.light textarea:focus,
html:not(.dark) input:focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px #ef4444 !important;
}

/* Modallar */
html.light .modal-card,
html:not(.dark) .modal-card {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Tema Dropdown Menüsü */
html.light #themeDropdownMenu,
html:not(.dark) #themeDropdownMenu {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

html.light #themeDropdownMenu button,
html:not(.dark) #themeDropdownMenu button {
  color: #1e293b !important;
}

html.light #themeDropdownMenu button:hover,
html:not(.dark) #themeDropdownMenu button:hover {
  background-color: #f1f5f9 !important;
}
