/* 昀禾科技 (LETC) SCADA 工業圖控樣式表 - 現代清爽亮色系 (Light Theme) */
:root {
  --bg-main: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: #e2e8f0;
  --border-glow: rgba(2, 132, 199, 0.2);
  
  --primary: #0284c7;        /* 昀禾科技企業藍 */
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.3);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --critical: #dc2626;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-light: #94a3b8;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', 'Noto Sans TC', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Industrial Card */
.scada-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.scada-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px -2px rgba(2, 132, 199, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

/* LED Indicators */
.led-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.led-indicator::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  opacity: 0.6;
  animation: pulse-glow 2s infinite ease-in-out;
}

.led-green {
  background-color: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}
.led-green::after { background-color: var(--success); }

.led-yellow {
  background-color: var(--warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}
.led-yellow::after { background-color: var(--warning); }

.led-red {
  background-color: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
  animation: blink-rapid 0.8s infinite;
}
.led-red::after { background-color: var(--danger); }

.led-gray {
  background-color: #94a3b8;
  box-shadow: none;
}
.led-gray::after { display: none; }

/* Pulse RX light */
.pulse-rx {
  transition: opacity 0.15s ease-out;
  opacity: 0.25;
}
.pulse-rx.active {
  opacity: 1;
  filter: drop-shadow(0 0 5px #0284c7);
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.6); opacity: 0.1; }
}

@keyframes blink-rapid {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Alarm Banner flashing */
.alarm-active-critical {
  animation: alarm-border-critical 1.2s infinite ease-in-out;
}
.alarm-active-warning {
  animation: alarm-border-warning 1.8s infinite ease-in-out;
}

@keyframes alarm-border-critical {
  0%, 100% { border-color: rgba(220, 38, 38, 0.5); background-color: rgba(254, 242, 242, 0.8); }
  50% { border-color: rgba(220, 38, 38, 0.95); background-color: rgba(254, 226, 226, 0.95); }
}

@keyframes alarm-border-warning {
  0%, 100% { border-color: rgba(245, 158, 11, 0.4); background-color: rgba(254, 243, 199, 0.8); }
  50% { border-color: rgba(245, 158, 11, 0.9); background-color: rgba(253, 230, 138, 0.95); }
}

/* Water Level Tank Canvas styling */
#tankCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Tab active state */
.tab-btn.active {
  color: #0284c7;
  border-bottom-color: #0284c7;
  background: rgba(2, 132, 199, 0.06);
}

/* Input Styling for Light Theme */
input[type="number"], input[type="text"], input[type="password"], select {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  transition: all 0.2s ease;
}

input[type="number"]:focus, input[type="text"]:focus, input[type="password"]:focus, select:focus {
  border-color: #0284c7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Range input slider styling */
input[type="range"] {
  accent-color: #0284c7;
}

/* Monospace font for telemetry readings */
.font-mono-numbers {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
