/* === TEMA DEĞİŞKENLERİ & AYDINLIK/KARANLIK DENGE === */
:root {
  --kwh-bg: #f8fafc;
  --kwh-surface: rgba(255, 255, 255, 0.88);
  --kwh-surface-hover: rgba(255, 255, 255, 0.95);
  --kwh-border: rgba(0, 0, 0, 0.08);
  --kwh-text: #0f172a;
  --kwh-text-muted: #64748b;
  --kwh-accent: #059669;
  --kwh-accent-glow: rgba(5, 150, 105, 0.25);
  --kwh-bg-grad1: radial-gradient(ellipse 70% 55% at 15% 15%, rgba(30, 64, 175, 0.06) 0%, transparent 65%);
  --kwh-bg-grad2: radial-gradient(ellipse 60% 65% at 85% 85%, rgba(16, 185, 129, 0.06) 0%, transparent 65%);
  --kwh-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --kwh-radius: 20px;
  --kwh-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --kwh-focus-ring: 0 0 0 3px rgba(5, 150, 105, 0.4);
}

[data-theme="dark"],
.dark-mode {
  --kwh-bg: #0b1120;
  --kwh-surface: rgba(15, 23, 42, 0.72);
  --kwh-surface-hover: rgba(20, 30, 50, 0.85);
  --kwh-border: rgba(255, 255, 255, 0.12);
  --kwh-text: #e2e8f0;
  --kwh-text-muted: #94a3b8;
  --kwh-accent: #34d399;
  --kwh-accent-glow: rgba(52, 211, 153, 0.35);
  --kwh-bg-grad1: radial-gradient(ellipse 70% 55% at 15% 15%, rgba(15, 40, 90, 0.55) 0%, transparent 65%);
  --kwh-bg-grad2: radial-gradient(ellipse 60% 65% at 85% 85%, rgba(7, 60, 100, 0.50) 0%, transparent 65%);
  --kwh-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.25);
  --kwh-focus-ring: 0 0 0 3px rgba(52, 211, 153, 0.35);
}

