/* =============================================
   ShortLink Pro — Main Stylesheet
   Aesthetic: Dark luxury, neon accents
   Fonts: Syne (display) + DM Sans (body)
   ============================================= */

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

:root {
  --bg:         #08080f;
  --bg-card:    #0f0f1a;
  --bg-card2:   #13131f;
  --border:     rgba(255,255,255,0.07);
  --border-mid: rgba(255,255,255,0.12);
  --accent:     #7c6ff7;
  --accent2:    #5ef0c8;
  --accent3:    #f072b6;
  --text:       #e8e8f0;
  --text-muted: #6b6b85;
  --text-dim:   #9898b0;
  --success:    #22d3a0;
  --error:      #f05f72;
  --radius:     16px;
  --radius-sm:  10px;
  --shadow:     0 25px 60px rgba(0,0,0,0.5);
  --glow:       0 0 40px rgba(124,111,247,0.15);
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background Effects ── */
.noise-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.4;
}
.gradient-orb {
  position: fixed; z-index: 0; pointer-events: none;
  border-radius: 50%; filter: blur(90px); opacity: 0.12;
}
.orb-1 { width: 600px; height: 600px; top: -200px; right: -200px; background: radial-gradient(circle, #7c6ff7, transparent 70%); }
.orb-2 { width: 500px; height: 500px; bottom: 0; left: -150px; background: radial-gradient(circle, #5ef0c8, transparent 70%); opacity: 0.08; }
.orb-3 { width: 400px; height: 400px; top: 50%; left: 50%; transform: translate(-50%,-50%); background: radial-gradient(circle, #f072b6, transparent 70%); opacity: 0.06; }

/* ── Navbar ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(8,8,15,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
}
.logo-icon { font-size: 22px; filter: drop-shadow(0 0 8px var(--accent)); }
.logo-text strong { color: var(--accent); }
.nav-links { display: flex; gap: 32px; }
.nav-link {
  color: var(--text-muted); text-decoration: none; font-size: 14px;
  font-weight: 500; transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }

/* ── Hero ── */
.hero {
  position: relative; z-index: 1;
  padding: 140px 24px 80px;
  text-align: center;
  max-width: 820px; margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,111,247,0.12);
  border: 1px solid rgba(124,111,247,0.25);
  border-radius: 999px; padding: 6px 16px;
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 28px;
  animation: fadeSlideDown 0.6s ease both;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 8px var(--accent2);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 68px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  animation: fadeSlideDown 0.6s 0.1s ease both;
}
.hero-title span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  color: var(--text-dim); font-size: 18px; font-weight: 300;
  max-width: 540px; margin: 0 auto 40px;
  animation: fadeSlideDown 0.6s 0.2s ease both;
}

/* ── Shortener Card ── */
.shortener-card {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow), var(--glow);
  animation: fadeSlideDown 0.6s 0.3s ease both;
}
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; margin-bottom: 20px;
}
.alert-error   { background: rgba(240,95,114,0.1); border: 1px solid rgba(240,95,114,0.2); color: var(--error); }
.alert-success { background: rgba(34,211,160,0.1); border: 1px solid rgba(34,211,160,0.2); color: var(--success); }
.alert-icon { font-size: 16px; font-weight: 700; }

.input-group {
  display: flex; gap: 12px; align-items: stretch;
}
.url-input-wrap {
  flex: 1; position: relative;
  display: flex; align-items: center;
}
.input-icon {
  position: absolute; left: 16px; color: var(--text-muted); pointer-events: none;
  flex-shrink: 0;
}
.url-input-wrap input,
.shorten-form input[type="url"] {
  width: 100%; padding: 16px 16px 16px 48px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 15px;
  outline: none; transition: border-color 0.2s, background 0.2s;
}
.url-input-wrap input:focus {
  border-color: var(--accent);
  background: rgba(124,111,247,0.06);
}
.url-input-wrap input::placeholder { color: var(--text-muted); }
.btn-shorten {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--accent), #6057e8);
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-family: var(--font-display);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(124,111,247,0.35);
}
.btn-shorten:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(124,111,247,0.5); }
.btn-shorten:active { transform: translateY(0); }

