@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-1: #2b1055;
  --bg-3: #7b2d5e;
  --bg-4: #1a2450;

  --glass: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.14);
  --glass-hover: rgba(255,255,255,0.13);

  --text-1: #ffffff;
  --text-2: rgba(255,255,255,0.65);
  --text-3: rgba(255,255,255,0.4);

  --accent-on: #ffd166;
  --accent-ok: #4ade80;
  --accent-off: #ef4444;
  --accent-cool: #5eb3f5;

  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text-1);
  background:
    radial-gradient(circle at 15% 8%, rgba(255,209,102,0.20), transparent 40%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-3) 45%, var(--bg-4) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.panel { max-width: 480px; margin: 0 auto; padding: 18px 16px 100px; }

/* ---------- Üst bar ---------- */
.topbar { display: flex; justify-content: space-between; align-items: flex-end; padding: 6px 4px 18px; }
.eyebrow { display: block; font-size: 11px; letter-spacing: 2px; color: var(--text-3); font-weight: 600; margin-bottom: 4px; }
.topbar h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.3px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.clock { font-size: 15px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bul-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-1); display: flex; align-items: center; justify-content: center;
}
.bul-btn:active { background: var(--glass-hover); transform: scale(0.92); }

/* ---------- Durum şeridi ---------- */
.durum-seridi {
  display: flex; gap: 18px; padding: 12px 18px; margin-bottom: 16px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); backdrop-filter: blur(20px);
  font-size: 13px; color: var(--text-2); font-weight: 500;
}
.durum-item { display: flex; align-items: center; gap: 7px; }
.durum-nokta { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-off); }
.durum-nokta.durum-ok { background: var(--accent-ok); animation: nabiz 2.2s ease-in-out infinite; }
.durum-nokta.durum-yok { background: var(--accent-off); opacity: 0.6; }

@keyframes nabiz {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(74,222,128,0); }
}

/* ---------- Oda kartları ---------- */
.oda-listesi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.oda-kart {
  position: relative;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-md); backdrop-filter: blur(20px);
  padding: 18px 16px; min-height: 128px;
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer; transition: transform 0.15s ease, background 0.2s ease;
}
.oda-kart:active { transform: scale(0.96); background: var(--glass-hover); }
.oda-kart.aktif-var {
  background: linear-gradient(145deg, rgba(255,209,102,0.20), rgba(255,209,102,0.05));
  border-color: rgba(255,209,102,0.32);
}
.oda-kart .ikon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: rgba(255,255,255,0.10); margin-bottom: 10px;
}
.oda-kart.aktif-var .ikon { background: rgba(255,209,102,0.26); }
.oda-kart .ikon svg { width: 22px; height: 22px; stroke: var(--text-1); fill: none; }
.oda-kart .isim { font-size: 15px; font-weight: 700; letter-spacing: -0.1px; }
.oda-kart .alt-bilgi { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.oda-kart .baglanti-noktasi {
  position: absolute; top: 14px; right: 14px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-off);
}
.oda-kart.hepsi-online .baglanti-noktasi { background: var(--accent-ok); animation: nabiz 2.2s ease-in-out infinite; }

/* ---------- Sheet ortak ---------- */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(10,8,20,0.55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 40;
}
.sheet-overlay.acik { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  background: linear-gradient(165deg, #3a1d63 0%, #24123f 100%);
  border: 1px solid var(--glass-border); border-bottom: none;
  border-radius: 28px 28px 0 0; padding: 12px 20px 28px;
  transform: translateY(105%); transition: transform 0.32s cubic-bezier(.32,.72,0,1);
  z-index: 50; max-height: 85vh; overflow-y: auto;
}
.sheet.acik { transform: translateY(0); }
@media (min-width: 481px) {
  .sheet { left: 50%; transform: translate(-50%, 105%); }
  .sheet.acik { transform: translate(-50%, 0); }
}

.sheet-handle { width: 38px; height: 4px; background: rgba(255,255,255,0.25); border-radius: 4px; margin: 6px auto 18px; }
.sheet-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.sheet-eyebrow { font-size: 11px; letter-spacing: 1.5px; font-weight: 600; color: var(--accent-cool); margin-bottom: 3px; }
.sheet-header h2 { margin: 0; font-size: 21px; font-weight: 800; }
.sheet-kapat {
  width: 32px; height: 32px; border-radius: 50%; background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-1); font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
}