/* === TEMEL YAPILAR === */
.kwh-page-bg {
  position: relative;
  padding: 32px 12px 48px;
  background: 
    var(--kwh-bg-grad1),
    var(--kwh-bg-grad2),
    linear-gradient(145deg, #f0f4f8 0%, #e6eef5 50%, #e8f5e9 100%);
  transition: var(--kwh-transition);
  border-radius: 28px;
  z-index: 0;
}
[data-theme="dark"] .kwh-page-bg,
.dark-mode .kwh-page-bg {
  background: 
    var(--kwh-bg-grad1),
    var(--kwh-bg-grad2),
    linear-gradient(145deg, #0a1122 0%, #0d152a 50%, #0b1814 100%);
}

.kwh-calculator {
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  color: var(--kwh-text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* === CAM KARTLAR === */
.glass {
  background: var(--kwh-surface);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--kwh-border);
  border-radius: var(--kwh-radius);
  box-shadow: var(--kwh-shadow);
  transition: var(--kwh-transition);
}
.glass:hover {
  background: var(--kwh-surface-hover);
  transform: translateY(-2px);
}

.kwh-header-card {
  padding: 28px 24px 24px;
  margin-bottom: 24px;
  text-align: center;
}
.kwh-title {
  font-size: clamp(1.4rem, 4.5vw, 1.75rem);
  font-weight: 800;
  margin: 0 0 10px;
  background: linear-gradient(90deg, #0f172a, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .kwh-title,
.dark-mode .kwh-title {
  background: linear-gradient(90deg, #e2e8f0, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.kwh-lead {
  color: var(--kwh-text-muted);
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  margin: 0;
  line-height: 1.65;
  max-width: 760px;
  margin-inline: auto;
}

/* === PRİZ KARTLARI === */
.kwh-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kwh-card {
  padding: 16px;
  text-align: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--kwh-border);
  border-radius: 16px;
  transition: var(--kwh-transition);
}
.kwh-card:hover { transform: translateY(-4px); box-shadow: var(--kwh-shadow); }
.kwh-card svg { width: 100%; height: auto; max-height: 130px; display: block; margin: 0 auto 10px; }
.kwh-card small { display: block; color: var(--kwh-text-muted); font-size: clamp(0.8rem, 3vw, 0.9rem); line-height: 1.5; }
.kwh-card small b { color: var(--kwh-text); display: block; margin-top: 4px; }

/* SVG Metin Renkleri */
.socket-label { font-size: 11px; font-weight: 600; fill: var(--kwh-text); text-anchor: middle; }

/* === HESAPLAYICI BÖLÜMLERİ === */
.calc-section { padding: 24px 20px; margin-bottom: 18px; }
.calc-section h2, .calc-section h3 { margin: 0 0 18px; font-size: 1.15rem; font-weight: 700; color: var(--kwh-text); }

.kw-display { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.kw-big { font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 800; color: var(--kwh-accent); text-shadow: 0 0 18px var(--kwh-accent-glow); }
.muted { color: var(--kwh-text-muted); font-size: 0.85rem; }

.range-row { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
@media (max-width: 520px) {
  .range-row { flex-direction: column; align-items: stretch; }
  .range-row input[type="number"] { width: 100% !important; }
}
.flex-1 { flex: 1; min-width: 160px; }

#kw-range {
  width: 100%; height: 32px; -webkit-appearance: none; background: transparent; cursor: pointer;
  margin: 0;
}
#kw-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #3b82f6, var(--kwh-accent)); }
#kw-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; margin-top: -7px; border: 3px solid var(--kwh-accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2); transition: transform 0.15s;
}
#kw-range::-webkit-slider-thumb:hover { transform: scale(1.1); }
#kw-range:focus-visible { outline: none; }
#kw-range:focus-visible::-webkit-slider-thumb { box-shadow: var(--kwh-focus-ring); }

#kw-number {
  width: 84px; padding: 8px 6px; border-radius: 24px;
  border: 1px solid var(--kwh-border); background: var(--kwh-surface);
  color: var(--kwh-text); font-size: 0.95rem; text-align: center;
  backdrop-filter: blur(6px); transition: var(--kwh-transition);
}
#kw-number:focus { outline: none; border-color: var(--kwh-accent); box-shadow: var(--kwh-focus-ring); }

/* === TABLO & BADGES === */
.table-wrapper { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.result-table { width: 100%; font-size: 0.9rem; border-collapse: separate; border-spacing: 0; min-width: 420px; }
.result-table th {
  background: rgba(76,104,183,0.85) !important; color: #fff !important;
  font-weight: 600; padding: 12px 12px; text-align: left; white-space: nowrap; border: none !important;
}
.result-table th:first-child { border-radius: 12px 0 0 0; }
.result-table th:last-child  { border-radius: 0 12px 0 0; }
.result-table td {
  padding: 11px 12px !important; border-bottom: 1px solid var(--kwh-border) !important;
  border-top: none !important; border-left: none !important; border-right: none !important;
  word-break: break-word; color: var(--kwh-text) !important; background: transparent !important;
}
.result-table tr:last-child td { border-bottom: none !important; }
.result-table tr:hover td { background: rgba(255,255,255,0.04) !important; }
.amp-value { font-weight: 700; font-size: 0.95rem; color: var(--kwh-accent); }

.badge-status {
  padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 0.75rem;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-status.suitable  { background: rgba(5,150,105,0.12); color: #059669; border-color: rgba(5,150,105,0.2); }
.badge-status.required  { background: rgba(217,119,6,0.12);  color: #d97706; border-color: rgba(217,119,6,0.2); }
.badge-status.exceeded  { background: rgba(220,38,38,0.12);  color: #dc2626; border-color: rgba(220,38,38,0.2); }
[data-theme="dark"] .badge-status.suitable { color: #34d399; background: rgba(52,211,153,0.12); }
[data-theme="dark"] .badge-status.required { color: #fbbf24; background: rgba(251,191,36,0.12); }
[data-theme="dark"] .badge-status.exceeded { color: #f87171; background: rgba(248,113,113,0.12); }

.note {
  margin-top: 16px; color: var(--kwh-text-muted);
  font-size: 0.8rem; text-align: center; line-height: 1.6; padding: 8px;
  background: rgba(255,255,255,0.03); border-radius: 10px;
}

/* === ALT HESAPLAYICILAR === */
.calc-input-group {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap;
}
.calc-input-group label { font-size: 0.9rem; color: var(--kwh-text-muted); font-weight: 500; min-width: 140px; }
.input-wrap { display: inline-flex; align-items: center; gap: 6px; }
.input-wrap input {
  width: 76px; padding: 8px; border-radius: 22px;
  border: 1px solid var(--kwh-border); background: var(--kwh-surface);
  color: var(--kwh-text); font-size: 0.9rem; text-align: center;
  backdrop-filter: blur(6px); transition: var(--kwh-transition);
}
.input-wrap input:focus { outline: none; border-color: var(--kwh-accent); box-shadow: var(--kwh-focus-ring); }
.btn-calc {
  width: 30px; height: 30px; background: rgba(100,116,139,0.1); border: 1px solid var(--kwh-border);
  border-radius: 50%; color: var(--kwh-text); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: var(--kwh-transition);
}
.btn-calc:hover { background: var(--kwh-accent); color: #fff; border-color: var(--kwh-accent); }
.btn-calc:active { transform: scale(0.95); }

.output-display {
  margin-top: 16px; padding: 14px; text-align: center; font-size: 0.95rem;
  color: var(--kwh-text-muted); line-height: 1.7; background: rgba(255,255,255,0.04);
  border-radius: 12px; border: 1px solid var(--kwh-border);
}
.output-display b { font-size: 1.25rem; color: var(--kwh-accent); display: block; margin-top: 4px; }

/* === TERMİNAL LİSTESİ === */
.term-list { list-style: none; padding: 0; margin: 0; line-height: 1.7; }
.term-list li {
  margin-bottom: 8px; font-size: 0.9rem; color: var(--kwh-text-muted);
  padding: 10px 14px; background: rgba(255,255,255,0.04);
  border-radius: 10px; border-left: 3px solid var(--kwh-accent);
}
.term-list li b { color: var(--kwh-text); }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .kwh-page-bg { padding: 20px 8px 36px; }
  .calc-section { padding: 18px 14px; }
  .kwh-title { font-size: 1.3rem; }
  .kw-display { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 480px) {
  .result-table { font-size: 0.8rem; }
  .result-table th, .result-table td { padding: 9px 8px !important; }
  .calc-input-group { flex-direction: column; align-items: flex-start; }
  .input-wrap { width: 100%; justify-content: space-between; }
}
