/* Görsel dil: açık, yumuşak renk lekeli zemin; yarı saydam cam kartlar; hap düğmeler; hardal ve çam yeşili vurgu */
:root {
  --font: "Urbanist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f1f2ef;
  --text: #16191d;
  --muted: #5b6064;
  --faint: #696e72;
  --ink: #16191d;
  --on-ink: #f6f7f5;
  --glass: rgba(255, 255, 255, 0.52);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --rim: rgba(255, 255, 255, 0.82);
  --line: rgba(22, 26, 30, 0.09);
  --line-2: rgba(22, 26, 30, 0.16);
  --well: rgba(22, 26, 30, 0.06);
  --field: rgba(255, 255, 255, 0.7);
  --butter: #f2b740;
  --on-butter: #16191d;
  --pine: #11745a;
  --on-pine: #f6f7f5;
  --pine-soft: rgba(17, 116, 90, 0.12);
  --coral: #c43c30;
  --coral-soft: rgba(196, 60, 48, 0.12);
  --warn: #855c00;
  --butter-soft: rgba(242, 183, 64, 0.22);
  --sea: #1f68a8;
  --sea-soft: rgba(31, 104, 168, 0.12);
  --mesh-a: #cde9e4;
  --mesh-b: #f3e3c8;
  --mesh-c: #d3e6f3;
  --r-card: 26px;
  --r-tile: 22px;
  --r-ctl: 999px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 24px 48px -30px rgba(30, 40, 45, 0.28);
  --shadow-pop: 0 24px 60px -18px rgba(20, 24, 28, 0.3), 0 2px 6px rgba(20, 24, 28, 0.08);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --n-instagram: #c13584;
  --n-facebook: #1665d8;
  --n-youtube: #d61f1f;
  --n-tiktok: #16191d;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101214;
    --text: #eef0ee;
    --muted: #a6abaa;
    --faint: #868b8a;
    --ink: #eef0ee;
    --on-ink: #16191d;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-strong: #212428;
    --rim: rgba(255, 255, 255, 0.07);
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.16);
    --well: rgba(255, 255, 255, 0.06);
    --field: rgba(255, 255, 255, 0.05);
    --pine: #1a8a6c;
    --pine-soft: rgba(26, 138, 108, 0.2);
    --coral: #e0705f;
    --coral-soft: rgba(200, 64, 47, 0.2);
    --warn: #f2c25f;
    --butter-soft: rgba(242, 183, 64, 0.16);
    --sea: #5aa0dc;
    --sea-soft: rgba(35, 112, 179, 0.22);
    --mesh-a: rgba(11, 122, 135, 0.3);
    --mesh-b: rgba(242, 183, 64, 0.12);
    --mesh-c: rgba(31, 104, 168, 0.3);
    --n-tiktok: #eef0ee;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 48px -30px rgba(0, 0, 0, 0.7);
    --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font: 500 16px/1.45 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--sea); }