/* ---------- Oda içi cihaz mini listesi ---------- */
.cihaz-mini-listesi { display: flex; flex-direction: column; gap: 10px; }

.cihaz-mini {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  cursor: pointer; transition: background 0.15s ease, transform 0.1s ease;
}
.cihaz-mini:active { transform: scale(0.98); background: var(--glass-hover); }
.cihaz-mini .ikon {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,0.10);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px;
}
.cihaz-mini.acik .ikon { background: rgba(255,209,102,0.28); }
.cihaz-mini .bilgi { flex: 1; min-width: 0; }
.cihaz-mini .isim { font-size: 14.5px; font-weight: 700; }
.cihaz-mini .alt-bilgi { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* basit toggle (klima olmayan cihazlar icin) */
.mini-toggle {
  width: 46px; height: 27px; border-radius: 20px; background: rgba(255,255,255,0.14);
  position: relative; flex-shrink: 0; border: 1px solid var(--glass-border);
}
.mini-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; transition: transform 0.2s ease;
}
.mini-toggle.acik { background: rgba(255,209,102,0.55); }
.mini-toggle.acik::after { transform: translateX(19px); }

/* ---------- Klima stepper ---------- */
.sicaklik-gosterge {
  display: flex; align-items: center; justify-content: center; gap: 28px; padding: 20px 0 26px;
}
.step-btn {
  width: 52px; height: 52px; border-radius: 50%; background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-1); font-size: 26px; font-weight: 600; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.step-btn:active { background: var(--glass-hover); transform: scale(0.92); }
.sicaklik-deger { text-align: center; min-width: 110px; }
.sicaklik-deger #sicaklikSayi { font-size: 56px; font-weight: 800; letter-spacing: -1px; }
.sicaklik-deger .derece { font-size: 30px; font-weight: 700; vertical-align: top; color: var(--text-2); }
.mod-etiket { font-size: 13px; color: var(--accent-cool); font-weight: 600; margin-top: 2px; }

/* ---------- Komut grid (klima ek fonksiyonlar) ---------- */
.komut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.komut-btn {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 14px; color: var(--text-1); font-family: inherit; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; transition: background 0.15s ease, transform 0.1s ease;
}
.komut-btn:active { transform: scale(0.96); background: var(--glass-hover); }
.komut-btn.tam-genislik { grid-column: 1 / -1; justify-content: center; }
.komut-btn.kapat-btn { border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.10); }
.komut-btn.gonderiliyor { opacity: 0.5; pointer-events: none; }

.son-komut { margin-top: 8px; font-size: 12.5px; color: var(--text-3); text-align: center; min-height: 16px; font-family: 'JetBrains Mono', monospace; }

/* ---------- Cihaz bul ---------- */
.tarama-durumu {
  display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2);
  padding: 10px 14px; background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); margin-bottom: 16px;
}
.tarama-nokta {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-cool);
  animation: nabiz-mavi 1.4s ease-in-out infinite;
}
@keyframes nabiz-mavi {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94,179,245,0.55); }
  50% { box-shadow: 0 0 0 6px rgba(94,179,245,0); }
}

.bulunan-listesi { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.bulunan-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 13px 15px; cursor: pointer; transition: background 0.15s ease;
}
.bulunan-item:active { background: var(--glass-hover); }
.bulunan-item .chip { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; }
.bulunan-item .ip { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.bulunan-item .sec-etiket { font-size: 12.5px; color: var(--accent-cool); font-weight: 600; }

.bos-durum { text-align: center; color: var(--text-3); font-size: 13px; padding: 24px 10px; }

/* ---------- Atama formu ---------- */
.atama-formu { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.atama-formu label { font-size: 12px; color: var(--text-2); font-weight: 600; margin-top: 8px; }
.atama-formu input, .atama-formu select {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text-1); font-family: inherit; font-size: 14.5px; font-weight: 500;
  outline: none;
}
.atama-formu input::placeholder { color: var(--text-3); }
.atama-formu select { appearance: none; }
.kaydet-btn { margin-top: 16px; border-color: rgba(74,222,128,0.4); background: rgba(74,222,128,0.14); }
