/* ============================================================
   Kampüs Radar — stil dosyası
   Tek tema: koyu (deliberate dark design). Durum renkleri
   dataviz status palette'inden birebir alınmıştır, değiştirilmemiştir.
   ============================================================ */

:root {
  color-scheme: dark;

  /* Zemin / yüzeyler */
  --page: #0b0f1a;
  --surface: #131a2b;
  --surface-2: #0d1320;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Metin */
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;

  /* Marka vurgusu (durum renklerinden ayrı tutulur) */
  --accent: #3987e5;
  --accent-soft: rgba(57, 135, 229, 0.16);
  --accent-ink: #cfe0fa;

  /* Durum paleti — dataviz skill, references/palette.md, dark adımlar */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --status-good-soft: rgba(12, 163, 12, 0.16);
  --status-warning-soft: rgba(250, 178, 25, 0.16);
  --status-critical-soft: rgba(208, 59, 59, 0.16);

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  padding-inline: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-ink); }

img { max-width: 100%; }

/* ---------------- Header ---------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: grid;
  place-items: center;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.5;
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 16px;
  background: var(--accent);
  top: 2px;
  left: 50%;
  transform-origin: bottom center;
  transform: translateX(-50%);
  animation: radar-sweep 3s linear infinite;
}

@keyframes radar-sweep {
  from { transform: translateX(-50%) rotate(0deg); }
  to   { transform: translateX(-50%) rotate(360deg); }
}

.brand-text h1 {
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: 0.01em;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.proto-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.proto-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------------- Timeline bar ---------------- */

.timeline-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.timeline-bar .clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 58px;
}

.timeline-bar input[type="range"] {
  flex: 1 1 200px;
  accent-color: var(--accent);
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
}

.play-btn:hover { background: var(--accent); }

/* ---------------- Layout ---------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-block: 16px;
  flex: 1;
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------------- Map ---------------- */

.map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3780 / 2018;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #061018;
}

.map-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zone-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: transparent;
}

.zone-pin .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: pulse 2.2s ease-out infinite;
}

.zone-pin .core {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.zone-pin.status-good .core,
.zone-pin.status-good .ring { background: var(--status-good); }
.zone-pin.status-warning .core,
.zone-pin.status-warning .ring { background: var(--status-warning); }
.zone-pin.status-critical .core,
.zone-pin.status-critical .ring { background: var(--status-critical); }

@keyframes pulse {
  0%   { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0;    transform: scale(2.4); }
}

.zone-pin.is-active .core {
  border-color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(0, 0, 0, 0.4);
}

.zone-pin:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 50%;
}

.pin-tip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
}

.zone-pin:hover .pin-tip,
.zone-pin:focus-visible .pin-tip {
  opacity: 1;
}

.pin-tip strong { color: var(--text-primary); }
.pin-tip span { color: var(--text-muted); }

/* ---------------- Legend ---------------- */

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 2px 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-item .swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-item.good .swatch { background: var(--status-good); }
.legend-item.warning .swatch { background: var(--status-warning); }
.legend-item.critical .swatch { background: var(--status-critical); }

/* ---------------- Side panel ---------------- */

.side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.card h2 {
  font-size: 0.95rem;
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.card h2 .h2-sub {
  font-weight: 400;
  color: var(--text-muted);
}

.detail-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.detail-head .icon {
  font-size: 1.4rem;
  line-height: 1;
}

.detail-head .names h3 {
  margin: 0;
  font-size: 1.05rem;
}

.detail-head .names p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hero-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 6px;
}

.hero-figure {
  font-size: 2.6rem;
  font-weight: 650;
  line-height: 1;
}

.hero-unit {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.status-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-chip.good { background: var(--status-good-soft); color: #7adf7a; }
.status-chip.good .dot { background: var(--status-good); }
.status-chip.warning { background: var(--status-warning-soft); color: #ffd680; }
.status-chip.warning .dot { background: var(--status-warning); }
.status-chip.critical { background: var(--status-critical-soft); color: #ff9b9b; }
.status-chip.critical .dot { background: var(--status-critical); }

.capacity-line {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.sparkline-wrap {
  margin: 10px 0 12px;
}

.sparkline-wrap svg { display: block; width: 100%; height: 64px; }

.insight-line {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  line-height: 1.5;
}

.insight-line strong { color: var(--text-primary); }

/* ---------------- AI asistan kartı ---------------- */

.assistant-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 4px;
}

.msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg.bot {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.assistant-form {
  display: flex;
  gap: 8px;
}

.assistant-form input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 11px;
  font-size: 0.85rem;
}

.assistant-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.assistant-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  cursor: pointer;
  font-size: 0.85rem;
}

/* ---------------- Footer ---------------- */

.site-footer {
  margin-top: auto;
  padding-block: 20px 28px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.site-footer a { color: var(--text-secondary); }