.custom-toggle-wrap { margin-top: 14px; text-align: left; }
.custom-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 0; transition: opacity 0.2s;
}
.custom-toggle:hover { opacity: 0.75; }
.custom-code-wrap { margin-top: 14px; }
.custom-input-group {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: border-color 0.2s;
}
.custom-input-group:focus-within { border-color: var(--accent2); }
.domain-prefix {
  padding: 14px 12px 14px 16px;
  color: var(--text-muted); font-size: 14px;
  white-space: nowrap; border-right: 1px solid var(--border);
  background: rgba(94,240,200,0.05);
}
.custom-input-group input {
  flex: 1; padding: 14px 16px;
  background: transparent; border: none;
  color: var(--text); font-family: var(--font-body); font-size: 15px; outline: none;
}
.custom-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* Result box */
.result-box {
  background: rgba(94,240,200,0.05);
  border: 1px solid rgba(94,240,200,0.15);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.result-url {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--accent2); word-break: break-all;
}
.result-actions { display: flex; gap: 10px; flex-shrink: 0; }
.btn-copy, .btn-visit {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform 0.15s, opacity 0.2s;
}
.btn-copy {
  background: rgba(94,240,200,0.15); border: 1px solid rgba(94,240,200,0.2);
  color: var(--accent2);
}
.btn-visit {
  background: rgba(124,111,247,0.15); border: 1px solid rgba(124,111,247,0.2);
  color: var(--accent);
}
.btn-copy:hover, .btn-visit:hover { transform: translateY(-2px); opacity: 0.9; }
.new-link-wrap { margin-top: 20px; text-align: center; }
.btn-secondary {
  display: inline-flex; align-items: center;
  padding: 12px 24px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border-mid);
  color: var(--text-dim); font-size: 14px; text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Stats ── */
.stats-section {
  position: relative; z-index: 1;
  padding: 20px 24px 80px;
}
.stats-grid {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { border-color: var(--border-mid); transform: translateY(-3px); }
.stat-number {
  font-family: var(--font-display); font-size: 32px; font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--text-dim));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ── How it works ── */
.how-section, .faq-section {
  position: relative; z-index: 1;
  padding: 80px 24px;
  border-top: 1px solid var(--border);
}
.section-inner { max-width: 900px; margin: 0 auto; }
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display); font-size: clamp(28px, 4vw, 42px);
  font-weight: 800; margin-bottom: 48px; letter-spacing: -0.02em;
}
.steps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.step-card {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 24px;
  position: relative; overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.step-card:hover { border-color: var(--border-mid); transform: translateY(-4px); }
.step-num {
  position: absolute; top: 20px; right: 24px;
  font-family: var(--font-display); font-size: 48px; font-weight: 800;
  color: rgba(255,255,255,0.04); line-height: 1;
}
.step-icon { font-size: 32px; margin-bottom: 16px; }
.step-card h3 {
  font-family: var(--font-display); font-size: 18px;
  font-weight: 700; margin-bottom: 10px;
}
.step-card p { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.faq-q {
  width: 100%; padding: 20px 24px;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-family: var(--font-body);
  font-size: 15px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
  text-align: left; transition: background 0.2s;
}
.faq-q:hover { background: rgba(255,255,255,0.03); }
.faq-arrow { color: var(--text-muted); transition: transform 0.3s; font-size: 18px; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s;
  color: var(--text-muted); font-size: 14px; line-height: 1.7;
  padding: 0 24px;
}
.faq-item.open .faq-a { max-height: 200px; padding: 0 24px 20px; }

/* ── Footer ── */
.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}
.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; }
.footer-text { font-size: 13px; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* ── Toast ── */
.copy-toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--success); color: #fff;
  padding: 12px 24px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(34,211,160,0.3);
  transition: transform 0.3s ease;
  z-index: 1000; white-space: nowrap;
}
.copy-toast.show { transform: translateX(-50%) translateY(0); }

