:root {
  color-scheme: dark;
  --bg: #07090e;
  --bg-gradient: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, rgba(7, 9, 14, 0) 65%), #07090e;
  --panel: rgba(15, 21, 37, 0.75);
  --panel-solid: #0f1525;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.09);
  --line-focus: rgba(0, 242, 254, 0.5);
  --accent: #00f2fe;
  --accent-secondary: #4facfe;
  --accent-purple: #7928ca;
  --primary-btn: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #6366f1 100%);
  --soft: rgba(0, 242, 254, 0.1);
  --soft-purple: rgba(121, 40, 202, 0.15);
  --good: #10b981;
  --danger: #ff365a;
  --shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-neon: 0 0 25px rgba(0, 242, 254, 0.3);
  --radius: 16px;
}

* { box-sizing: border-box; }

body.light {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 60%), #f8fafc;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-solid: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-focus: #0284c7;
  --soft: rgba(2, 132, 199, 0.08);
  --soft-purple: rgba(99, 102, 241, 0.08);
  --shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --shadow-neon: 0 10px 25px rgba(2, 132, 199, 0.2);
}

body {
  margin: 0;
  background: var(--bg-gradient);
  background-color: var(--bg);
  color: var(--ink);
  font: 15px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}

.ambient-glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.45;
}
.glow-1 { top: -15vw; left: 10vw; background: radial-gradient(circle, #00f2fe 0%, rgba(0, 242, 254, 0) 70%); }
.glow-2 { top: 5vw; right: 5vw; background: radial-gradient(circle, #7928ca 0%, rgba(121, 40, 202, 0) 70%); opacity: 0.35; }

.cyber-grid {
  position: absolute;
  top: 0; left: 0; right: 0; height: 100vh;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 75%);
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }

button, .ghost, .primary {
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 20px;
  background: var(--primary-btn);
  color: #fff;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:hover, .primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -4px rgba(0, 242, 254, 0.4);
  filter: brightness(1.05);
}
button:active, .primary:active { transform: translateY(0); }
button:disabled { opacity: .5; cursor: wait; transform: none; box-shadow: none; }

.ghost {
  border-color: var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
  color: var(--ink);
}
.ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 5vw;
  background: rgba(7, 9, 14, 0.6);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00f2fe, #4facfe, #7928ca);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 19px; letter-spacing: .06em; font-weight: 800; }
.brand-text strong span { color: var(--accent); }
.brand-text small { font-size: 10px; color: var(--muted); letter-spacing: .12em; font-weight: 700; }
nav, .actions { display: flex; gap: 10px; align-items: center; }

.hero {
  max-width: 840px;
  margin: 0 auto;
  text-align: center;
  padding: 70px 24px 60px;
  position: relative;
}
.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .1em;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 10px #00f2fe;
  animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(1.3); }
}

.hero h1 {
  font-size: clamp(38px, 6.5vw, 68px);
  line-height: 1.1;
  margin: 0 0 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.gradient-text {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #9061f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  margin-bottom: 24px;
}
.cyber-card {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 28, 48, 0.8) 0%, rgba(12, 17, 30, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
body.light .cyber-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 248, 255, 0.9) 100%);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.input-group { margin-bottom: 20px; }
label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.label-tag {
  font-size: 10px;
  letter-spacing: .08em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--accent);
}
.label-hint { font-size: 11px; color: var(--muted); font-weight: 500; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  display: grid;
  place-items: center;
  pointer-events: none;
}
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(8, 11, 20, 0.6);
  color: var(--ink);
  padding: 14px 16px 14px 44px;
  border-radius: 12px;
  font: inherit;
  outline: none;
  transition: all .2s ease;
}
body.light input, body.light select { background: rgba(255, 255, 255, 0.8); }
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.2);
  background: rgba(10, 14, 25, 0.85);
}

.slug-wrapper {
  background: rgba(8, 11, 20, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding-left: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.slug-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.2);
}
.slug-prefix {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  user-select: none;
}
.slug-wrapper input { border: none; background: transparent; padding-left: 6px; }
.slug-wrapper input:focus { box-shadow: none; }