h1, h2 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(28px, 3vw, 38px); font-weight: 600; line-height: 1.05; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--coral); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Arka plan lekeleri */
.mesh { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.mesh span { position: absolute; border-radius: 50%; filter: blur(60px); }
.mesh-a { width: 60vw; height: 60vw; left: -18vw; top: -22vw; background: radial-gradient(closest-side, var(--mesh-a), transparent); }
.mesh-b { width: 55vw; height: 55vw; right: -14vw; bottom: -20vw; background: radial-gradient(closest-side, var(--mesh-b), transparent); }
.mesh-c { width: 50vw; height: 50vw; right: 8vw; top: -26vw; background: radial-gradient(closest-side, var(--mesh-c), transparent); }

/* Cam yüzeyler */
.glass, .panel, .item, .account, .stat {
  background: var(--glass);
  border: 1px solid var(--rim);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.panel { border-radius: var(--r-card); padding: 20px; }
.ink-panel { background: #16191d; border-color: #16191d; color: #e6e8e4; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* Marka */
.brand { display: flex; align-items: center; gap: 12px; }
.mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: #16191d; color: #f6f7f5; }
.mark svg { width: 22px; height: 22px; }
.wordmark { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; white-space: nowrap; }
.wordmark em { font-style: normal; font-weight: 500; color: var(--muted); }

/* Üst çubuk */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  max-width: 1320px; margin: 0 auto; padding: 18px clamp(16px, 3vw, 40px);
}
.tabs { display: flex; gap: 4px; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 9px 16px; border-radius: var(--r-ctl);
  color: var(--text); text-decoration: none; white-space: nowrap; font-size: 15px; font-weight: 600;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.tabs a:hover { background: var(--well); }
.tabs a.active { background: #16191d; color: #f6f7f5; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: var(--r-ctl); background: var(--glass-strong); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.chip.on { color: var(--pine); }
.chip.on::before { background: var(--pine); box-shadow: 0 0 0 3px var(--pine-soft); }

.job-bar {
  position: sticky; top: 80px; z-index: 15;
  display: flex; align-items: center; gap: 10px; width: fit-content; margin: 0 auto 8px;
  padding: 8px 16px; border-radius: var(--r-ctl); background: #16191d; color: #f6f7f5; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop);
}
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--butter); border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.flash {
  position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 16px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-pop);
}
.flash.ok { background: #16191d; color: #f6f7f5; }
.flash.err { background: var(--coral); color: #fff; }

.tab { max-width: 1320px; margin: 0 auto; padding: 8px clamp(16px, 3vw, 40px) 48px; }
.page-head { display: grid; gap: 6px; margin: 12px 0 24px; }

/* Düğmeler ve alanlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.ink { background: #16191d; color: #f6f7f5; }
.btn.ink:hover { background: #2a2f35; }
.btn.pine { background: var(--pine); color: var(--on-pine); }
.btn.pine:hover { filter: brightness(1.08); }
.btn.plain { background: var(--glass); border-color: var(--line-2); color: var(--text); }
.btn.plain:hover { border-color: var(--text); }
.btn.danger { color: var(--coral); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tabs a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--sea); outline-offset: 2px;
}

input, select, textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--field); color: var(--text); font: 500 15px/1.4 var(--font);
}
select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; min-height: 110px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 600; }
label.check input { width: 18px; height: 18px; accent-color: var(--pine); }

/* Giriş */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 16px; border-radius: var(--r-card); padding: 32px; }

/* Selamlama ve özet */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 20px 24px; align-items: center; margin: 12px 0 24px; }
.stats { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: var(--r-tile); min-width: 0; }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--line); color: var(--text); }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; display: flex; align-items: center; gap: 8px; }
.stat-label { font-size: 13px; color: var(--muted); line-height: 1.25; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-ctl); background: var(--pine); color: var(--on-pine); }

.warnings { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.warnings li { display: flex; gap: 10px; align-items: center; background: var(--butter-soft); color: var(--warn); padding: 10px 16px; border-radius: 16px; font-size: 14px; font-weight: 600; }
.warnings li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--butter); flex: none; }

.actions-card { margin-bottom: 24px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gen-options { margin-top: 14px; }
.gen-options summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; width: fit-content; }
.gen-options[open] summary { margin-bottom: 4px; }
.options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 12px 0; align-items: end; }

/* Video kartları */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 16px; }
.item { display: grid; grid-template-columns: 190px 1fr; gap: 18px; border-radius: var(--r-card); padding: 16px; align-items: start; }
.item.dim { opacity: 0.55; }
.item video, .item .no-video { width: 100%; aspect-ratio: 9 / 16; border-radius: 18px; background: #16191d; object-fit: cover; }
.item .no-video { display: grid; place-items: center; color: #8b9094; font-size: 13px; }
.item-body { display: grid; gap: 12px; align-content: start; min-width: 0; }
.item-head { display: grid; gap: 8px; }
.item-title { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; line-height: 1.25; }
.item-meta { color: var(--muted); font-size: 13px; }
.item-meta a { color: inherit; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-ctl); background: var(--well); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--pine-soft); color: var(--pine); }
.badge.err { background: var(--coral-soft); color: var(--coral); }
.badge.warn { background: var(--butter); color: var(--on-butter); }
.badge.accent { background: var(--sea-soft); color: var(--sea); }