/* ── Admin styles (shared) ── */
.admin-body {
  background: #0a0a12; font-family: var(--font-body);
  color: var(--text); min-height: 100vh;
}
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto;
}
.admin-sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.admin-sidebar-header .logo { font-size: 17px; }
.admin-nav { padding: 16px 12px; flex: 1; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 8px;
  color: var(--text-muted); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: rgba(124,111,247,0.12); color: var(--accent);
}
.admin-nav-item svg { flex-shrink: 0; }
.admin-main { margin-left: 240px; flex: 1; padding: 32px; min-height: 100vh; }
.admin-header { margin-bottom: 32px; }
.admin-header h1 {
  font-family: var(--font-display); font-size: 28px;
  font-weight: 800; letter-spacing: -0.02em;
}
.admin-header p { color: var(--text-muted); margin-top: 4px; }

.a-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 24px;
}
.a-card-title {
  font-family: var(--font-display); font-size: 16px;
  font-weight: 700; margin-bottom: 20px; color: var(--text);
}
.a-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.a-stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.a-stat-val { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--accent); }
.a-stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Tables */
.a-table { width: 100%; border-collapse: collapse; }
.a-table th {
  text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.a-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.a-table tr:last-child td { border-bottom: none; }
.a-table tr:hover td { background: rgba(255,255,255,0.02); }
.short-code-badge {
  display: inline-block; padding: 4px 10px;
  background: rgba(124,111,247,0.12); border: 1px solid rgba(124,111,247,0.2);
  border-radius: 6px; color: var(--accent); font-size: 13px; font-weight: 600;
}
.url-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.status-active   { color: var(--success); font-size: 12px; font-weight: 600; }
.status-inactive { color: var(--error);   font-size: 12px; font-weight: 600; }
.a-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.2s; border: none; text-decoration: none; }
.a-btn-sm { padding: 5px 10px; font-size: 12px; }
.a-btn-danger  { background: rgba(240,95,114,0.15); color: var(--error); }
.a-btn-success { background: rgba(34,211,160,0.15); color: var(--success); }
.a-btn-primary { background: rgba(124,111,247,0.2); color: var(--accent); }
.a-btn:hover { opacity: 0.75; }
.a-pagination { display: flex; gap: 8px; margin-top: 20px; }
.a-page-btn {
  padding: 8px 14px; border-radius: 7px; font-size: 13px;
  background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text-dim); text-decoration: none; transition: border-color 0.2s, color 0.2s;
}
.a-page-btn:hover, .a-page-btn.current { border-color: var(--accent); color: var(--accent); }

/* Forms */
.a-form-group { margin-bottom: 20px; }
.a-form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.a-input, .a-textarea, .a-select {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid); border-radius: 8px;
  color: var(--text); font-family: var(--font-body); font-size: 14px;
  outline: none; transition: border-color 0.2s;
}
.a-textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.a-input:focus, .a-textarea:focus { border-color: var(--accent); }
.a-form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.a-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.a-submit {
  padding: 12px 28px; background: linear-gradient(135deg, var(--accent), #6057e8);
  border: none; border-radius: 8px; color: #fff;
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s;
}
.a-submit:hover { opacity: 0.85; }
.a-flash {
  padding: 12px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 500; margin-bottom: 20px;
}
.a-flash.success { background: rgba(34,211,160,0.1); border: 1px solid rgba(34,211,160,0.2); color: var(--success); }
.a-flash.error   { background: rgba(240,95,114,0.1); border: 1px solid rgba(240,95,114,0.2); color: var(--error); }

/* Login */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.login-card {
  background: var(--bg-card); border: 1px solid var(--border-mid);
  border-radius: 20px; padding: 40px; width: 100%; max-width: 380px;
  box-shadow: var(--shadow);
}
.login-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.login-sub   { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }

/* Responsive */
@media (max-width: 768px) {
  .stats-grid   { grid-template-columns: repeat(2,1fr); }
  .steps-grid   { grid-template-columns: 1fr; }
  .input-group  { flex-direction: column; }
  .btn-shorten  { width: 100%; justify-content: center; }
  .result-box   { flex-direction: column; }
  .footer-inner { flex-direction: column; text-align: center; }
  .admin-sidebar { display: none; }
  .admin-main   { margin-left: 0; padding: 20px; }
  .a-stats-grid { grid-template-columns: repeat(2,1fr); }
  .a-form-row   { grid-template-columns: 1fr; }
  .nav-links    { display: none; }
}
