/* ============================================================
   Telegram Storage — Design System
   Apple & Stripe mix: koyu, berrak, premium, canlı gradyanlar
   ============================================================ */

:root {
  /* Stripe moru brand paleti */
  --brand: #635bff;
  --brand-2: #00d4ff;
  --brand-3: #ff7eb3;
  --brand-soft: rgba(99, 91, 255, 0.14);
  --gradient: linear-gradient(135deg, #635bff 0%, #00d4ff 55%, #ff7eb3 100%);
  --gradient-soft: linear-gradient(135deg, rgba(99,91,255,.18), rgba(0,212,255,.10));

  /* Koyu zemin — Apple'ın derin siyah-laciverti */
  --bg-0: #0a0a0f;
  --bg-1: #0e0e16;
  --bg-2: #15151f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Tipografi */
  --text: #f5f5f7;            /* Apple kar beyazı */
  --text-dim: #9b9ba7;        /* ikincil */
  --text-faint: #6b6b76;      /* üçüncül */

  /* Fonksiyonel */
  --ok: #30d158;              /* Apple green */
  --warn: #ffd60a;
  --danger: #ff453a;          /* Apple red */
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --blur: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 80px;
  position: relative;
  overflow-x: hidden;
}

/* ---- Canlı Stripe arka planı ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(99, 91, 255, 0.16) 0%, transparent 55%),
    radial-gradient(800px 500px at 100% 0%, rgba(0, 212, 255, 0.10) 0%, transparent 50%),
    radial-gradient(1000px 700px at 85% 110%, rgba(255, 126, 179, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #0b0b12 0%, var(--bg-0) 100%);
}
/* ince grid dokusu (Stripe) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
  pointer-events: none;
}

/* ================= HEADER / LOGO ================= */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  padding: 34px 0 6px;
}
.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 91, 255, 0.4);
}
.tagline {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 34px;
  text-align: center;
  letter-spacing: -0.01em;
}

/* ================= KART ================= */
.card {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-lg);
  padding: 32px;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ================= DROPZONE ================= */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity 0.28s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.dropzone:hover::before, .dropzone.drag::before { opacity: 1; }
.dropzone .icon {
  font-size: 40px;
  margin-bottom: 14px;
  display: inline-block;
  animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.dropzone h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.dropzone p { color: var(--text-dim); font-size: 13.5px; }
.dropzone .max { font-size: 12px; opacity: 0.65; margin-top: 12px; }

/* ================= SÜRE SEÇİCİ ================= */
.expiry-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 8px 14px 8px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}
.expiry-row:focus-within { border-color: var(--brand); }
.expiry-row select {
  flex: 1;
  padding: 11px 12px;
  border-radius: 10px;
  border: none;
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239b9ba7' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.expiry-row select option { background: var(--bg-2); color: var(--text); }

/* ================= URL UPLOAD ================= */
.url-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.url-row input {
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}
.url-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.url-hint { color: var(--text-faint); font-size: 12px; margin-top: 8px; }

/* ================= BUTONLAR ================= */
.btn {
  padding: 13px 22px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 91, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(99, 91, 255, 0.5); transform: translateY(-1px); }
.btn-ghost {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); }
.btn-danger {
  background: rgba(255, 69, 58, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 69, 58, 0.25);
}
.btn-danger:hover { background: rgba(255, 69, 58, 0.2); }
.btn-block { width: 100%; padding: 15px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ================= İLERLEME ================= */
.progress-wrap { margin-top: 24px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 500;
}
.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  border-radius: 99px;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ================= SONUÇ ================= */
.result { margin-top: 24px; text-align: center; }
.result .check {
  font-size: 46px;
  margin-bottom: 10px;
  display: inline-block;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result .file-label { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 12px;
  border-radius: 99px;
  background: rgba(48, 209, 88, 0.14);
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}
.link-box {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.link-box input {
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.link-box input:focus { border-color: var(--brand); }

/* ================= HATA / TOAST ================= */
.error {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.3);
  color: var(--danger);
  font-size: 13px;
  animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 42, 0.92);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 14px 24px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  font-size: 13.5px;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================= ADMIN ================= */
.admin-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
}
.admin-nav button {
  padding: 10px 18px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.admin-nav button:hover { color: var(--text); }
.admin-nav button.active {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 91, 255, 0.35);
}
.admin-card { max-width: 900px; }
.admin-card.wide { max-width: 1100px; }

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: transform 0.2s, border-color 0.2s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat .num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat .lbl { color: var(--text-dim); font-size: 12px; margin-top: 4px; font-weight: 500; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--text-faint); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-hover); }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.tag.ok { background: rgba(48, 209, 88, 0.14); color: var(--ok); }
.tag.warn { background: rgba(255, 214, 10, 0.14); color: var(--warn); }
.tag.bad { background: rgba(255, 69, 58, 0.14); color: var(--danger); }

/* ================= YARDIMCILAR ================= */
.section-title { font-size: 16px; font-weight: 650; margin: 20px 0 12px; letter-spacing: -0.01em; }
.muted { color: var(--text-dim); font-size: 12.5px; }
.hidden { display: none !important; }
.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* login */
.admin-login {
  max-width: 400px;
  margin: 0 auto;
}
.admin-login h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.admin-login .sub { color: var(--text-dim); margin-bottom: 24px; font-size: 13.5px; }

/* responsive */
@media (max-width: 640px) {
  .card { padding: 22px; }
  .admin-nav button { padding: 9px 13px; font-size: 12.5px; }
  .url-row { flex-direction: column; }
}
