/* ---------------------------------------------------------- tema jetonları */

:root {
  --bg: #090f16;
  --surface: #161c24;
  --sunken: #0b121a;
  --hover: #1a232e;
  --border: #273342;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #10b981;
  --accent-strong: #059669;
  --accent-text: #34d399;
  --accent-soft: rgba(16, 185, 129, .14);
  --accent-line: rgba(16, 185, 129, .34);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, .14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --danger: #fb7185;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* Konsol kilitliyken kapı JS yüklenmeden de görünsün; yayın TV sayfası bu sınıfı almaz. */
html.locked #gate { display: flex !important; }

/* Yayın ekranı: yalnızca slayt, çerçeve ve konsol yok. */
html.tv header,
html.tv #gate,
html.tv #kiosk-chrome,
html.tv #kiosk-footer,
html.tv #onair-banner,
html.tv #toast-root { display: none !important; }
html.tv body { background: #000; }
html.tv #kiosk-workspace {
  display: flex !important;
  position: fixed;
  inset: 0;
  padding: 0;
  z-index: 80;
  background: #000;
}
html.tv #kiosk-vessel {
  width: 100%;
  height: 100%;
  max-width: none;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  box-shadow: none;
}

html.light {
  --bg: #eef2f7;
  --surface: #ffffff;
  --sunken: #f5f7fa;
  --hover: #f1f5f9;
  --border: #dde5ee;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #059669;
  --accent-strong: #047857;
  --accent-text: #047857;
  --accent-soft: rgba(5, 150, 105, .1);
  --accent-line: rgba(5, 150, 105, .28);
  --info: #0284c7;
  --info-soft: rgba(2, 132, 199, .1);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, .1);
  --danger: #be123c;
  --shadow: 0 18px 40px -22px rgba(15, 23, 42, .35);
  color-scheme: light;
}

