/* Shorts fabrikası paneli
   Fikir: her kanal bir dikey ekran. Ekranlar sayfanın kahramanı, geri kalan her şey sakin. */

:root {
  --paper: #edeff2;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #5b6478;
  --line: #d5dae2;
  --bezel: #1b2232;
  --sun: #f2b705;
  --sea: #1f6fd1;
  --plum: #7340c9;
  --ok: #1e8f53;
  --bad: #c93636;
  --warn: #a96500;
  --accent: var(--sea);
  --radius-s: 8px;
  --radius-m: 14px;
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121722;
    --surface: #1a2130;
    --ink: #e8ecf3;
    --muted: #9aa4b8;
    --line: #2c3547;
    --bezel: #05070b;
    --sea: #4b90e6;
    --plum: #9a74e3;
    --ok: #3fbf7a;
    --bad: #ef6464;
    --warn: #e0a33a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--body);
}
main { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }
a { color: inherit; }
h1, h2 { font-family: var(--display); line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; font-weight: 700; }
code { font-size: 0.9em; background: var(--line); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.warn-text { color: var(--warn); font-weight: 600; }

/* ---------- üst çubuk */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1180px; margin: 0 auto; padding: 18px 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font: 700 1.15rem var(--display);
}
.brand svg { width: 26px; height: 26px; }
.brand svg rect { fill: var(--ink); }
.brand svg path { fill: var(--sun); }

/* ---------- butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: 600 0.95rem var(--body); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; background: transparent; color: var(--ink); }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }
.link.danger:hover { color: var(--bad); }

/* ---------- bildirimler */
.flash-wrap { max-width: 1180px; margin: 0 auto 8px; padding: 0 20px; }
.flash { margin: 0 0 8px; padding: 12px 16px; border-radius: var(--radius-s); background: var(--surface); border-left: 4px solid var(--ok); }
.flash.warn { border-left-color: var(--warn); }
.note { padding: 10px 14px; border-radius: var(--radius-s); background: var(--surface); border-left: 4px solid var(--warn); font-size: .95rem; }
.note.bad { border-left-color: var(--bad); }

/* ---------- durum etiketleri */
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; white-space: nowrap; vertical-align: middle;
  border: 1.5px solid currentColor;
}
.chip.ok { color: var(--ok); }
.chip.bad { color: var(--bad); }
.chip.test { color: var(--muted); }
.chip.run { color: var(--sea); }

/* ---------- dikey ekran (kahraman öğe) */
.phone {
  --c: var(--sea);
  position: relative; aspect-ratio: 9 / 16; width: 100%;
  background: var(--bezel); border-radius: 26px; padding: 8px;
  box-shadow: 0 0 0 3px var(--c), 0 18px 40px -18px rgba(10, 15, 30, .45);
}
.phone.sun { --c: var(--sun); }
.phone.sea { --c: var(--sea); }
.phone.plum { --c: var(--plum); }
.phone video, .phone-empty {
  display: block; width: 100%; height: 100%; border-radius: 19px; background: #000; object-fit: cover;
}
.phone-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: repeating-linear-gradient(135deg, #222a3b 0 12px, #1d2433 12px 24px); color: #8f9ab0;
}
.phone-empty svg { width: 46px; height: 46px; fill: var(--c); }
.phone-empty p { margin: 0; font-size: .9rem; }

/* ---------- ana sayfa */
.intro { padding: 24px 0 36px; max-width: 62ch; }
.intro p { color: var(--muted); margin: 10px 0 0; }

.wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; align-items: start; }
.screen .phone { max-width: 300px; }
.screen-info { margin-top: 22px; max-width: 300px; }
.screen-info h2 a { text-decoration: none; }
.screen-info h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.kind { margin: 2px 0 0; color: var(--muted); }
.facts { margin: 16px 0 18px; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); white-space: nowrap; }
.facts dd { margin: 0; text-align: right; }
.screen.paused .phone { filter: grayscale(.85); opacity: .7; }
.live { color: var(--sea); font-weight: 600; }

