/* ── GeoHan Design System ────────────────────────────────────── */
:root {
  --bg-deep:    #0a1018;
  --bg-panel:   #11192a;
  --bg-elev:    #1a2438;
  --bg-input:   #0f1726;
  --border:     #1f2d44;
  --border-hi:  #2a3b56;

  --accent:     #14a085;
  --accent-dim: #0d7377;
  --accent-hi:  #1ec6a3;

  --text:       #e6edf5;
  --text-dim:   #8294aa;
  --text-faint: #4a5a72;

  --ok:         #4ae890;
  --warn:       #f0a020;
  --danger:     #e07070;
  --info:       #4a9eca;

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Topbar ──────────────────────────────────────────────────── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 52px;
  background: rgba(10, 16, 24, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand-mark { font-size: 18px; color: var(--accent); }
.brand-name { font-weight: 700; letter-spacing: 0.3px; }
.crumb-sep { color: var(--text-faint); }
.crumb { color: var(--text-dim); font-size: 13px; }

.topbar-right { display: flex; align-items: center; gap: 10px; position: relative; }
.balance {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
}
.balance-icon { color: var(--accent); }
.balance-val { color: var(--text); font-weight: 600; }
.balance-lbl { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

.btn-ghost {
  background: transparent; border: 1px solid var(--border-hi); color: var(--text-dim);
  padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
  transition: all 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.dropdown {
  position: absolute; top: 42px; right: 0; min-width: 160px;
  background: var(--bg-panel); border: 1px solid var(--border-hi);
  border-radius: 6px; padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.dropdown a {
  display: block; padding: 8px 12px; color: var(--text-dim);
  text-decoration: none; font-size: 13px; border-radius: 4px;
}
.dropdown a:hover { background: var(--bg-elev); color: var(--text); }

/* ── Workspace layout ────────────────────────────────────────── */
body.workspace { overflow: hidden; }
#workspace {
  position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: 280px 1fr 320px;
}
#left-panel, #right-panel {
  background: var(--bg-panel);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}
#left-panel  { border-right: 1px solid var(--border); }
#right-panel { border-left:  1px solid var(--border); }
#map-area { position: relative; overflow: hidden; }

/* Panel sections */
.panel-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-section h3 {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--info);
  margin-bottom: 10px;
}
.panel-section h3 .hint {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--text-faint); margin-left: 4px;
}

label {
  display: block; font-size: 11px; color: var(--text-dim);
  margin-top: 10px; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
label:first-child { margin-top: 0; }
label .hint { color: var(--text-faint); font-size: 10px; text-transform: none; letter-spacing: 0; }

select, input[type="text"], input[type="password"], input[type="email"], input[type="number"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.15s;
}
select:focus, input:focus { border-color: var(--accent); }

button {
  width: 100%; padding: 9px 12px;
  border: none; border-radius: 5px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  margin-top: 8px;
  font-family: var(--sans);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); }
.btn-primary:disabled { background: var(--bg-elev); color: var(--text-faint); cursor: not-allowed; }
.btn-secondary { background: var(--bg-elev); color: var(--text-dim); border: 1px solid var(--border-hi); }
.btn-secondary:hover { background: var(--bg-input); color: var(--text); }
.btn-secondary.active { background: rgba(20,160,133,0.15); color: var(--accent); border-color: var(--accent); }
.btn-danger  { background: #3a1e1e; color: var(--danger); border: 1px solid #5a2a2a; margin-top: 4px; }
.btn-danger:hover { background: #4a2525; }
.btn-compact { width: auto; padding: 8px 12px; margin-top: 0; }

.row { display: flex; gap: 6px; align-items: stretch; }
.row > input { flex: 1; }
.divider { text-align: center; font-size: 11px; color: var(--text-faint); margin: 12px 0 6px; }

.cost-chip {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  background: rgba(0,0,0,0.25); padding: 2px 6px; border-radius: 3px;
  margin-left: 6px; font-weight: 400;
}

/* Status */
#status-box {
  padding: 9px 12px; border-radius: 5px; font-size: 12px;
  margin-top: 8px; display: none; line-height: 1.4;
}
#status-box.pending { background: #1a2030; border: 1px solid #2a3550; color: #7a9bc0; }
#status-box.running { background: #1a2a10; border: 1px solid #2a5a20; color: #7aca60; }
#status-box.done    { background: #0d2a1a; border: 1px solid #1a6a3a; color: var(--ok); }
#status-box.failed  { background: #2a0d0d; border: 1px solid #6a1a1a; color: var(--danger); }

/* Opaklık slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 3px;
  background: var(--border-hi); border-radius: 2px;
  outline: none; margin-top: 6px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%; background: var(--accent);
  cursor: pointer; border: 2px solid var(--bg-deep);
}

/* Right panel — score */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 40px 20px;
  text-align: center; color: var(--text-faint);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 13px; line-height: 1.6; }

.score-section {
  text-align: center;
  background: linear-gradient(180deg, rgba(20,160,133,0.08), transparent);
}
.score-label {
  font-size: 10px; color: var(--info);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.score-value {
  font-family: var(--mono); font-size: 44px; font-weight: 600;
  color: var(--accent); line-height: 1; margin-bottom: 6px;
}
.score-range { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.score-range span { color: var(--text); }

.kv-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; font-size: 13px; color: var(--text-dim);
  border-bottom: 1px dashed rgba(31,45,68,0.5);
}
.kv-row:last-child { border-bottom: none; }
.kv-val { font-family: var(--mono); color: var(--text); font-weight: 500; }

/* Criteria bars */
.criterion {
  display: grid; grid-template-columns: 64px 1fr 38px; gap: 8px;
  align-items: center; padding: 4px 0; font-size: 12px;
}
.criterion .c-name { color: var(--text-dim); text-transform: uppercase; font-size: 10px; letter-spacing: 0.5px; }
.criterion .c-bar { background: var(--bg-input); height: 6px; border-radius: 3px; overflow: hidden; }
.criterion .c-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s; }
.criterion .c-fill.low { background: var(--danger); }
.criterion .c-fill.mid { background: var(--warn); }
.criterion .c-val { font-family: var(--mono); text-align: right; color: var(--text); font-size: 12px; }

.narrative { font-size: 12px; line-height: 1.6; color: var(--text-dim); white-space: pre-wrap; }

/* ── Map UI ──────────────────────────────────────────────────── */
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-top-right { top: 12px; right: 12px; }

#legend {
  position: absolute; bottom: 24px; right: 16px;
  background: rgba(10, 16, 24, 0.92);
  border: 1px solid var(--border-hi);
  border-radius: 8px; padding: 10px 14px;
  z-index: 5; min-width: 200px;
  backdrop-filter: blur(8px);
}
#legend h4 { font-size: 10px; color: var(--info); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 8px; }
.legend-bar { height: 10px; border-radius: 3px;
  background: linear-gradient(to right, #ffffff, #ffff00, #00c800);
}
.legend-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-faint); margin-top: 4px; }
.legend-block { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10px; color: var(--text-faint); }
.legend-block-swatch { width: 16px; height: 10px; border-radius: 2px; flex-shrink: 0; background: #ff0000; border: 1.5px solid #000; }

#draw-hint {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(20, 160, 133, 0.95);
  color: #fff; padding: 7px 16px; border-radius: 20px;
  font-size: 12px; z-index: 5;
  display: none; pointer-events: none;
  font-weight: 500;
}
.vertex-count {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(20,160,133,0.92);
  color: #fff; border-radius: 12px;
  padding: 4px 10px; font-size: 11px;
  display: none; z-index: 5;
  font-family: var(--mono);
}
.vertex-marker {
  width: 10px; height: 10px;
  background: var(--accent); border: 2px solid #fff;
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}

