/* D:\MayTech_Atolye\public\css\app.css
   MayTech Live / Atölye — minimalist arayüz (açık/koyu tema) */

:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --border: #e4e4e8;
  --border-strong: #d2d2d8;
  --text: #0b0b0d;
  --text-2: #3d3d45;
  --muted: #6e6e78;
  --accent: #2563eb;
  --accent-hover: #1d4fd8;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.10);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);
  --stage: #0d0d10;
  --shadow: 0 1px 2px rgba(16, 16, 24, 0.04), 0 4px 16px rgba(16, 16, 24, 0.06);
  --shadow-lg: 0 8px 40px rgba(16, 16, 24, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b;
    --surface: #131316;
    --surface-2: #1b1b1f;
    --border: #26262c;
    --border-strong: #34343b;
    --text: #ededf0;
    --text-2: #c4c4cc;
    --muted: #8c8c97;
    --accent: #3b82f6;
    --accent-hover: #5b96f7;
    --accent-soft: rgba(59, 130, 246, 0.16);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.14);
    --warn: #f59e0b;
    --warn-soft: rgba(245, 158, 11, 0.14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --stage: #000000;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b;
  --surface: #131316;
  --surface-2: #1b1b1f;
  --border: #26262c;
  --border-strong: #34343b;
  --text: #ededf0;
  --text-2: #c4c4cc;
  --muted: #8c8c97;
  --accent: #3b82f6;
  --accent-hover: #5b96f7;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --stage: #000000;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 12px; }

/* ---------- Üst çubuk ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700;
}
.brand small { font-weight: 500; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title h1 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px;
  font: inherit; font-weight: 550; font-size: 13px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, color .15s, opacity .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.on-success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.btn.on-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-icon { width: 34px; padding: 0; }
.btn svg, .ic { width: 16px; height: 16px; flex: none; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.input, textarea {
  width: 100%; height: 40px; padding: 0 12px;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 4px; }

/* ---------- Kart / panel ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.center-wrap { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card .lead { color: var(--muted); margin-bottom: 20px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-live { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: nabiz 1.6s infinite; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-muted { color: var(--muted); }
@keyframes nabiz { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.code-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .06em;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
}

/* ---------- Eğitmen: oda listesi ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.new-room { display: flex; gap: 8px; flex-wrap: wrap; }
.new-room .input { width: 300px; max-width: 100%; height: 34px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.room-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.room-card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-card h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-stats { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- Kokpit düzeni ---------- */
.cockpit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px; padding: 16px;
  height: calc(100vh - 56px);
}
.cockpit-main { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.cockpit-side { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* ---------- Sahne (video alanı) ---------- */
.stage {
  position: relative; flex: 1; min-height: 240px;
  background: var(--stage); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.stage-main, .stage-main video { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-main video { object-fit: contain; background: #000; }
.stage-pip {
  position: absolute; right: 14px; bottom: 14px; width: 22%; min-width: 150px; max-width: 280px;
  aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #111;
  box-shadow: 0 6px 24px rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.12);
}
.stage-pip video { width: 100%; height: 100%; object-fit: cover; }
.stage-strip {
  position: absolute; left: 14px; bottom: 14px; display: flex; gap: 8px; max-width: calc(100% - 320px); overflow-x: auto;
}
.tile {
  position: relative; width: 168px; aspect-ratio: 16 / 9; flex: none;
  border-radius: 9px; overflow: hidden; background: #16161a; border: 1px solid rgba(255,255,255,.12);
}
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile-name {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px);
  padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; color: #fff;
  background: rgba(0,0,0,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile.speaking { outline: 2px solid #22c55e; outline-offset: -2px; }
.tile-audio { width: 100%; height: 100%; display: grid; place-items: center; color: #d4d4d8; font-size: 12px; }
.mirror video, video.mirror { transform: scaleX(-1); }
.stage-empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  color: #a1a1aa;
}
.stage-empty .big { font-size: 15px; font-weight: 600; color: #e4e4e7; margin-bottom: 4px; }
.stage-label {
  position: absolute; left: 14px; top: 14px; display: flex; gap: 6px;
}
.stage-label .badge { background: rgba(0,0,0,.55); color: #fff; border-color: rgba(255,255,255,.14); }
.stage-label .badge-live { background: rgba(220,38,38,.9); color: #fff; }
.stage-audio-gate {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
}

.controls {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.controls .sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: 2px; padding: 4px; background: var(--surface-2); border-radius: 10px; margin: 12px 12px 0; }
.tab {
  flex: 1; height: 30px; border: 0; border-radius: 7px; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tab .count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--border); color: var(--text-2); line-height: 17px; }
.tab .count.hot { background: var(--accent); color: #fff; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.panel-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 0; }

/* ---------- Soru kartı (eğitmen) ---------- */
.q {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 10px;
  animation: belir .25s ease;
}
.q.new { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.q.answered { opacity: .72; }
@keyframes belir { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.q-who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-who span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-text { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.ai {
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  padding: 11px 12px; display: flex; flex-direction: column; gap: 9px;
}
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ai-sec-title { font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.ai-short { font-size: 14px; line-height: 1.55; color: var(--text); white-space: pre-wrap; }
.ai-basis { font-size: 12.5px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; }
.ai-warn {
  padding: 9px 11px; border-radius: 8px; background: var(--warn-soft); color: var(--warn);
  font-size: 13px; font-weight: 600; line-height: 1.45;
}
.ai-error { color: var(--danger); font-size: 12.5px; }
.ai-loading { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: don .7s linear infinite; }
@keyframes don { to { transform: rotate(360deg); } }
.q-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Katılımcı listesi ---------- */
.p-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.p-row.raised { border-color: var(--warn); background: var(--warn-soft); }
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  position: relative;
}
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); background: #9ca3af; }
.avatar .dot.on { background: #22c55e; }
.p-info { flex: 1; min-width: 0; }
.p-info b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-info span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-actions { display: flex; gap: 4px; flex: none; }
.hand { font-size: 15px; }
.section-label { font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 4px 2px 0; }

/* ---------- Bildirim (toast) ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 11px 14px; font-size: 13px;
  display: flex; gap: 10px; align-items: flex-start; animation: belir .2s ease;
}
.toast.warn { border-left: 3px solid var(--warn); }
.toast.ok { border-left: 3px solid var(--success); }
.toast.err { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

/* ---------- Katılımcı ekranı ---------- */
.room {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; padding: 16px;
  height: calc(100vh - 56px);
}
.room-main { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.room-side { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ask { padding: 14px; border-bottom: 1px solid var(--border); }
.ask h2 { margin-bottom: 2px; }
.ask p { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.my-q { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.my-q .t { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.my-q .m { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.raise.on { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.locked-hint { font-size: 12px; color: var(--muted); }

.hero { max-width: 560px; margin: 0 auto; padding: 72px 20px; text-align: center; }
.hero h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 10px; }
.hero p { color: var(--muted); font-size: 16px; margin-bottom: 28px; }
.hero form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero .input { width: 220px; height: 44px; text-transform: uppercase; font-family: var(--mono); letter-spacing: .08em; text-align: center; font-size: 16px; }

/* ---------- Duyarlı ---------- */
@media (max-width: 1100px) {
  .cockpit { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 900px) {
  .cockpit, .room { grid-template-columns: 1fr; height: auto; }
  .stage { min-height: 0; aspect-ratio: 16 / 9; flex: none; }
  .cockpit-side, .room-side { min-height: 520px; }
  .stage-strip { max-width: calc(100% - 28px); bottom: auto; top: 46px; }
  .stage-pip { min-width: 110px; }
  .topbar { padding: 0 12px; }
  .brand small { display: none; }
}
@media (max-width: 560px) {
  .tile { width: 120px; }
  .new-room .input { width: 100%; }
  .controls .btn .lbl { display: none; }
}