.platforms { display: grid; gap: 2px; padding: 6px; border-radius: 18px; background: var(--well); }
.platform-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 6px 8px; font-size: 14px; font-weight: 600; }
.platform-row strong { min-width: 92px; }
.platform-row .btn { margin-left: auto; }
.platform-row .pmsg { flex-basis: 100%; padding-left: 16px; }
.platform-row strong { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.platform-row strong::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--faint)); }
.platform-row[data-p="instagram"] { --dot: var(--n-instagram); }
.platform-row[data-p="facebook"] { --dot: var(--n-facebook); }
.platform-row[data-p="youtube"] { --dot: var(--n-youtube); }
.platform-row[data-p="tiktok"] { --dot: var(--n-tiktok); }
.platform-row .perr { color: var(--coral); font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.platform-row a { overflow-wrap: anywhere; font-size: 13px; }

.item-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.schedule { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.schedule input { width: auto; padding: 6px 12px; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* Hesaplar */
.accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.account { border-radius: var(--r-card); padding: 20px; display: grid; gap: 12px; align-content: start; }
.account .row { display: flex; gap: 8px; flex-wrap: wrap; }
.account .warnings { margin: 0; }
.copy { display: flex; gap: 6px; }
.copy input { font: 12px/1.4 ui-monospace, Consolas, monospace; }
.steps { padding-left: 20px; margin: 0; font-size: 14px; color: var(--muted); display: grid; gap: 4px; }

/* Ayarlar */
.settings-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.settings-nav { position: sticky; top: 90px; display: grid; gap: 2px; padding: 8px; border-radius: var(--r-tile); }
.settings-nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 14px; border: 0; border-radius: 14px; background: transparent;
  color: var(--text); font: 600 15px/1.2 var(--font); text-align: left; cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.settings-nav button:hover { background: var(--well); }
.settings-nav button.active { background: #16191d; color: #f6f7f5; }
.settings-nav button:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--butter); flex: none; }

.settings-body { border-radius: var(--r-card); padding: 24px; min-width: 0; }
.settings fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; align-items: start; }
.settings .fs-title { grid-column: 1 / -1; padding-bottom: 14px; font-size: 20px; letter-spacing: -0.015em; border-bottom: 1px solid var(--line); }
/* Uzun alanlar iki sütuna yayılır */
.settings .field-textarea, .settings .field-multi, .settings .field-bool, .settings .field-wide { grid-column: 1 / -1; }
.settings .help { font-size: 12.5px; color: var(--faint); margin-top: 6px; font-weight: 500; line-height: 1.4; }
.settings .multi { display: flex; flex-wrap: wrap; gap: 8px; }
.settings .multi label.check { padding: 8px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--field); font-size: 14px; cursor: pointer; }
.settings .multi label.check:has(input:checked) { border-color: var(--pine); background: var(--pine-soft); color: var(--pine); }
.settings .field-bool label.check { padding: 14px 16px; border-radius: 16px; background: var(--well); font-size: 15px; }
.secret-row { display: flex; gap: 6px; }
.save-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

.media-panel { display: grid; gap: 28px; }
.media-panel section + section { padding-top: 24px; border-top: 1px solid var(--line); }
.media-panel h2 { font-size: 20px; letter-spacing: -0.015em; margin-bottom: 4px; }

.file-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--well); font-size: 14px; }
.upload { cursor: pointer; }
.logo-box { margin: 12px 0; }
.logo-box img { max-width: 240px; max-height: 80px; background: repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 10px; }

.logs { margin: 0; max-height: 70vh; overflow: auto; font: 12.5px/1.65 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .btn, .tabs a { transition: none; }
}


@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; gap: 10px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .wordmark { font-size: 17px; }
  .chip { padding: 6px 10px; font-size: 12px; }
  .topbar-right { gap: 6px; }
  .mark { width: 38px; height: 38px; border-radius: 11px; }
  .job-bar { top: 120px; }
  .item { grid-template-columns: 1fr; }
  .item video, .item .no-video { max-height: 62vh; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; border-radius: var(--r-ctl); padding: 6px; }
  .settings-nav button { flex: none; padding: 9px 14px; border-radius: var(--r-ctl); white-space: nowrap; font-size: 14px; }
  .settings-body { padding: 18px; }
  .settings fieldset { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 10px; gap: 10px; }
  .stat-value { font-size: 19px; }
}

/* Çok dar ekranda otomasyon durumu yalnız renkli nokta olarak kalır (metin ekran okuyucuya açık); 760px kuralından sonra gelmeli */
@media (max-width: 440px) {
  .chip { width: 30px; height: 30px; padding: 0; justify-content: center; font-size: 0; }
  .chip::before { width: 9px; height: 9px; }
  .wordmark em { display: none; }
}
