/* ═══════════════════════════════════════════
   Phantom Halo Pro — Premium Link Shortener
   Dark Theme with Glassmorphism + Multi-User
   ═══════════════════════════════════════════ */

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(18, 18, 30, 0.6);
  --bg-card-hover: rgba(25, 25, 40, 0.7);
  --bg-input: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-green: #4ade80;
  --accent-red: #ef4444;
  --accent-yellow: #facc15;
  --gradient-main: linear-gradient(135deg, #a855f7, #06b6d4);
  --gradient-hover: linear-gradient(135deg, #b96cf7, #22d3ee);
  --gradient-danger: linear-gradient(135deg, #ef4444, #ec4899);
  --shadow-glow: 0 0 60px rgba(168, 85, 247, 0.15), 0 0 120px rgba(6, 182, 212, 0.08);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-width: 240px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background Orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  top: -150px;
  right: -100px;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-cyan);
  bottom: -100px;
  left: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-pink);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.18;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -40px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }

  75% {
    transform: translate(15px, 35px) scale(1.02);
  }
}

/* ══════════════════════════════
   LAYOUT: Sidebar + Main
   ══════════════════════════════ */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(12, 12, 20, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--glass-border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 20px;
}

.sidebar-logo svg {
  flex-shrink: 0;
}

.sidebar-logo h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-purple);
}

.nav-item.active svg {
  color: var(--accent-purple);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 12px 0;
}

.sidebar-footer {
  border-top: 1px solid var(--glass-border);
  padding-top: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-details {
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 40px;
  max-width: 960px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-header .gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════
   AUTH PAGES (Login / Register)
   ══════════════════════════════ */
.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.6s ease;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-logo h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--gradient-main);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hover);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary span {
  position: relative;
  z-index: 1;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent-purple);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.form-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

/* ══════════════════════════════
   CARDS & STATS
   ══════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-card .stat-value.purple {
  color: var(--accent-purple);
}

.stat-card .stat-value.cyan {
  color: var(--accent-cyan);
}

.stat-card .stat-value.green {
  color: var(--accent-green);
}

.stat-card .stat-value.pink {
  color: var(--accent-pink);
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ══════════════════════════════
   SHORTENER CARD
   ══════════════════════════════ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h2 svg {
  color: var(--accent-cyan);
}

.input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.input-row .form-input {
  flex: 1;
  min-width: 200px;
}

.result-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
  animation: fadeInUp 0.4s ease;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--accent-green);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.result-url-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.result-short-url {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-purple);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.result-short-url:hover {
  background: rgba(168, 85, 247, 0.12);
}

.result-original {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-box {
  display: flex;
  justify-content: center;
  padding: 16px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

.qr-box img {
  width: 180px;
  height: 180px;
}

/* ══════════════════════════════
   LINKS LIST
   ══════════════════════════════ */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  animation: fadeInUp 0.4s ease both;
}

.link-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.link-info {
  flex: 1;
  min-width: 0;
}

.link-short {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-purple);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.link-short:hover {
  color: var(--accent-cyan);
}

.link-original {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 500;
}

.link-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.link-tag {
  display: inline-flex;
  padding: 2px 8px;
  background: rgba(168, 85, 247, 0.08);
  border-radius: 100px;
  font-size: 0.7rem;
  color: var(--accent-purple);
  font-weight: 500;
}

.link-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-clicks {
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-cyan);
}

.badge-lock {
  background: rgba(250, 204, 21, 0.08);
  color: var(--accent-yellow);
}

.badge-expired {
  background: rgba(239, 68, 68, 0.08);
  color: var(--accent-red);
}

.badge-active {
  background: rgba(74, 222, 128, 0.08);
  color: var(--accent-green);
}

.link-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.icon-btn.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.2);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  opacity: 0.25;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state span {
  font-size: 0.85rem;
}

/* ══════════════════════════════
   ADMIN TABLE
   ══════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}

.data-table td {
  padding: 12px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.data-table tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

.status-dot.inactive {
  background: var(--accent-red);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.role-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-badge.admin {
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent-purple);
}

.role-badge.user {
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-cyan);
}

/* ══════════════════════════════
   CLICK CHART
   ══════════════════════════════ */
.chart-container {
  position: relative;
  width: 100%;
  height: 200px;
  margin: 16px 0;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ══════════════════════════════
   MODAL
   ══════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* ══════════════════════════════
   PASSWORD GATE
   ══════════════════════════════ */
.gate-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  text-align: center;
  animation: fadeInUp 0.6s ease;
}

.gate-card svg {
  margin-bottom: 16px;
  color: var(--accent-yellow);
}

.gate-card h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.gate-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ══════════════════════════════
   API KEYS
   ══════════════════════════════ */
.key-reveal {
  padding: 12px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent-purple);
  word-break: break-all;
  margin: 12px 0;
}