/* TV çıktısı her iki temada da koyu kalır — gerçek ekranlarda okunaklı olan bu. */
.tv {
  --surface: #161c24;
  --sunken: #090f16;
  --hover: #1a232e;
  --border: #273342;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent-text: #34d399;
  --info: #38bdf8;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ temel  */

html, body { background: var(--bg); color: var(--text); }
body { transition: background-color .25s ease, color .25s ease; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.aspect-16-9 { aspect-ratio: 16 / 9; }

input, select, textarea { color-scheme: inherit; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }
html.light input[type="date"]::-webkit-calendar-picker-indicator,
html.light input[type="time"]::-webkit-calendar-picker-indicator { filter: none; }

/* -------------------------------------------------------------- animasyon  */

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.animate-fade-in { animation: fade-in .4s cubic-bezier(.22, 1, .36, 1) both; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.animate-toast-in { animation: toast-in .25s ease-out both; }

.cycle-bar { transition: width 1s linear; }

/* ------------------------------------------------------------ 16:9 ekran  */

/*
 * Aynı slayt işaretlemesi hem küçük önizlemede hem tam ekran kioskta kullanılır.
 * Yazı boyutları çerçeve genişliğine (cqw) bağlandığı için her iki yerde de
 * aynı oranda görünür; ayrı bir "küçük" sürüm yazmaya gerek kalmaz.
 */
/*
 * --s     : yazı ölçeği. Operatör her tasarım için büyütüp küçültebilir.
 * --safe-*: güvenli alan. Televizyonlar kenarlardan bir miktar kırptığı için
 *           hiçbir yazı bu çerçevenin dışına taşmaz (yatay %5.5, dikey %5.7).
 *           Yalnızca zemin, şerit bant ve tam ekran görseller kenara dayanır.
 */
.screen {
  container-type: size;
  --s: 1;
  --safe-x: 5.5cqw;
  --safe-y: 3.2cqw;
}
.screen .s-tag   { font-size: calc(2.1cqw * var(--s)); letter-spacing: .12em; }
.screen .s-title { font-size: calc(7.4cqw * var(--s)); line-height: 1.05; }
.screen .s-desc  { font-size: calc(2.9cqw * var(--s)); line-height: 1.5; }
.screen .s-meta  { font-size: calc(2.6cqw * var(--s)); }
.screen .s-chrome { font-size: calc(1.9cqw * var(--s)); }
.screen .s-safe  { padding: var(--safe-y) var(--safe-x); }
.screen .s-gap   { gap: 2.4cqw; }

/*
 * Güvenli alan kılavuzu. Konsoldan açıldığında tüm önizlemelerde ve kioskta
 * kesikli çerçeve belirir; içerik yeniden çizilse de kaybolmaması için
 * çerçevenin kendisi değil kapsayıcı işaretlenir.
 */
html.safe-on .screen::after {
  content: '';
  position: absolute;
  inset: var(--safe-y) var(--safe-x);
  border: 1px dashed rgba(56, 189, 248, .55);
  border-radius: 1cqw;
  pointer-events: none;
  z-index: 60;
}
html.safe-on .screen::before {
  content: 'GÜVENLİ ALAN';
  position: absolute;
  top: var(--safe-y);
  left: var(--safe-x);
  transform: translateY(-120%);
  font-size: 1.5cqw;
  letter-spacing: .28em;
  color: rgba(56, 189, 248, .8);
  pointer-events: none;
  z-index: 60;
}

/* Namaz, abdest ve kapanış ekranlarında daha yumuşak bir tipografi. */
.s-serif { font-family: 'Lora', Georgia, 'Times New Roman', serif; }

/* Ayet ekranındaki Uthmânî hat */
.s-arabic {
  font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
  direction: rtl;
  line-height: 1.9;
}
.screen .s-eyebrow { font-size: calc(2.2cqw * var(--s)); letter-spacing: .42em; font-weight: 500; }
.screen .s-hero    { font-size: calc(9cqw * var(--s)); line-height: 1; font-weight: 500; }
.screen .s-lead    { font-size: calc(3.2cqw * var(--s)); line-height: 1.6; font-weight: 400; }
.screen .s-rule    { display: block; width: 14cqw; height: 1px; }

/* Uyarı ekranlarındaki şerit bant */
.hazard {
  background-image: repeating-linear-gradient(
    -45deg, var(--warn) 0 1.4cqw, transparent 1.4cqw 2.8cqw);
}

/* --------------------------------------------------------- sürükle bırak  */

.row-dragging { opacity: .4; }
.row-drop-target { box-shadow: inset 0 2px 0 0 var(--accent); }
.drag-handle { cursor: grab; }
.drag-handle:active { cursor: grabbing; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------- telefon konsolu  */

@media (max-width: 1023px) {
  html:not(.tv) header {
    height: auto;
    min-height: 3.75rem;
    padding: .65rem .85rem;
    padding-top: calc(.65rem + env(safe-area-inset-top));
    flex-wrap: wrap;
    gap: .55rem;
  }
  html:not(.tv) header .mode-btn span { display: none; }
  html:not(.tv) #onair-banner { max-width: 100%; }
  html:not(.tv) #admin-workspace { position: relative; }
  html:not(.tv) #admin-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    width: min(18rem, 86vw);
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
    padding-top: calc(.75rem + env(safe-area-inset-top));
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom));
  }
  html.nav-open:not(.tv) #admin-nav { transform: none; }
  html.nav-open:not(.tv) #nav-backdrop { display: block; }
  html:not(.tv) main {
    padding: 1rem .9rem calc(1.25rem + env(safe-area-inset-bottom));
  }
  html:not(.tv) .tab-btn {
    min-height: 2.75rem;
    font-size: .95rem;
  }
  html:not(.tv) input,
  html:not(.tv) select,
  html:not(.tv) textarea {
    font-size: 16px;
  }
  html:not(.tv) #gate input { font-size: 16px; }
  html:not(.tv) #city-switch button {
    min-height: 2.25rem;
    padding-left: .9rem;
    padding-right: .9rem;
  }
}