/* ---------- kanal sayfası */
.back { display: inline-block; margin: 6px 0 18px; color: var(--muted); text-decoration: none; }
.back::before { content: "‹ "; }
.back:hover { color: var(--ink); }

.ch-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 22px; border-bottom: 3px solid var(--sea); }
.ch-head.sun { border-color: var(--sun); }
.ch-head.plum { border-color: var(--plum); }

.switch {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  background: none; border: 0; padding: 0; color: var(--ink); font: 600 .95rem var(--body); cursor: pointer;
}
.switch .knob { position: relative; width: 46px; height: 26px; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch.on .knob { background: var(--ok); }
.switch.on .knob::after { transform: translateX(20px); }

.studio { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 48px; padding: 32px 0 40px; align-items: start; }
.stage .phone.big { max-width: 340px; }
.caption { margin-top: 18px; }
.caption p { margin: 0 0 4px; }
.cap-topic { font: 700 1.1rem var(--display); }
.ext { display: inline-block; margin-top: 6px; font-weight: 600; }

.actions { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.actions form { display: flex; flex-wrap: wrap; gap: 10px; }
.hint { color: var(--muted); font-size: .93rem; margin: 12px 0 0; max-width: 60ch; }
.running { display: flex; align-items: center; gap: 12px; margin: 0; font-weight: 500; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--sea); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31,111,209,.5); } 50% { box-shadow: 0 0 0 9px rgba(31,111,209,0); } }

.side h2 { margin-bottom: 12px; }
.history { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow-y: auto; }
.history li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.history li a { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 11px 6px; text-decoration: none; }
.history li a:hover .h-topic { text-decoration: underline; }
.history li.sel { background: var(--surface); border-radius: var(--radius-s); }
.h-topic { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-meta { color: var(--muted); font-size: .88rem; }
.history .chip { margin-right: 6px; }
.empty { color: var(--muted); }

.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 24px; }
.card { background: var(--surface); border-radius: var(--radius-m); padding: 24px; }
.card h2 { margin-bottom: 14px; }
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .93rem; }
input, select {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: var(--paper); color: var(--ink); font: inherit;
}
input:focus, select:focus { border-color: var(--sea); outline: none; }
input[type=file] { padding: 9px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card .btn { margin-top: 20px; }
.music { list-style: none; padding: 0; margin: 0 0 6px; }
.music li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.music li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.upload input { flex: 1; min-width: 200px; }
.upload .btn { margin-top: 0; }
.field-error { color: var(--bad); margin: 8px 0 0; }

/* ---------- giriş */
.login { display: grid; grid-template-columns: auto minmax(0, 360px); gap: 56px; align-items: center; justify-content: center; min-height: 70vh; }
.login-phone { display: flex; gap: 14px; }
.login-phone span { width: 74px; aspect-ratio: 9/16; border-radius: 14px; background: var(--bezel); box-shadow: 0 0 0 3px var(--sun); }
.login-phone span:nth-child(2) { box-shadow: 0 0 0 3px var(--sea); transform: translateY(-18px); }
.login-phone span:nth-child(3) { box-shadow: 0 0 0 3px var(--plum); }
.login-form h1 { font-size: 2.2rem; margin-bottom: 8px; }
.login-form .btn { margin-top: 18px; width: 100%; }

/* ---------- mobil */
@media (max-width: 900px) {
  .wall {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; gap: 22px; padding-bottom: 12px;
    margin: 0 -20px; padding-left: 20px; padding-right: 20px;
  }
  .screen { scroll-snap-align: start; }
  .screen .phone, .screen-info { max-width: none; }
  .studio { grid-template-columns: 1fr; gap: 30px; }
  .stage .phone.big { max-width: 300px; margin: 0 auto; }
  .caption { text-align: center; }
  .history { max-height: none; }
  .login { grid-template-columns: 1fr; gap: 28px; }
  .login-phone { justify-content: center; }
}
@media (max-width: 480px) {
  main, .top, .flash-wrap { padding-left: 16px; padding-right: 16px; }
  .wall { margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding-inline: 16px; }
  .row { grid-template-columns: 1fr; }
  .actions form .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