.cyber-preview {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 22px;
  text-align: left;
}
body.light .cyber-preview { background: rgba(0, 0, 0, 0.03); }
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
}
.preview-label { letter-spacing: .12em; font-weight: 700; color: var(--muted); }
#availability { font-size: 12px; color: var(--muted); font-weight: 500; }
#availability[data-ok="true"] { color: var(--good); font-weight: 700; }
#availability[data-ok="false"] { color: var(--danger); font-weight: 700; }
.preview-url {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
}
.terminal-prompt { color: var(--accent); font-weight: 800; }
#linkPreview { color: var(--ink); overflow-wrap: anywhere; }

.cyber-btn {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
  background: var(--primary-btn);
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3);
}

.result-card {
  border: 1px solid rgba(0, 242, 254, 0.3);
  box-shadow: 0 20px 60px rgba(0, 242, 254, 0.15);
  animation: slide-in 0.3s ease-out;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-header { margin-bottom: 12px; }
.tech-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--good);
  letter-spacing: .1em;
}
.result-url-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}
#shortUrl {
  margin: 0;
  font-size: clamp(20px, 4vw, 28px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.result-card .actions {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 10px;
}
.btn-copy { background: linear-gradient(135deg, #10b981, #059669); }
.btn-copy:hover { box-shadow: 0 8px 25px -4px rgba(16, 185, 129, 0.4); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 50px;
  text-align: left;
}
.feature-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  transition: transform .2s ease, border-color .2s ease;
}
.feature-item:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 242, 254, 0.3);
}
.feature-icon { font-size: 26px; margin-bottom: 12px; }
.feature-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.feature-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

footer {
  border-top: 1px solid var(--line);
  padding: 35px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(12px);
}
.footer-inner strong { color: var(--ink); }

dialog {
  color: var(--ink);
  background: var(--panel-solid);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  width: min(600px, 94vw);
  max-height: 90vh;
  padding: 0;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 242, 254, 0.2);
}
dialog::backdrop { background: rgba(4, 6, 12, 0.8); backdrop-filter: blur(8px); }
.modalForm { padding: 28px; display: grid; gap: 16px; }
.modalForm h2 { margin: 0; }
.qrStage { text-align: center; margin: 15px 0; }
.qrStage img {
  width: 250px;
  max-width: 100%;
  background: white;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: #fff;
  padding: 14px 26px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 242, 254, 0.2);
  z-index: 1000;
  display: none;
  font-weight: 600;
  font-size: 14px;
}
#toast.show { display: block; }
#message { color: var(--accent); margin-top: 12px; font-weight: 600; }
.hidden { display: none !important; }

/* Admin Dashboard Specific Enhancements */
.workspace { display: grid; grid-template-columns: 240px 1fr; max-width: 1600px; margin: auto; }
aside { border-right: 1px solid var(--line); padding: 30px 18px; position: sticky; top: 80px; height: calc(100vh - 80px); display: flex; flex-direction: column; gap: 8px; }
.nav { background: none; color: var(--muted); text-align: left; border-radius: 10px; padding: 11px 14px; border: 1px solid transparent; }
.nav:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); }
.nav.active { color: var(--accent); background: var(--soft); border-color: rgba(0, 242, 254, 0.25); }
.asideFoot { margin-top: auto; display: grid; gap: 14px; }
.content { padding: 40px; min-width: 0; }
.dashHead, .sectionHead { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.dashHead h1 { font-size: 32px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stats article { display: grid; gap: 8px; }
.stats strong { font-size: 36px; letter-spacing: -0.04em; color: var(--accent); font-family: ui-monospace, SFMono-Regular, monospace; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.toolbar { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.linkRow { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; }
.linkTitle { font-size: 17px; margin: 0 0 6px; font-weight: 700; }
.shortLink { color: var(--accent); font-weight: 700; font-family: ui-monospace, monospace; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill { background: rgba(0,0,0,0.3); border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; font-size: 11px; color: var(--muted); }
.pill.active { color: var(--good); border-color: rgba(16, 185, 129, 0.3); }

@media (max-width: 850px) {
  .features-grid { grid-template-columns: 1fr; }
  .result-card .actions { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .workspace { display: block; }
  aside { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
  .content { padding: 20px 14px; }
}
@media (max-width: 550px) {
  .result-card .actions { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
  .hero { padding: 45px 16px 40px; }
}