/* Boundary list */
#boundary-list { margin-top: 6px; }
.boundary-item {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 5px; padding: 8px 10px;
  margin-bottom: 4px; cursor: pointer;
  transition: all 0.15s;
}
.boundary-item:hover { background: var(--bg-elev); border-color: var(--accent); }
.boundary-item .b-name { font-size: 12px; font-weight: 600; color: var(--text); }
.boundary-item .b-area { font-size: 11px; color: var(--text-dim); margin-top: 2px; font-family: var(--mono); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 10, 18, 0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  backdrop-filter: blur(6px);
}
.modal-box {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  padding: 28px;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-close {
  position: absolute; top: 10px; right: 10px;
  background: transparent; border: none; color: var(--text-faint);
  font-size: 22px; cursor: pointer; width: 28px; height: 28px;
  padding: 0; margin: 0; border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--bg-elev); }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  margin: -8px -8px 18px;
  background: var(--bg-input);
  border-radius: 6px;
  padding: 3px;
}
.auth-tab {
  background: transparent; border: none;
  padding: 7px; margin: 0;
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  border-radius: 4px; cursor: pointer;
}
.auth-tab.active { background: var(--bg-elev); color: var(--text); }

.auth-form h2 { font-size: 20px; margin-bottom: 4px; }
.auth-form .muted { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.auth-form .error { color: var(--danger); font-size: 12px; margin-top: 10px; }

/* ── Landing ─────────────────────────────────────────────────── */
body.landing { overflow-y: auto; min-height: 100%; }
body.landing #topbar { background: transparent; backdrop-filter: none; border-bottom: 1px solid rgba(31,45,68,0.4); }

.landing-main { padding-top: 52px; }

.hero {
  text-align: center;
  padding: 90px 24px 70px;
  max-width: 880px; margin: 0 auto;
  position: relative;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(20,160,133,0.12), transparent 60%);
  pointer-events: none; z-index: -1;
}
.hero-eyebrow {
  display: inline-block; font-size: 11px;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--accent); margin-bottom: 18px;
  padding: 4px 12px; border: 1px solid rgba(20,160,133,0.3);
  border-radius: 12px;
}
.hero h1 {
  font-size: 48px; font-weight: 700; line-height: 1.1;
  margin-bottom: 18px;
  letter-spacing: -1px;
  background: linear-gradient(180deg, #fff 0%, #a0b8d0 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 17px; color: var(--text-dim); max-width: 580px;
  margin: 0 auto 32px; line-height: 1.6;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff;
  padding: 12px 24px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.hero-cta:hover { background: var(--accent-hi); transform: translateY(-1px); }

.modules-grid {
  max-width: 1100px; margin: 0 auto;
  padding: 20px 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.module-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.module-card.active:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20,160,133,0.15);
}
.module-card.coming { opacity: 0.55; cursor: default; }
.module-card .m-icon { font-size: 32px; margin-bottom: 12px; }
.module-card.active .m-icon { color: var(--accent); }
.module-card h3 { font-size: 18px; margin-bottom: 4px; }
.module-card .m-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px; }
.module-card .m-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin-bottom: 16px; flex: 1; }
.module-card .m-badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.module-card.active .m-badge { background: rgba(20,160,133,0.15); color: var(--accent); border: 1px solid rgba(20,160,133,0.3); }
.module-card.coming .m-badge { background: rgba(74,90,114,0.15); color: var(--text-faint); border: 1px solid var(--border); }
.module-card .m-cta {
  font-size: 13px; color: var(--accent); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.module-card.coming .m-cta { color: var(--text-faint); }

footer.landing-footer {
  padding: 30px 24px 50px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ── Layout animasyon marker'ları ────────────────────────────── */
.lyt-marker-tx {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #ffe07a, #f0a13a);
  border: 2px solid rgba(255,255,255,.85);
  animation: lytPulseTx 1.8s ease-out infinite;
  cursor: default;
}
.lyt-marker-poc {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fffacc, #e8c14f);
  border: 2.5px solid #111;
  animation: lytPulsePoc 2s ease-out infinite;
  cursor: default;
}
.lyt-marker-sub {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #ff9999, #d33);
  border: 2px solid rgba(255,255,255,.9);
  animation: lytPulseSub 2.3s ease-out infinite;
  cursor: default;
}
.lyt-marker-flow {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 5px 2px rgba(232,193,79,.9), 0 0 10px 3px rgba(232,193,79,.4);
  pointer-events: none;
}
.grid-flash {
  font-size: 17px; line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(255,216,77,.95))
          drop-shadow(0 0 8px rgba(255,216,77,.55));
  animation: gridFlash 1s ease-in-out infinite;
}
@keyframes gridFlash {
  0%,100% { opacity: .55; transform: scale(.9); }
  50%     { opacity: 1;   transform: scale(1.15); }
}
@keyframes lytPulseTx {
  0%,100% { box-shadow: 0 0 0 0 rgba(240,161,58,.7); }
  60%     { box-shadow: 0 0 0 10px rgba(240,161,58,0); }
}
@keyframes lytPulsePoc {
  0%,100% { box-shadow: 0 0 0 0 rgba(232,193,79,.8); }
  60%     { box-shadow: 0 0 0 13px rgba(232,193,79,0); }
}
@keyframes lytPulseSub {
  0%,100% { box-shadow: 0 0 0 0 rgba(221,51,51,.8); }
  60%     { box-shadow: 0 0 0 14px rgba(221,51,51,0); }
}

/* ── Simülasyon Animasyonları ──────────────────────────────────── */
/* Enerji akışı ⚡ */
.sim-flow-energy {
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255,200,50,.9))
          drop-shadow(0 0 12px rgba(255,200,50,.4));
  animation: simFlowPulse 0.8s ease-in-out infinite;
}
@keyframes simFlowPulse {
  0%,100% { transform: scale(0.85); opacity: 0.7; }
  50%     { transform: scale(1.3);  opacity: 1.0; }
}

