/* J.A.R.V.I.S Web — teal/dark tema (masaüstü UI ile uyumlu) */

:root {
  --bg:     #010a0a;
  --panel:  #041111;
  --teal:   #00d4c4;
  --teal-d: #007a72;
  --mid:    #0a3a36;
  --text:   #c8f5f0;
  --dim:    #3a8a82;
  --red:    #ff4d4d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ── Header ─────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--mid);
  background: var(--panel);
}

.brand { font-size: 18px; letter-spacing: 3px; color: var(--teal); }
.brand .sub { font-size: 10px; color: var(--dim); letter-spacing: 2px; }

.badges { display: flex; gap: 8px; }

.badge {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 4px 10px;
  border: 1px solid var(--mid);
  border-radius: 3px;
  color: var(--dim);
}
.badge.on  { color: var(--teal); border-color: var(--teal-d);
             text-shadow: 0 0 8px var(--teal); }
.badge.off { color: var(--dim); }

/* ── Ana alan ───────────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding: 10px 14px 0;
}

#cam-wrap {
  position: relative;
  width: min(92vw, 480px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--mid);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
  flex-shrink: 0;
}
#cam-wrap.hidden { display: none; }
#cam { width: 100%; height: 100%; object-fit: cover;
       transform: scaleX(-1); /* ayna */ }
.cam-live {
  position: absolute; top: 6px; right: 8px;
  font-size: 10px; color: var(--red);
  text-shadow: 0 0 6px var(--red);
}

#orb {
  width: min(60vw, 280px);
  height: min(60vw, 280px);
  flex-shrink: 0;
}

#status {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--dim);
  margin: 4px 0 8px;
  flex-shrink: 0;
}
#status.live { color: var(--teal); }

/* ── Sohbet günlüğü ─────────────────────────────────── */
#log {
  flex: 1;
  width: min(94vw, 560px);
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--mid);
  border-radius: 6px;
  background: var(--panel);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 8px;
}

#log .row       { margin-bottom: 6px; word-wrap: break-word; }
#log .who-user   { color: var(--dim); }
#log .who-jarvis { color: var(--teal); }
#log .who-sys    { color: #8a7a3a; font-size: 11px; }

/* ── Footer / kontroller ────────────────────────────── */
footer {
  flex-shrink: 0;
  padding: 8px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--mid);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Surum damgasi — okunur ama dikkat cekmeyen kucuk yazi */
#build-stamp {
  font-size: 10px;
  text-align: center;
  opacity: 0.45;
  letter-spacing: 0.5px;
  margin-top: -2px;
}

.controls { display: flex; gap: 10px; justify-content: center; }

.ctl {
  flex: 1;
  max-width: 200px;
  padding: 12px 0;
  background: transparent;
  border: 1px solid var(--mid);
  border-radius: 4px;
  color: var(--dim);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all .15s;
}
.ctl.on {
  color: var(--teal);
  border-color: var(--teal-d);
  box-shadow: 0 0 12px rgba(0, 212, 196, .25) inset;
}
.ctl.rec {
  color: var(--red);
  border-color: var(--red);
}

#text-form { display: flex; gap: 8px; }

#text-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--mid);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
#text-input:focus { border-color: var(--teal-d); }

#text-form button {
  background: transparent;
  border: 1px solid var(--mid);
  border-radius: 4px;
  color: var(--teal);
  padding: 0 18px;
  font-size: 15px;
  cursor: pointer;
}

/* ── API anahtarı giriş ekranı (herkese açık mod) ───────── */
#key-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
#key-screen.hidden { display: none; }

.key-box {
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  border: 1px solid var(--mid);
  border-radius: 10px;
  background: var(--panel);
  padding: 32px 24px;
}
.key-title { font-size: 22px; letter-spacing: 3px; color: var(--teal);
             text-shadow: 0 0 12px rgba(0,212,196,.4); }
.key-sub   { font-size: 13px; color: var(--text); line-height: 1.5; }
#key-input {
  background: var(--bg);
  border: 1px solid var(--mid);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
#key-input:focus { border-color: var(--teal-d); }
#key-save {
  background: transparent;
  border: 1px solid var(--teal-d);
  border-radius: 6px;
  color: var(--teal);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all .15s;
}
#key-save:hover { box-shadow: 0 0 14px rgba(0,212,196,.25) inset; }
.key-link { color: var(--dim); font-size: 12px; text-decoration: none; }
.key-link:hover { color: var(--teal); }
.key-note { color: var(--dim); font-size: 11px; line-height: 1.5; }

/* ── ULTRON modu: kirmizi tema ─────────────────────────── */
body.ultron {
  --bg:     #0a0102;
  --panel:  #140306;
  --teal:   #ff2d46;
  --teal-d: #8a0f1e;
  --mid:    #3d0a12;
  --text:   #ffd0d5;
  --dim:    #a3404d;
}