.key-warning {
  font-size: 0.8rem;
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ══════════════════════════════
   TOAST
   ══════════════════════════════ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(30, 30, 50, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--accent-green);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 300;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════
   MOBILE HAMBURGER
   ══════════════════════════════ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(12, 12, 20, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 40;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.hamburger {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

/* ══════════════════════════════
   ANIMATIONS
   ══════════════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

/* ══════════════════════════════
   RESPONSIVE
   ══════════════════════════════ */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 72px 16px 32px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .link-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .link-meta {
    width: 100%;
    justify-content: space-between;
  }

  .input-row {
    flex-direction: column;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }

  .result-url-box {
    flex-direction: column;
  }
}

/* ══════════════════════════════
   LIGHT THEME
   ══════════════════════════════ */
[data-theme="light"] {
  --bg-primary: #f5f5fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(0, 0, 0, 0.03);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(0, 0, 0, 0.14);
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #8a8aa0;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] body {
  background: var(--bg-primary);
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .mobile-header {
  background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .orb {
  opacity: 0.12;
}

[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--glass-border);
}

[data-theme="light"] .modal {
  background: #ffffff;
}

[data-theme="light"] .form-input {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .logout-btn {
  border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="light"] .nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .nav-item.active {
  background: rgba(168, 85, 247, 0.08);
}

[data-theme="light"] .icon-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .data-table td {
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* ══════════════════════════════
   HELP TOOLTIPS
   ══════════════════════════════ */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: none;
  border: 1.5px solid var(--text-muted);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  margin-left: 6px;
  padding: 0;
  font-family: var(--font);
  transition: all var(--transition);
  flex-shrink: 0;
}

.help-tip:hover,
.help-tip.open {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.08);
}

.help-tip-icon {
  line-height: 1;
}

.help-tip-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  z-index: 100;
  text-align: left;
  white-space: normal;
  animation: fadeIn 0.2s ease;
}

.help-tip-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--glass-border);
}

.help-tip.open .help-tip-popup,
.help-tip:hover .help-tip-popup {
  display: block;
}

/* ══════════════════════════════
   SETTINGS
   ══════════════════════════════ */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-label span {
  font-size: 1.1rem;
}

.toggle-group {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 3px;
}

.toggle-option {
  padding: 6px 14px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.toggle-option:hover {
  color: var(--text-primary);
}

.toggle-option.active {
  background: var(--gradient-main);
  color: white;
  font-weight: 600;
}

/* ══════════════════════════════
   MOBILE SIDEBAR BACKDROP
   ══════════════════════════════ */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
}

@media (max-width: 768px) {
  .sidebar-backdrop.show {
    display: block;
  }
}

/* ══════════════════════════════
   RESPONSIVE - TABLET
   ══════════════════════════════ */
@media (max-width: 1024px) and (min-width: 769px) {
  .sidebar {
    width: 200px;
  }

  .main-content {
    margin-left: 200px;
    padding: 24px 24px;
  }

  .sidebar-logo h2 {
    font-size: 1rem;
  }

  .nav-item {
    font-size: 0.84rem;
    padding: 8px 10px;
  }
}

/* ══════════════════════════════
   ADMIN TABLE SCROLL (Mobile)
   ══════════════════════════════ */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -24px;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .table-scroll {
    margin: 0 -16px;
    padding: 0 16px;
  }

  /* Larger touch targets */
  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .btn-sm {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .nav-item {
    padding: 12px 12px;
    min-height: 44px;
  }

  .form-input {
    padding: 16px;
    font-size: 1rem;
  }

  /* Settings toggle */
  .toggle-option {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  /* Help tooltip position on mobile */
  .help-tip-popup {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100vw - 48px);
    max-width: 320px;
  }

  .help-tip-popup::after {
    display: none;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

::selection {
  background: rgba(168, 85, 247, 0.3);
  color: var(--text-primary);
}

/* ══════════════════════════════
   LANDING PAGE
   ══════════════════════════════ */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-hero {
  text-align: center;
  padding: 80px 24px 40px;
  background: radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.12) 0%, transparent 60%);
}

.landing-title {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px 0 8px;
  line-height: 1.2;
}

.landing-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.landing-shortener {
  max-width: 640px;
  margin: 0 auto;
}

.landing-features {
  padding: 48px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all var(--transition);
  animation: fadeInUp 0.5s ease both;
}

.feature-card:nth-child(1) {
  animation-delay: 0.05s;
}

.feature-card:nth-child(2) {
  animation-delay: 0.1s;
}

.feature-card:nth-child(3) {
  animation-delay: 0.15s;
}

.feature-card:nth-child(4) {
  animation-delay: 0.2s;
}

.feature-card:nth-child(5) {
  animation-delay: 0.25s;
}

.feature-card:nth-child(6) {
  animation-delay: 0.3s;
}

.feature-card:hover {
  border-color: var(--accent-purple);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.15);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.landing-cta {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.landing-cta h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.landing-cta p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  font-size: 0.92rem;
}

.landing-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .landing-title {
    font-size: 1.6rem;
  }

  .landing-hero {
    padding: 48px 16px 32px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}