/* ============================================================
   NAVIXO ADS — DESIGN SYSTEM
   Premium dark-mode design inspired by Cloudflare Dashboard
   ============================================================ */

/* ---------- CUSTOM PROPERTIES ---------- */
:root {
  /* Core palette */
  --bg-deep:       #06060b;
  --bg-body:       #0b0b14;
  --bg-surface:    #11111f;
  --bg-card:       #15152a;
  --bg-elevated:   #1a1a35;
  --bg-hover:      #1f1f40;

  /* Primary — warm orange */
  --primary:       #f6821f;
  --primary-light: #ff9a44;
  --primary-dark:  #d96c10;
  --primary-glow:  rgba(246, 130, 31, 0.25);
  --primary-bg:    rgba(246, 130, 31, 0.08);

  /* Accent — indigo/violet */
  --accent:        #8b5cf6;
  --accent-light:  #a78bfa;
  --accent-bg:     rgba(139, 92, 246, 0.10);

  /* Semantic */
  --success:       #22c55e;
  --success-bg:    rgba(34, 197, 94, 0.10);
  --warning:       #eab308;
  --warning-bg:    rgba(234, 179, 8, 0.10);
  --danger:        #ef4444;
  --danger-bg:     rgba(239, 68, 68, 0.10);
  --info:          #3b82f6;
  --info-bg:       rgba(59, 130, 246, 0.10);

  /* Text */
  --text-primary:    #f1f1f6;
  --text-secondary:  #9394a5;
  --text-muted:      #5c5d73;
  --text-inverse:    #06060b;

  /* Borders */
  --border:          rgba(255, 255, 255, 0.06);
  --border-light:    rgba(255, 255, 255, 0.10);
  --border-focus:    var(--primary);

  /* Glass */
  --glass:           rgba(17, 17, 31, 0.65);
  --glass-border:    rgba(255, 255, 255, 0.08);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  --sp-16: 64px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --navbar-height: 64px;
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { 
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--primary-light); text-decoration: none; transition: color var(--duration-fast) var(--ease); }
a:hover { color: var(--primary); }

img { max-width: 100%; display: block; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

::selection { background: var(--primary); color: white; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}
h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 1.125rem; font-weight: 600; }
h5 { font-size: 0.9375rem; font-weight: 600; }
h6 { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 10px 20px;
  font-weight: 500; font-size: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 2px 12px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--primary); }

.btn-ghost {
  color: var(--text-secondary);
  padding: 8px 14px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-elevated); }

.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }

.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 10px; aspect-ratio: 1; }

/* ---------- FORMS ---------- */
.form-group { margin-bottom: var(--sp-5); }
.form-label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--duration-normal) var(--ease);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input:hover { border-color: var(--border-light); }

textarea.form-input { resize: vertical; min-height: 80px; }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%239394a5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Toggle switch */
.toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  transition: all var(--duration-normal) var(--ease);
}
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--duration-normal) var(--ease-bounce);
}
.toggle input:checked ~ .toggle-track { background: var(--primary); border-color: var(--primary); }
.toggle input:checked ~ .toggle-thumb { left: 23px; background: white; }

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--duration-normal) var(--ease);
}
.card:hover { border-color: var(--border-light); }

.card-glass {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}

.card-interactive {
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease);
}
.card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md), 0 0 20px rgba(246,130,31,0.08);
}

/* ---------- STAT CARDS ---------- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease);
}
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-4);
}
.stat-card .stat-value {
  font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: var(--sp-1);
}
.stat-card .stat-label {
  font-size: 13px; color: var(--text-secondary);
}
.stat-card .stat-change {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500;
  margin-top: var(--sp-2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.stat-change.up { color: var(--success); background: var(--success-bg); }
.stat-change.down { color: var(--danger); background: var(--danger-bg); }

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}
.badge-success { color: var(--success); background: var(--success-bg); }
.badge-warning { color: var(--warning); background: var(--warning-bg); }
.badge-danger  { color: var(--danger);  background: var(--danger-bg); }
.badge-info    { color: var(--info);    background: var(--info-bg); }
.badge-primary { color: var(--primary); background: var(--primary-bg); }
.badge-accent  { color: var(--accent);  background: var(--accent-bg); }
.badge-neutral { color: var(--text-secondary); background: var(--bg-elevated); }

/* ---------- TABLES ---------- */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap thead th {
  padding: 14px 16px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.table-wrap tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast) var(--ease);
}
.table-wrap tbody tr:last-child td { border-bottom: none; }
.table-wrap tbody tr:hover td { background: var(--bg-surface); }
.table-wrap .cell-primary { color: var(--text-primary); font-weight: 500; }
.table-wrap .cell-mono { font-family: var(--font-mono); font-size: 13px; }
.table-wrap .cell-right { text-align: right; }

/* ---------- TABS ---------- */
.tabs {
  display: flex; gap: var(--sp-1);
  padding: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: fit-content;
}
.tab {
  padding: 8px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease);
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- PROGRESS ---------- */
.progress { height: 6px; background: var(--bg-hover); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width var(--duration-slow) var(--ease);
}

/* ---------- AVATAR ---------- */
.avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-primary { background: var(--primary-bg); color: var(--primary); }
.avatar-accent  { background: var(--accent-bg);  color: var(--accent); }

/* ---------- GRID SYSTEM ---------- */
.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); } .gap-8 { gap: var(--sp-8); }

/* ---------- UTILITIES ---------- */
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); } .mb-8 { margin-bottom: var(--sp-8); }
.mt-4 { margin-top: var(--sp-4); }   .mt-8 { margin-top: var(--sp-8); }

.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 15px var(--primary-glow); }
  50% { box-shadow: 0 0 30px var(--primary-glow); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-10px, 20px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.02); }
}

.animate-in { animation: fadeInUp 0.5s var(--ease) both; }
.animate-in-1 { animation-delay: 0.1s; }
.animate-in-2 { animation-delay: 0.2s; }
.animate-in-3 { animation-delay: 0.3s; }
.animate-in-4 { animation-delay: 0.4s; }
.animate-in-5 { animation-delay: 0.5s; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
