/* Sroway CDN Panel — marka: #1b1b1b koyu, #ebeae7 açık, altın gradyan #b88909→#edde5d (33°) */

:root {
  --bg: #131312;
  --surface: #1b1b1b;
  --surface-2: #232322;
  --surface-3: #2b2b29;
  --border: #2e2e2b;
  --border-strong: #3c3c38;
  --text: #ebeae7;
  --text-dim: #a5a49e;
  --text-faint: #6f6e69;
  --gold-1: #b88909;
  --gold-2: #edde5d;
  --gold: #d4af37;
  --gold-grad: linear-gradient(33deg, var(--gold-1), var(--gold-2));
  --danger: #e5534b;
  --danger-dim: rgba(229, 83, 75, 0.12);
  --ok: #4caf7d;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

/* .btn-ghost gibi display tanımlayan sınıflar [hidden]'ı ezmesin */
[hidden] { display: none !important; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  background:
    radial-gradient(900px 420px at 50% -180px, rgba(184, 137, 9, 0.13), transparent 70%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

::selection { background: rgba(237, 222, 93, 0.25); }

h1, h2 { margin: 0; font-weight: 600; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Odak & hareket ---- */

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 2px;
  border-radius: 6px;
}

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

/* ---- Düğmeler ---- */

button, .btn-ghost, .btn-gold, .btn-danger {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
}

.btn-gold {
  background: var(--gold-grad);
  color: #1b1b1b;
  font-weight: 600;
  border: none;
  padding: 0.7rem 1.4rem;
  box-shadow: 0 4px 18px rgba(184, 137, 9, 0.28);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(184, 137, 9, 0.4); }
.btn-gold:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-ghost:hover { color: var(--text); border-color: var(--gold-1); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(229, 83, 75, 0.4);
  padding: 0.6rem 1.2rem;
}
.btn-danger:hover { background: var(--danger-dim); border-color: var(--danger); }

.btn-sm { padding: 0.45rem 0.95rem; font-size: 0.875rem; }

button:disabled { opacity: 0.45; cursor: default; transform: none !important; }

/* ---- Giriş ---- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.login-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 60%;
  background: radial-gradient(closest-side, rgba(184, 137, 9, 0.16), transparent);
  pointer-events: none;
}
.login-box {
  position: relative;
  width: min(380px, 100%);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.75rem 2.25rem 2.25rem;
  display: grid;
  gap: 1rem;
  justify-items: center;
  box-shadow: var(--shadow);
}
.login-box::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  padding: 1px;
  background: linear-gradient(160deg, rgba(237, 222, 93, 0.35), transparent 38%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.login-icon { width: 64px; height: auto; margin-bottom: 0.25rem; filter: drop-shadow(0 4px 18px rgba(184, 137, 9, 0.35)); }
.login-wordmark { width: 170px; height: auto; }
.login-sub {
  margin: -0.35rem 0 0.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.login-box input[type="password"],
.login-box input[type="text"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.login-box input::placeholder { color: var(--text-faint); }
.login-box input:focus {
  outline: none;
  border-color: var(--gold-1);
  box-shadow: 0 0 0 3px rgba(184, 137, 9, 0.22);
}

/* 2FA kod alanı */
.code-input {
  text-align: center;
  font-size: 1.7rem !important;
  font-weight: 600;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  padding: 0.7rem 0.5rem !important;
  font-variant-numeric: tabular-nums;
}
.code-input::placeholder { letter-spacing: 0.5em; opacity: 0.35; }

.login-help {
  margin: -0.25rem 0 0;
  color: var(--text-dim);
  font-size: 0.84rem;
  text-align: center;
}
.login-alt {
  color: var(--text-faint);
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.login-alt:hover { color: var(--text-dim); border-bottom-color: var(--border-strong); }
.login-box .btn-gold { width: 100%; }
.error { margin: 0; color: var(--danger); font-size: 0.875rem; }

/* ---- Üst çubuk ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(19, 19, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand-wordmark { width: 118px; height: auto; display: block; }
.brand-chip {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold-2);
  border: 1px solid rgba(184, 137, 9, 0.55);
  border-radius: 99px;
  padding: 0.14rem 0.55rem;
  translate: 0 1px;
}
.topnav { display: flex; align-items: center; gap: 0.35rem; }
.navlink {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-dim);
  font-size: 0.875rem;
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.navlink svg { width: 16px; height: 16px; flex-shrink: 0; }
.navlink:hover { color: var(--text); background: var(--surface-2); }
.navlink.active { color: var(--gold-2); border-color: rgba(184, 137, 9, 0.4); background: rgba(184, 137, 9, 0.08); }
.navlink.logout:hover { color: var(--text); border-color: var(--border-strong); }

/* ---- Profil sayfası ---- */

.page-title { font-size: 1.35rem; margin: 0 0 1.5rem; }

.banner {
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  border: 1px solid;
}
.banner-ok  { background: rgba(76, 175, 125, 0.1); border-color: rgba(76, 175, 125, 0.4); color: #8fdcb4; }
.banner-err { background: rgba(229, 83, 75, 0.1); border-color: rgba(229, 83, 75, 0.4); color: #f0a19b; }

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.card-panel h2 { font-size: 1.02rem; margin: 0; }
.card-panel h3 { font-size: 0.88rem; margin: 0 0 0.15rem; color: var(--text-dim); font-weight: 600; }
.muted { color: var(--text-faint); font-size: 0.85rem; margin: 0.25rem 0 0; }
.muted.small { font-size: 0.78rem; }

.status {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 99px;
  padding: 0.2rem 0.7rem;
  border: 1px solid;
}
.status-on  { color: #8fdcb4; border-color: rgba(76, 175, 125, 0.5); background: rgba(76, 175, 125, 0.12); }
.status-off { color: var(--text-faint); border-color: var(--border-strong); }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.stack { display: grid; gap: 0.45rem; align-content: start; }
.stack label { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.35rem; }
.stack input, .keyfield, .code-row input {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  width: 100%;
}
.stack input:focus, .keyfield:focus, .code-row input:focus {
  outline: none;
  border-color: var(--gold-1);
  box-shadow: 0 0 0 3px rgba(184, 137, 9, 0.18);
}
.stack button { justify-self: start; margin-top: 0.6rem; }

/* 2FA kurulum */
.setup-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}
.qr-box {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  line-height: 0;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.qr-box svg { display: block; width: 205px; height: 205px; }
.setup-steps ol { margin: 0 0 1rem; padding-left: 1.2rem; font-size: 0.9rem; }
.setup-steps li { margin-bottom: 0.4rem; }
.setup-steps li::marker { color: var(--gold-2); font-weight: 600; }

.manual { margin-bottom: 1.1rem; }
.manual summary, .danger-zone summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.3rem 0;
  user-select: none;
}
.manual summary:hover, .danger-zone summary:hover { color: var(--gold-2); }
.danger-zone { margin-top: 1.1rem; border-top: 1px solid var(--border); padding-top: 0.6rem; }
.danger-zone summary { color: var(--danger); }
.danger-zone .stack { max-width: 320px; margin-top: 0.5rem; }
.danger-zone .code-input {
  font-size: 1.15rem !important;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  max-width: 175px;
  padding: 0.55rem 0.5rem !important;
}

.keyrow { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.keyrow code {
  flex: 1;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--gold-2);
}
.keyfield {
  flex: 1;
  min-width: 220px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Sunucu yetenekleri tablosu */
.caps { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.caps tr + tr th, .caps tr + tr td { border-top: 1px solid var(--border); }
.caps th {
  text-align: left;
  font-weight: 400;
  color: var(--text-dim);
  padding: 0.55rem 1rem 0.55rem 0;
  width: 55%;
}
.caps td { padding: 0.55rem 0; color: var(--text); }
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 0.55rem;
  vertical-align: 1px;
}
.dot-ok   { background: var(--ok); }
.dot-warn { background: var(--gold-1); }
.dot-err  { background: var(--danger); }

.code-form { margin-top: 0.5rem; }
.code-form label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.code-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.code-row input { max-width: 190px; }
.code-row .code-input { font-size: 1.3rem !important; letter-spacing: 0.35em; text-indent: 0.35em; }

.inline-form { margin-top: 0.85rem; }
.linklike {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-faint);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linklike:hover { color: var(--text-dim); }

@media (max-width: 720px) {
  .setup-grid { grid-template-columns: 1fr; justify-items: center; }
  .qr-box svg { width: 190px; height: 190px; }
  .navlink span { display: none; }
  .navlink { padding: 0.45rem 0.6rem; }
}

/* ---- Panel ---- */

.panel {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
}

/* ---- Dropzone ---- */

.dropzone {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(560px 190px at 50% 0%, rgba(184, 137, 9, 0.07), transparent),
    var(--surface);
  text-align: center;
  padding: clamp(2rem, 5vw, 3.25rem) 1.5rem;
  cursor: pointer;
  transition: border-color 0.22s, background-color 0.22s, transform 0.22s var(--ease);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--gold-1); }
.dropzone.dragover {
  border-color: var(--gold-2);
  background-color: rgba(184, 137, 9, 0.06);
  transform: scale(1.008);
}
.dz-icon {
  width: 58px; height: 58px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #1b1b1b;
  box-shadow: 0 8px 26px rgba(184, 137, 9, 0.35);
  transition: transform 0.22s var(--ease);
}
.dz-icon svg { width: 26px; height: 26px; }
.dropzone:hover .dz-icon, .dropzone.dragover .dz-icon { transform: translateY(-3px); }
.dz-title { margin: 0; font-size: 1.12rem; font-weight: 600; }
.dz-sub { margin: 0.35rem 0 0; color: var(--text-faint); font-size: 0.86rem; }
.dz-browse {
  color: var(--gold-2);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Yükleme kuyruğu ---- */

.uploads { margin-top: 1rem; display: grid; gap: 0.55rem; }
.upload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.86rem;
  animation: rise 0.28s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.upload-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.upload-status { color: var(--text-dim); justify-self: end; display: flex; align-items: center; gap: 0.5rem; }
.upload-bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.upload-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--gold-grad);
  transition: width 0.18s ease-out;
}
.upload-row.done { border-color: rgba(76, 175, 125, 0.45); }
.upload-row.done .upload-bar i { background: var(--ok); }
.upload-row.failed { border-color: rgba(229, 83, 75, 0.5); }
.upload-row.failed .upload-status { color: var(--danger); }
.upload-row.failed .upload-bar i { background: var(--danger); }

/* ---- Kütüphane ---- */

.library { margin-top: 2.5rem; }
.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.library-head h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 0.55rem; }
.count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-2);
  background: rgba(184, 137, 9, 0.14);
  border: 1px solid rgba(184, 137, 9, 0.35);
  border-radius: 99px;
  padding: 0.1rem 0.55rem;
}
.searchbox {
  position: relative;
  display: flex;
  align-items: center;
}
.searchbox svg {
  position: absolute;
  left: 0.8rem;
  width: 15px; height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}
.searchbox input {
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.5rem 1rem 0.5rem 2.35rem;
  width: min(260px, 58vw);
  transition: border-color 0.18s, box-shadow 0.18s, width 0.25s var(--ease);
}
.searchbox input::placeholder { color: var(--text-faint); }
.searchbox input:focus {
  outline: none;
  border-color: var(--gold-1);
  box-shadow: 0 0 0 3px rgba(184, 137, 9, 0.18);
}

/* ---- Grid & kartlar ---- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
  animation: rise 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 137, 9, 0.5);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

/* Görsel tabağı açık tonda: CDN içeriğinin çoğu koyu logo/banner ya da
   şeffaf PNG olduğu için koyu zeminde görünmez kalıyordu. */
.card-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    repeating-conic-gradient(#ffffff 0% 25%, #dedcd8 0% 50%) 0 0 / 16px 16px;
  border: none;
  padding: 0;
  cursor: zoom-in;
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease-out, transform 0.35s var(--ease);
}
.card-thumb img.ready { opacity: 1; }
.card-thumb img.contain {
  object-fit: contain;
  padding: 8px;
}

/* Yükleniyor: dönen halka — "yükleniyor" ile "bozuk" karışmasın */
.card-thumb.loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2.5px solid rgba(27, 27, 27, 0.18);
  border-top-color: var(--gold-1);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Yüklenemedi */
.card-thumb.error::after {
  content: "Görsel yüklenemedi";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 12px;
  text-align: center;
  font-size: 0.76rem;
  color: #8a8580;
  background: var(--surface-2);
}
.card:hover .card-thumb img { transform: scale(1.045); }

.card-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  padding: 0.55rem;
  background: linear-gradient(transparent, rgba(10, 10, 9, 0.78));
  opacity: 0;
  translate: 0 6px;
  transition: opacity 0.2s, translate 0.2s var(--ease);
  pointer-events: none;
}
.card:hover .card-overlay,
.card:focus-within .card-overlay {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
}

.icon-btn {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(27, 27, 27, 0.85);
  color: var(--text);
  backdrop-filter: blur(6px);
  text-decoration: none;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { border-color: var(--gold-2); color: var(--gold-2); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.card-meta { padding: 0.7rem 0.85rem 0.8rem; min-width: 0; }
.card-name {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-sub {
  margin: 0.15rem 0 0;
  color: var(--text-faint);
  font-size: 0.74rem;
  display: flex;
  gap: 0.45rem;
}

/* ---- İskelet / boş durum ---- */

.skeleton {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.skeleton::before {
  content: "";
  display: block;
  aspect-ratio: 4 / 3;
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
}
.skeleton::after {
  content: "";
  display: block;
  height: 3.1rem;
}
@keyframes shimmer { to { background-position: -120% 0; } }

.empty {
  text-align: center;
  color: var(--text-faint);
  padding: 3.5rem 1rem;
}
.empty svg { width: 44px; height: 44px; margin-bottom: 0.75rem; opacity: 0.55; }
.empty p { margin: 0.15rem 0; }
.empty strong { color: var(--text-dim); font-weight: 600; }

.grid-footer { text-align: center; margin: 1.75rem 0 0.5rem; }

/* ---- Modal / lightbox ---- */

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.25rem; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 7, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade 0.2s ease-out;
}
@keyframes fade { from { opacity: 0; } }

.lightbox-body, .confirm-body {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: pop 0.24s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(8px); } }

.lightbox-body {
  width: min(880px, 100%);
  max-height: calc(100vh - 2.5rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-x {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  z-index: 2;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(27, 27, 27, 0.85);
  color: var(--text);
}
.modal-x svg { width: 16px; height: 16px; }
.modal-x:hover { border-color: var(--gold-2); color: var(--gold-2); }

.lightbox-stage {
  background:
    repeating-conic-gradient(#ffffff 0% 25%, #dedcd8 0% 50%) 0 0 / 20px 20px;
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 1rem;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: min(58vh, 560px);
  display: block;
  object-fit: contain;
}
.lightbox-meta { padding: 1.1rem 1.35rem 1.3rem; display: grid; gap: 0.55rem; }
.lb-name { margin: 0; font-weight: 600; word-break: break-all; }
.lb-info { margin: 0; color: var(--text-faint); font-size: 0.82rem; }
.lb-urlrow { display: flex; gap: 0.55rem; }
.lb-urlrow input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}
.lb-actions { display: flex; justify-content: flex-end; gap: 0.55rem; }

/* ---- GIF → AVIF onay modalı ---- */

.convert-body {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.6rem 1.4rem;
  animation: pop 0.24s var(--ease);
}
.convert-title { font-size: 1.08rem; margin: 0 0 0.25rem; }
.convert-sub { margin: 0 0 1.25rem; color: var(--text-faint); font-size: 0.85rem; }

.convert-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}
.cv-side { margin: 0; min-width: 0; }
.cv-side figcaption {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.cv-size { color: var(--gold-2); font-weight: 600; }
.cv-stage {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: repeating-conic-gradient(#fff 0% 25%, #dedcd8 0% 50%) 0 0 / 14px 14px;
  display: grid;
  place-items: center;
  min-height: 120px;
  max-height: 220px;
}
.cv-stage img { max-width: 100%; max-height: 220px; display: block; object-fit: contain; }
.cv-arrow { color: var(--gold-1); }
.cv-arrow svg { width: 26px; height: 26px; }

.cv-savings {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ok);
}
.cv-savings.negative { color: var(--danger); }

.cv-warning {
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  background: rgba(229, 83, 75, 0.1);
  border: 1px solid rgba(229, 83, 75, 0.4);
  color: #f0a19b;
}
.cv-warning.ok {
  background: rgba(76, 175, 125, 0.1);
  border-color: rgba(76, 175, 125, 0.4);
  color: #8fdcb4;
}

.cv-ack {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.9rem;
  font-size: 0.86rem;
  color: var(--text-dim);
  cursor: pointer;
}
.cv-ack input { width: 17px; height: 17px; accent-color: var(--gold-1); flex-shrink: 0; margin-top: 1px; }

.convert-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.35rem;
}

.icon-btn.busy { opacity: 0.6; }

@media (max-width: 640px) {
  .convert-compare { grid-template-columns: 1fr; }
  .cv-arrow { transform: rotate(90deg); justify-self: center; }
}

.confirm-body { width: min(400px, 100%); padding: 1.6rem 1.5rem 1.4rem; }
.confirm-title { margin: 0 0 0.4rem; font-size: 1.05rem; font-weight: 600; }
.confirm-text {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
  font-size: 0.875rem;
  word-break: break-all;
}
.confirm-actions { display: flex; justify-content: flex-end; gap: 0.55rem; }

/* ---- Toast ---- */

.toasts {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 200;
  display: grid;
  gap: 0.55rem;
  max-width: min(360px, calc(100vw - 2.5rem));
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold-1);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.86rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.28s var(--ease);
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.leaving { animation: toast-out 0.25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(14px); } }

/* ---- Duyarlılık ---- */

@media (max-width: 640px) {
  .topbar-hint { display: none; }
  .brand-wordmark { width: 96px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
  .library-head { align-items: stretch; }
  .searchbox { flex: 1; }
  .searchbox input { width: 100%; }
  .lb-urlrow { flex-direction: column; }
  .card-overlay { opacity: 1; translate: 0 0; pointer-events: auto; }
}