/* Para dönüşümü 💰 */
.sim-flow-money {
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(50,255,100,.7))
          drop-shadow(0 0 16px rgba(50,255,100,.3));
  animation: simMoneyFloat 1.2s ease-in-out infinite;
}
@keyframes simMoneyFloat {
  0%,100% { transform: translateY(0) scale(0.9); opacity: 0.6; }
  50%     { transform: translateY(-8px) scale(1.2); opacity: 1.0; }
}

/* Tır animasyonu 🚛 */
.sim-truck {
  pointer-events: none;
  z-index: 10;
}
.sim-truck-body {
  display: flex;
  align-items: center;
  gap: 1px;
  transition: transform 0.3s;
}
.sim-truck-cab {
  width: 8px; height: 8px;
  background: #3a6ea5;
  border-radius: 2px 0 0 2px;
  border: 1.5px solid #5a8ec5;
  box-shadow: 0 0 4px rgba(58,110,165,.6);
}
.sim-truck-trailer {
  width: 16px; height: 10px;
  background: #7a5a2a;
  border-radius: 0 2px 2px 0;
  border: 1.5px solid #b8963a;
  box-shadow: 0 0 4px rgba(120,90,42,.5);
}
.sim-truck-body.loaded .sim-truck-trailer {
  background: #5a8a3a;
  border-color: #7aba4a;
}

/* Enerji direği (pylon) ⚡ */
.sim-pylon {
  width: 6px; height: 16px;
  background: linear-gradient(180deg, #666, #888 30%, #666 60%, #999);
  clip-path: polygon(50% 0%, 0% 100%, 50% 85%, 100% 100%);
  border-radius: 1px;
  opacity: 0.7;
  box-shadow: 0 0 3px rgba(200,200,200,.3);
}

/* İnşaat ilerleme çubuğu */
.sim-progress-bar {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,16,24,0.88);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  padding: 8px 16px 10px;
  z-index: 10;
  min-width: 220px;
  text-align: center;
  backdrop-filter: blur(8px);
  display: none;
}
.sim-progress-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--warn);
  margin-bottom: 5px;
}
.sim-progress-track {
  height: 4px;
  background: var(--bg-elev);
  border-radius: 2px;
  overflow: hidden;
}
.sim-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--warn), var(--accent));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* OSM hatlarını daha belirgin yap */
#lyt-osm-lines {
  animation: osmLineGlow 3s ease-in-out infinite;
}
@keyframes osmLineGlow {
  0%,100% { opacity: 0.6; }
  50%     { opacity: 1.0; }
}
