/* ============================================================================
   Short Link — Dark Liquid Glassmorphism theme
   ========================================================================== */

:root {
  --bg: #07091a;
  --bg-2: #0d1026;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(139, 92, 246, 0.35);
  --text: #e8eaf6;
  --text-2: #9aa0c3;
  --text-3: #5c6285;
  --accent: #8b5cf6;
  --accent-2: #06b6d4;
  --accent-3: #ec4899;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --blur: 24px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --font: 'Vazirmatn', 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---- animated liquid background blobs ---------------------------------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  mix-blend-mode: screen;
  animation: float 22s ease-in-out infinite;
}
.blob.b1 { width: 520px; height: 520px; background: #7c3aed; top: -160px; left: -120px; }
.blob.b2 { width: 460px; height: 460px; background: #0891b2; bottom: -180px; right: -120px; animation-delay: -7s; }
.blob.b3 { width: 380px; height: 380px; background: #db2777; top: 40%; left: 55%; animation-delay: -14s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(60px, -50px) scale(1.12); }
  66%      { transform: translate(-40px, 40px) scale(0.92); }
}

/* subtle glow overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(139, 92, 246, 0.10), transparent 60%),
    radial-gradient(1000px 500px at 90% 110%, rgba(6, 182, 212, 0.08), transparent 60%);
}

/* ---- layout ------------------------------------------------------------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }

main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  flex: 1;
}

/* ---- glass card --------------------------------------------------------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  padding: 24px;
}

/* ---- top nav ------------------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(7, 9, 26, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.brand .logo {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-size: 16px;
  box-shadow: 0 6px 18px -6px rgba(139, 92, 246, 0.8);
}
.brand .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-links { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-btn:hover { color: var(--text); background: var(--surface); }
.nav-btn.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.2));
  border-color: var(--border-strong);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary {
  border: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px -10px rgba(139, 92, 246, 0.9);
}
.btn.danger { border-color: rgba(248, 113, 113, 0.4); color: var(--err); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.12); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.icon { padding: 8px; border-radius: 8px; }

/* ---- inputs ------------------------------------------------------------- */
input[type='text'], input[type='password'], input[type='email'], input[type='number'],
select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(3, 5, 18, 0.5);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea { line-height: 1.7; resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }

label.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
label.field > span { font-size: 12px; color: var(--text-2); font-weight: 600; }

/* ---- utility ------------------------------------------------------------ */
.row { display: flex; gap: 10px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 11px; color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 13px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.brk { word-break: break-all; }

/* ---- toast -------------------------------------------------------------- */
#toasts {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 340px;
}
.toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(13, 16, 38, 0.95);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: slideIn 0.3s ease;
  backdrop-filter: blur(18px);
}
.toast.ok { border-color: rgba(52, 211, 153, 0.5); }
.toast.err { border-color: rgba(248, 113, 113, 0.5); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- result card (after create) ---------------------------------------- */
.result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.08);
  border: 1px dashed var(--border-strong);
  margin-top: 12px;
}
.result .url { flex: 1; font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* ---- list rows ---------------------------------------------------------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.row-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}
.row-item:hover { border-color: var(--border-strong); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .title { font-weight: 600; font-size: 14px; }
.row-item .sub { color: var(--text-3); font-size: 12px; margin-top: 3px; }
.row-item .stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
}
.badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.4); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); }
.badge.err { color: var(--err); border-color: rgba(248, 113, 113, 0.4); }
.badge.live {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.25));
  color: #fff; border-color: var(--border-strong);
}

/* ---- tabs --------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.22));
  border-color: var(--border-strong);
}

/* ---- grid --------------------------------------------------------------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.tools { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* ---- category chips ----------------------------------------------------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.35), rgba(6, 182, 212, 0.28));
  border-color: var(--border-strong);
}

/* ---- search bar --------------------------------------------------------- */
.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(3, 5, 18, 0.5);
  margin-bottom: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.searchbar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
.searchbar .sic { font-size: 15px; opacity: 0.7; flex: none; }
.searchbar input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; padding: 0;
  font-size: 14px; color: var(--text);
  outline: none;
}
.searchbar input::placeholder { color: var(--text-3); }
.searchbar .scount { flex: none; color: var(--text-3); }
.tile {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  font: inherit;
  text-align: start;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 40px -20px rgba(139, 92, 246, 0.7);
  background: var(--surface-2);
}
.tile .ic { font-size: 26px; }
.tile .nm { font-weight: 700; font-size: 14px; }
.tile .ds { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.tile .badge { position: absolute; top: 10px; inset-inline-end: 10px; }
.tile { position: relative; }

/* ---- stats cards -------------------------------------------------------- */
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat-card .v { font-size: 26px; font-weight: 800; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .k { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ---- progress ----------------------------------------------------------- */
.bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.4s ease; }
.bar.warn > i { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* drop zone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(139, 92, 246, 0.04);
}
.dropzone:hover, .dropzone.over { background: rgba(139, 92, 246, 0.12); transform: scale(1.01); }

/* table */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-2); font-weight: 700; font-size: 12px; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 5, 18, 0.7); backdrop-filter: blur(8px); z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal { max-width: 560px; width: 100%; max-height: 86vh; overflow: auto; padding: 24px; border-radius: var(--radius); background: rgba(13, 16, 38, 0.96); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }

/* loading skeleton */
.skel { border-radius: 8px; height: 16px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty .ic { font-size: 40px; margin-bottom: 10px; }

/* hero */
.hero { text-align: center; padding: 40px 0 28px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; line-height: 1.2; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-2); margin-top: 10px; font-size: 15px; }

/* checkbox */
input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.4); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* selection */
::selection { background: rgba(139, 92, 246, 0.4); color: #fff; }

/* footer */
.footer { text-align: center; padding: 28px 20px; color: var(--text-3); font-size: 12px; border-top: 1px solid var(--border); }

/* responsive */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-inner { flex-wrap: wrap; }
  main { padding: 16px 14px 60px; }
  .row-item { flex-wrap: wrap; }
  .glass { padding: 16px; }
  /* tool grid: 2 columns on phones, denser tiles */
  .grid.tools { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { padding: 14px; gap: 5px; }
  .tile .ic { font-size: 22px; }
  .tile .nm { font-size: 13px; }
  .tile .ds { font-size: 11px; }
  /* chips scroll horizontally instead of wrapping tall */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, #000 92%, transparent);
  }
  .chips::-webkit-scrollbar { display: none; }
}

@media (min-width: 721px) and (max-width: 980px) {
  .grid.tools { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
