/* ═══════════════════════════════════════════════════════════════════
   MendorhanCasting — Design System
   Dark theme, gold accent, professional dubbing studio UI
═══════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Layout ───────────────────────────────────────────────── */
.layout-topnav {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.icerik, .page-content {
  flex: 1;
  padding: 24px 28px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ── Typography ───────────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 800; color: var(--txt); }
h2 { font-size: 17px; font-weight: 700; color: var(--txt); }
h3 { font-size: 14px; font-weight: 700; color: var(--txt); }
p  { color: var(--txt2); line-height: 1.6; }

.ph-baslik { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.ph-alt    { font-size: 12.5px; color: var(--txt3); margin-top: 3px; }

/* ── Page Header ──────────────────────────────────────────── */
.ph {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.ph-sol { flex: 1; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  transition: border-color .15s;
}
.card:hover { border-color: var(--border2); }
.card-title, .card-hd {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sc, var(--gold));
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border2); }
.stat-icon  { font-size: 22px; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--sc, var(--gold)); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11.5px; color: var(--txt3); margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}
.btn-gold    { background: var(--gold); color: #000; border-color: var(--gold); }
.btn-gold:hover { background: #e08e00; border-color: #e08e00; }
.btn-blue    { background: var(--blue); color: #fff; }
.btn-blue:hover  { background: #2563eb; }
.btn-green   { background: var(--green); color: #fff; }
.btn-red     { background: var(--red); color: #fff; }
.btn-ghost   { background: transparent; color: var(--txt2); border-color: var(--border2); }
.btn-ghost:hover { background: var(--bg3); color: var(--txt); }
.btn-sm      { padding: 5px 10px; font-size: 11.5px; }
.btn-lg      { padding: 11px 22px; font-size: 14px; }
.btn-icon    { padding: 7px; aspect-ratio: 1; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ────────────────────────────────────────────────── */
.fg  { display: flex; flex-direction: column; margin-bottom: 12px; }
.fl  { font-size: 11.5px; font-weight: 600; color: var(--txt2); margin-bottom: 5px; letter-spacing: .2px; }
.fi, .fsel, .fta {
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--txt);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.fi:focus, .fsel:focus, .fta:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.fi::placeholder { color: var(--txt4); }
.fta { resize: vertical; min-height: 80px; }
.fsel { appearance: none; cursor: pointer; }
.fld  { margin-bottom: 12px; }
.fld label { display: block; font-size: 11.5px; font-weight: 600; color: var(--txt2); margin-bottom: 5px; }
.fg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fg-3    { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── Tables ───────────────────────────────────────────────── */
.tablo {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tablo thead tr { background: var(--bg2); }
.tablo thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--txt3);
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.tablo tbody tr {
  border-top: 1px solid var(--border);
  transition: background .1s;
}
.tablo tbody tr:hover { background: rgba(255,255,255,.02); }
.tablo td { padding: 10px 14px; color: var(--txt2); vertical-align: middle; }
.tablo td:first-child { color: var(--txt); font-weight: 600; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.b-gold   { background: var(--gold-dim);   color: var(--gold);   border: 1px solid var(--gold-brd); }
.b-blue   { background: var(--blue-bg);    color: var(--blue);   border: 1px solid var(--blue-brd); }
.b-green  { background: var(--green-bg);   color: var(--green);  border: 1px solid var(--green-brd); }
.b-red    { background: var(--red-bg);     color: var(--red);    border: 1px solid var(--red-brd); }
.b-purple { background: var(--purple-bg);  color: var(--purple); border: 1px solid var(--purple-brd); }
.b-cyan   { background: rgba(6,182,212,.1); color: var(--cyan);  border: 1px solid rgba(6,182,212,.25); }
.b-gray   { background: var(--bg3);        color: var(--txt3);   border: 1px solid var(--border2); }

/* ── Alerts & Flash ───────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-basari { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-brd); }
.alert-hata   { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-brd); }
.alert-bilgi  { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue-brd); }
.alert-uyari  { background: var(--gold-dim);  color: var(--gold);   border: 1px solid var(--gold-brd); }

.flash-container { margin-bottom: 16px; }
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  border: 1px solid;
}
.flash-basari { background: var(--green-bg);  color: var(--green);  border-color: var(--green-brd); }
.flash-hata   { background: var(--red-bg);    color: var(--red);    border-color: var(--red-brd); }
.flash-bilgi  { background: var(--blue-bg);   color: var(--blue);   border-color: var(--blue-brd); }
.flash-uyari  { background: var(--gold-dim);  color: var(--gold);   border-color: var(--gold-brd); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.aktif { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(16px) scale(.97);
  transition: transform .2s, opacity .2s;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.modal-overlay.aktif .modal { transform: none; }
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-hd h3 { font-size: 15px; font-weight: 700; }
.modal-body  { padding: 20px; }
.modal-ft    { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Drawer ───────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.drawer-overlay.aktif { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 95vw;
  background: var(--card);
  border-left: 1px solid var(--border2);
  z-index: 901;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 60px rgba(0,0,0,.4);
}
.drawer.aktif  { transform: none; }
.drawer-hd     { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-hd h3  { font-size: 15px; font-weight: 700; }
.drawer-body   { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-ft     { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-shrink: 0; }

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  pointer-events: auto;
  animation: toastIn .25s ease;
  border: 1px solid;
}
.toast-basari { background: #052e16; color: var(--green); border-color: var(--green-brd); }
.toast-hata   { background: #1f0808; color: var(--red);   border-color: var(--red-brd); }
.toast-bilgi  { background: #0c1a2e; color: var(--blue);  border-color: var(--blue-brd); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab {
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px 6px 0 0;
  text-decoration: none;
  color: var(--txt3);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.tab:hover { color: var(--txt); }
.tab.aktif {
  background: var(--bg2);
  color: var(--gold);
  border-color: var(--border);
}

/* ── Lists ────────────────────────────────────────────────── */
.liste { list-style: none; }
.liste-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.liste-item:last-child { border-bottom: none; }
.liste-ikon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

/* ── Progress ─────────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--gold);
  transition: width .4s ease;
}

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 2px solid var(--gold-brd);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--gold);
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }

/* ── Divider ──────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Empty State ──────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--txt3);
}
.empty-ikon { font-size: 40px; margin-bottom: 12px; opacity: .6; }
.empty h3   { font-size: 15px; color: var(--txt2); margin-bottom: 6px; }
.empty p    { font-size: 13px; }

/* ── Loading ──────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}

/* ── Grid Helpers ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 14px; }

/* ── Flex Helpers ─────────────────────────────────────────── */
.flex       { display: flex; }
.flex-center{ display: flex; align-items: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col   { display: flex; flex-direction: column; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ── Spacing Helpers ──────────────────────────────────────── */
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.p-0   { padding: 0 !important; }

/* ── Text Helpers ─────────────────────────────────────────── */
.txt-gold   { color: var(--gold); }
.txt-blue   { color: var(--blue); }
.txt-green  { color: var(--green); }
.txt-red    { color: var(--red); }
.txt-muted  { color: var(--txt3); }
.txt-sm     { font-size: 11.5px; }
.txt-xs     { font-size: 10.5px; }
.font-bold  { font-weight: 700; }
.font-mono  { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--txt4); }

/* ── Breadcrumb ───────────────────────────────────────────── */
#breadcrumb, .tnav-breadcrumb {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 7px 20px;
  font-size: 12px;
  color: var(--txt3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.bc-sep, .tnav-bc-sep  { color: var(--txt4); }
.bc-link, .tnav-bc-link { color: var(--txt3); text-decoration: none; }
.bc-link:hover          { color: var(--txt); }
.tnav-bc-aktif          { color: var(--txt); font-weight: 600; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .icerik, .page-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .fg-grid, .fg-3 { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .ph { flex-direction: column; gap: 10px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 18px; }
}

/* ── Senaryo metin boyutları ─────────────────── */
.metin-kaynak{font-size:10px;color:var(--txt4,#64748b);font-style:italic;line-height:1.4;margin-bottom:3px}
.metin-hedef{font-size:18px;font-weight:700;color:#fff;line-height:1.6;letter-spacing:.2px}
/* Boyut seçenekleri — kullanıcı tercihi */
.metin-hedef.boyut-kucuk{font-size:14px;font-weight:600}
.metin-hedef.boyut-normal{font-size:18px}
.metin-hedef.boyut-buyuk{font-size:22px}
.metin-hedef.boyut-cok-buyuk{font-size:28px;line-height:1.5}
.metin-hedef.boyut-dev{font-size:36px;line-height:1.4}
.metin-kaynak.boyut-kucuk{font-size:9px}
.metin-kaynak.boyut-normal{font-size:10px}
.metin-kaynak.boyut-buyuk{font-size:12px}
.metin-kaynak.boyut-cok-buyuk{font-size:13px}
.metin-kaynak.boyut-dev{font-size:14px}

/* ── Çeviri Asistanı Panel ─────────────────── */
.ca-panel{position:absolute;right:-280px;top:0;width:270px;background:#0b1120;border:1px solid #1e2d50;border-radius:10px;box-shadow:0 8px 32px rgba(0,0,0,.4);z-index:50;font-size:12px;max-height:350px;overflow:hidden;display:flex;flex-direction:column;animation:caSlide .15s ease}
@keyframes caSlide{from{opacity:0;transform:translateX(-8px)}to{opacity:1;transform:translateX(0)}}
@media(max-width:1200px){.ca-panel{right:0;top:100%;margin-top:6px;width:100%}}
.ca-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#0e1628;border-bottom:1px solid #1e2d50;font-size:11px;font-weight:700;color:#f59e0b;flex-shrink:0}
.ca-spinner{width:12px;height:12px;border:2px solid rgba(245,158,11,.2);border-top-color:#f59e0b;border-radius:50%;animation:spin .7s linear infinite;display:none}
.ca-icerik{flex:1;overflow-y:auto;padding:4px}
.ca-bos{padding:16px;text-align:center;color:#3a5070;font-size:11px}
.ca-loading{padding:12px;text-align:center;color:#3a5070;font-size:11px}
.ca-oneri{padding:8px 10px;border-radius:6px;cursor:pointer;transition:background .1s;margin-bottom:2px;border:1px solid transparent}
.ca-oneri:hover{background:rgba(245,158,11,.06);border-color:rgba(245,158,11,.2)}
.ca-oneri-ust{display:flex;align-items:center;gap:5px;margin-bottom:3px}
.ca-tip{font-size:11px}
.ca-kaynak{font-size:10px;color:#5070a0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ca-guven{font-size:9px;font-weight:700}
.ca-hedef{font-size:13px;font-weight:600;color:#e2e8f0;line-height:1.4}
.ca-alt{display:flex;gap:8px;margin-top:3px;font-size:9px;color:#3a5070}
.ca-kullanim{opacity:.7}
.ca-baglam{color:#5070a0;font-style:italic}
