/* URL Shortener — Emerald Dark */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #10B981;
  --primary-dim: rgba(16,185,129,0.12);
  --primary-glow: rgba(16,185,129,0.25);
  --accent: #34D399;
  --bg: #0B0F14;
  --bg-card: #141922;
  --bg-input: #0B0F14;
  --border: rgba(16,185,129,0.10);
  --text: #E2E8F0;
  --text-dim: #94A3B8;
  --text-muted: #475569;
  --danger: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }

.header { border-bottom: 1px solid var(--border); background: rgba(20,25,34,0.95); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 700px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.header h1 { font-size: 1.05rem; font-weight: 700; }
.subtitle { font-size: 0.72rem; color: var(--text-dim); }

.btn { padding: 8px 16px; font-family: var(--font); font-size: 0.78rem; font-weight: 600; border: none; border-radius: 6px; cursor: pointer; transition: all var(--transition); }
.btn-sm { padding: 5px 10px; font-size: 0.72rem; background: var(--primary-dim); color: var(--primary); border: 1px solid rgba(16,185,129,0.2); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #059669); color: #0B0F14; font-weight: 700; }
.btn-primary:hover { box-shadow: 0 4px 16px var(--primary-glow); }
.btn-copy { background: var(--primary-dim); color: var(--primary); border: 1px solid rgba(16,185,129,0.2); }

.main { max-width: 700px; margin: 0 auto; padding: 20px; }

.create-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.create-row { display: flex; gap: 6px; }
.url-input { flex: 1; padding: 8px 10px; font-family: var(--font); font-size: 0.82rem; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; outline: none; }
.url-input:focus { border-color: rgba(16,185,129,0.4); }
.alias-input { width: 120px; padding: 8px 10px; font-family: var(--font); font-size: 0.82rem; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; outline: none; }
.result-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 10px; background: rgba(16,185,129,0.06); border-radius: 6px; }
.short-url { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); flex: 1; }

.links-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.panel-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.link-count { font-size: 0.68rem; font-weight: 600; color: var(--primary); background: var(--primary-dim); padding: 2px 8px; border-radius: 10px; }

.links-list { max-height: 400px; overflow-y: auto; }
.link-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid rgba(16,185,129,0.04); transition: background var(--transition); }
.link-row:hover { background: rgba(16,185,129,0.04); }
.link-info { flex: 1; min-width: 0; }
.link-alias { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); }
.link-url { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-clicks { font-size: 0.68rem; color: var(--text-dim); margin-right: 8px; }
.link-del { width: 24px; height: 24px; padding: 0; display: flex; align-items: center; justify-content: center; background: rgba(239,68,68,0.08); color: var(--danger); border: none; border-radius: 4px; cursor: pointer; font-size: 0.68rem; }

.empty-state { padding: 24px; text-align: center; font-size: 0.82rem; color: var(--text-muted); }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 24px rgba(0,0,0,0.5); font-size: 0.82rem; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  .create-row { flex-wrap: wrap; }
  .alias-input { width: 100%; }
}
