/* ═══════════════════════════════════════════════════════════
   CODE ART — Premium Design System
   Discord-inspired dark theme with glassmorphism & animations
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ═══ CSS VARIABLES ═══ */
:root {
  /* Primary palette */
  --primary: #6c63ff;
  --primary-hover: #5a52e0;
  --primary-light: rgba(108, 99, 255, 0.15);
  --primary-glow: rgba(108, 99, 255, 0.4);

  /* Accent colors */
  --accent-green: #4ade80;
  --accent-green-bg: rgba(74, 222, 128, 0.12);
  --accent-red: #f87171;
  --accent-red-bg: rgba(248, 113, 113, 0.12);
  --accent-yellow: #fbbf24;
  --accent-yellow-bg: rgba(251, 191, 36, 0.12);
  --accent-cyan: #22d3ee;
  --accent-cyan-bg: rgba(34, 211, 238, 0.12);
  --accent-pink: #f472b6;

  /* Background hierarchy */
  --bg-deep: #0a0a0f;
  --bg-base: #0f0f17;
  --bg-surface: #161622;
  --bg-elevated: #1e1e2e;
  --bg-overlay: #252536;
  --bg-hover: #2a2a3d;
  --bg-glass: rgba(22, 22, 34, 0.7);

  /* Text */
  --text-primary: #f1f1f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;
  --text-inverse: #0a0a0f;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: rgba(108, 99, 255, 0.4);

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

  /* Spacing */
  --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;
  --sp-20: 80px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.15);
  --shadow-inner: inset 0 1px 4px rgba(0, 0, 0, 0.3);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --duration: 0.2s;
  --duration-md: 0.3s;
  --duration-lg: 0.5s;

  /* Container */
  --container: 1280px;
  --sidebar-width: 260px;
}

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

html {
  background: var(--bg-deep);/* #0a0a0f */
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: transparent;
  /* Mesh background handled by .bg-mesh */
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.fade-out {
  opacity: 0 !important;
  transition: opacity 1s ease;
}

/* ── INTENSIFYING GLITCH ── */
.glitch-intensify {
  animation: glitch-mild 10s infinite;
}

.glitch-intensify.lv-2 {
  animation: glitch-medium 5s infinite;
}

.glitch-intensify.lv-3 {
  animation: glitch-heavy 2s infinite;
}

@keyframes glitch-mild {

  0%,
  100% {
    transform: translate(0);
    text-shadow: 0 0 0 transparent;
  }

  10%,
  80% {
    transform: translate(-1px, 1px);
    text-shadow: 1px 0 var(--accent-cyan);
  }

  30%,
  60% {
    transform: translate(1px, -1px);
    text-shadow: -1px 0 var(--accent-pink);
  }
}

@keyframes glitch-medium {
  0% {
    transform: translate(0);
  }

  20% {
    transform: translate(-3px, 2px);
    background: rgba(108, 99, 255, 0.1);
  }

  40% {
    transform: translate(-3px, -2px);
    text-shadow: 3px 0 var(--accent-cyan), -3px 0 var(--accent-pink);
  }

  60% {
    transform: translate(3px, 2px);
  }

  80% {
    transform: translate(3px, -2px);
  }

  100% {
    transform: translate(0);
  }
}

@keyframes glitch-heavy {
  0% {
    transform: translate(0);
    filter: hue-rotate(0deg);
  }

  25% {
    transform: translate(-6px, 4px);
    filter: hue-rotate(90deg) blur(1px);
  }

  50% {
    transform: translate(-6px, -4px);
    text-shadow: 6px 0 var(--accent-cyan), -6px 0 var(--accent-pink);
  }

  75% {
    transform: translate(6px, 4px);
    filter: hue-rotate(180deg);
  }

  100% {
    transform: translate(0);
  }
}

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

a:hover {
  color: var(--primary-hover);
}

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

ul,
ol {
  list-style: none;
}

/* ═══ PREMIUM MESH BACKGROUND ═══ */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--bg-deep);
  /* This is the actual base color */
  overflow: hidden;
  pointer-events: none;
}

.bg-mesh::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(108, 99, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(34, 211, 238, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(244, 114, 182, 0.08) 0%, transparent 50%);
  filter: blur(80px);
  animation: meshMove 20s ease-in-out infinite alternate;
}

.bg-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
}

@keyframes meshMove {
  0% {
    transform: scale(1) translate(0, 0);
  }

  100% {
    transform: scale(1.2) translate(5%, 5%);
  }
}

#bg-canvas {
  display: none;
}

/* Removed old stars */

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ═══ CONTAINER ═══ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  position: relative;
  z-index: 1;
}

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--duration);
}

.btn:hover::after {
  opacity: 1;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 12px rgba(108, 99, 255, 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(108, 99, 255, 0.5);
}

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

.btn--secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn--danger {
  background: linear-gradient(135deg, var(--accent-red), #ef4444);
  color: #fff;
}

.btn--danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(248, 113, 113, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn--ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn--sm {
  padding: 6px 14px;
  font-size: var(--text-xs);
}

.btn--lg {
  padding: 14px 32px;
  font-size: var(--text-base);
}

.btn--xl {
  padding: 16px 40px;
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn--full {
  width: 100%;
}

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

.btn--icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: all var(--duration-md) var(--ease);
  position: relative;
  z-index: 1;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.card--glass {
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.card--glow {
  animation: glowPulse 4s infinite alternate;
}

.card--glow:hover {
  box-shadow: 0 0 40px rgba(108, 99, 255, 0.6), inset 0 0 20px rgba(108, 99, 255, 0.2);
  border-color: var(--primary);
  transform: translateY(-4px) scale(1.02);
}

/* ═══ ANIMATIONS ═══ */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }

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

@keyframes float {

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

  50% {
    transform: translateY(-12px);
  }
}

@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(108, 99, 255, 0.2);
    border-color: rgba(108, 99, 255, 0.2);
  }

  50% {
    box-shadow: 0 0 40px rgba(108, 99, 255, 0.5), inset 0 0 15px rgba(108, 99, 255, 0.1);
    border-color: rgba(108, 99, 255, 0.6);
  }
}

.stagger-1 {
  animation: slideUpFade 0.6s var(--ease-bounce) 0.1s both;
}

.stagger-2 {
  animation: slideUpFade 0.6s var(--ease-bounce) 0.2s both;
}

.stagger-3 {
  animation: slideUpFade 0.6s var(--ease-bounce) 0.3s both;
}

.stagger-4 {
  animation: slideUpFade 0.6s var(--ease-bounce) 0.4s both;
}

.stagger-5 {
  animation: slideUpFade 0.6s var(--ease-bounce) 0.5s both;
}

.floating {
  animation: float 6s ease-in-out infinite;
}

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge--primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge--green {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.badge--red {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.badge--yellow {
  background: var(--accent-yellow-bg);
  color: var(--accent-yellow);
}

.badge--cyan {
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
}

.renewal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: pulseCyan 2s ease-in-out infinite;
}

@keyframes pulseCyan {
  0%, 100% { opacity: 1; box-shadow: 0 0 5px rgba(34, 211, 238, 0.2); }
  50%      { opacity: 0.7; box-shadow: 0 0 10px rgba(34, 211, 238, 0.4); }
}

/* ═══ DOT INDICATOR ═══ */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot--green {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.dot--red {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.dot--yellow {
  background: var(--accent-yellow);
  box-shadow: 0 0 8px var(--accent-yellow);
}

.dot--pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ═══ FORMS ═══ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: var(--text-sm);
  transition: all var(--duration) var(--ease);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

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

.form-select {
  cursor: pointer;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Toggle */
.toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
}

.toggle input {
  display: none;
}

.toggle__slider {
  width: 44px;
  height: 24px;
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--duration);
}

.toggle__slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--duration) var(--ease);
}

.toggle input:checked+.toggle__slider {
  background: var(--primary);
}

.toggle input:checked+.toggle__slider::after {
  transform: translateX(20px);
  background: #fff;
}

/* ═══ TABLES ═══ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.table th {
  background: var(--bg-elevated);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: var(--bg-surface);
}

.table td {
  color: var(--text-primary);
}

/* ═══ MODALS ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-md);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--duration-md) var(--ease-bounce);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: 700;
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--sp-1);
  line-height: 1;
}

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

/* ═══ FLASH MESSAGES ═══ */
.flash {
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  animation: flashIn 0.4s var(--ease);
  position: relative;
}

.flash--success {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.flash--error {
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.flash__dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  font-size: 1.1rem;
}

.flash__dismiss:hover {
  opacity: 1;
}

@keyframes flashIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══ SECTION TYPOGRAPHY ═══ */
.section {
  padding: var(--sp-20) 0;
}

.section__eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary);
  margin-bottom: var(--sp-3);
}

.section__title {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}

.section__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-cyan) 50%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(108, 99, 255, 0.3));
  font-weight: 800;
}

.text-glow {
  text-shadow: 0 0 20px var(--primary-glow), 0 0 40px rgba(108, 99, 255, 0.2);
}

.text-glow--cyan {
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.4), 0 0 40px rgba(34, 211, 238, 0.2);
}


/* ═══ GRID LAYOUTS ═══ */
.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);
}

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

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

@media (max-width: 640px) {

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

/* ═══ FLEX UTILS ═══ */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--sp-2);
}

.gap-3 {
  gap: var(--sp-3);
}

.gap-4 {
  gap: var(--sp-4);
}

.gap-6 {
  gap: var(--sp-6);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* ═══ SPACING UTILS ═══ */
.mt-2 {
  margin-top: var(--sp-2);
}

.mt-4 {
  margin-top: var(--sp-4);
}

.mt-6 {
  margin-top: var(--sp-6);
}

.mt-8 {
  margin-top: var(--sp-8);
}

.mb-4 {
  margin-bottom: var(--sp-4);
}

.mb-6 {
  margin-bottom: var(--sp-6);
}

.mb-8 {
  margin-bottom: var(--sp-8);
}

/* ═══ NAVBAR ═══ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--sp-4) 0;
  transition: all var(--duration-md);
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.9);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar__logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.navbar__link {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--duration);
  position: relative;
}

.navbar__link:hover,
.navbar__link.active {
  color: var(--text-primary);
}

.navbar__link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.navbar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--primary);
}

.navbar__user-menu {
  position: relative;
}

.navbar__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 101;
}

.navbar__dropdown.show {
  display: block;
  animation: dropInBounce 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-origin: top right;
}

@keyframes dropInBounce {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.navbar__dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all var(--duration);
}

.navbar__dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.navbar__dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-2) 0;
}

.navbar__mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .navbar__links {
    display: none;
  }

  .navbar__mobile-toggle {
    display: block;
  }
}

/* ═══ FOOTER ═══ */
.footer {
  padding: var(--sp-16) 0 var(--sp-8);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-20);
  position: relative;
  z-index: 1;
}

.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-10);
}

.footer__brand-desc {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: var(--sp-4);
  max-width: 300px;
}

.footer__heading {
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.footer__link {
  display: block;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-2);
  transition: color var(--duration);
}

.footer__link:hover {
  color: var(--primary);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

@media (max-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .footer__inner {
    grid-template-columns: 1fr;
  }
}

/* ═══ SIDEBAR — Aceternity Style ═══ */

:root {
  --sidebar-width-collapsed: 60px;
  --sidebar-width-expanded: 240px;
  --sidebar-transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Layout ── */
.layout-dashboard {
  display: flex;
  min-height: 100vh;
  padding-top: 65px;
}

/* ── Sidebar wrapper ── */
.sidebar {
  width: var(--sidebar-width-collapsed);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: var(--sp-6) var(--sp-3);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 150;
  transition: width var(--sidebar-transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.sidebar--designed {
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(108, 99, 255, 0.05) 100%);
  border-right: 1px solid rgba(108, 99, 255, 0.15);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar--designed::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(108, 99, 255, 0.15), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Expand on hover (desktop) */
.sidebar:hover,
.sidebar.open {
  width: var(--sidebar-width-expanded);
}

/* ── Logo area ── */
.sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-4);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar__logo-icon {
  width: 24px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 6px 2px 6px 2px;
  /* tl tr br bl — Aceternity shape */
  background: var(--text-primary, #000);
}

.sidebar__logo-text {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity var(--sidebar-transition),
    transform var(--sidebar-transition);
}

.sidebar:hover .sidebar__logo-text,
.sidebar.open .sidebar__logo-text {
  opacity: 1;
  transform: translateX(0);
}

/* ── Section & Heading ── */
.sidebar__section {
  margin-bottom: var(--sp-6);
}

.sidebar__heading {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 var(--sp-3);
  margin-bottom: var(--sp-2);
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--sidebar-transition);
}

.sidebar:hover .sidebar__heading,
.sidebar.open .sidebar__heading {
  opacity: 1;
}

/* ── Nav Links ── */
.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition:
    background var(--duration),
    color var(--duration);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
}

.sidebar__link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar__link.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Icon ── */
.sidebar__icon {
  width: 18px;
  min-width: 18px;
  /* prevent icon from shrinking */
  text-align: center;
  opacity: 0.7;
  transition: opacity var(--duration);
  flex-shrink: 0;
}

.sidebar__link:hover .sidebar__icon,
.sidebar__link.active .sidebar__icon {
  opacity: 1;
}

/* ── Link label (hidden when collapsed) ── */
.sidebar__label {
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity var(--sidebar-transition),
    transform var(--sidebar-transition);
  overflow: hidden;
}

.sidebar:hover .sidebar__label,
.sidebar.open .sidebar__label {
  opacity: 1;
  transform: translateX(0);
}

/* ── User profile (bottom) ── */
.sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: background var(--duration);
  margin-top: auto;
}

.sidebar__user:hover {
  background: var(--bg-hover);
}

.sidebar__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.sidebar__user-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity var(--sidebar-transition),
    transform var(--sidebar-transition);
}

.sidebar:hover .sidebar__user-name,
.sidebar.open .sidebar__user-name {
  opacity: 1;
  transform: translateX(0);
}

/* ── Dashboard content ── */
.dashboard-content {
  flex: 1;
  margin-left: var(--sidebar-width-collapsed);
  padding: var(--sp-8);
  min-width: 0;
  transition: margin-left var(--sidebar-transition);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition:
      transform var(--sidebar-transition),
      width var(--sidebar-transition);
    width: var(--sidebar-width-expanded);
  }

  .sidebar.open {
    transform: translateX(0);
    width: var(--sidebar-width-expanded);
  }

  /* على الموبايل: Labels و Logo text تظهر دائماً لأن الـ sidebar مفتوح بالكامل */
  .sidebar.open .sidebar__label,
  .sidebar.open .sidebar__logo-text,
  .sidebar.open .sidebar__user-name,
  .sidebar.open .sidebar__heading {
    opacity: 1;
    transform: translateX(0);
  }

  .dashboard-content {
    margin-left: 0;
    padding: var(--sp-4);
  }
}

/* ── Global Responsive Utilities ── */
@media (max-width: 640px) {
  .container { padding: 0 var(--sp-4); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
  .hide-mobile { display: none !important; }
}
@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

/* ═══ STAT CARD ═══ */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: all var(--duration-md);
}

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

.stat-card__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card__value {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-card__change {
  font-size: var(--text-xs);
  font-weight: 600;
}

.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: var(--sp-2);
}

/* ═══ MODULE CARD ═══ */
.module-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--duration-md) var(--ease);
}

.module-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(108, 99, 255, 0.3);
  border-color: var(--primary);
}

.module-card__image {
  height: 160px;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-overlay));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.module-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-card__image-placeholder {
  font-size: 2.5rem;
  opacity: 0.3;
}

.module-card__body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;
}

.module-card__category {
  font-size: var(--text-xs);
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.module-card__name {
  font-size: var(--text-lg);
  font-weight: 700;
}

.module-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.module-card__deps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--sp-1);
}

.dep-badge {
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cart-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bundle-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--primary);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.cart-item__name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.module-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.module-card__price {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--accent-green);
}

.module-card__price span {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 400;
}

/* ═══ BOT CARD ═══ */
.bot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  transition: all var(--duration-md);
}

.bot-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.bot-card__icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.bot-card__info {
  flex: 1;
  min-width: 0;
}

.bot-card__name {
  font-weight: 700;
  font-size: var(--text-base);
}

.bot-card__meta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.bot-card__actions {
  display: flex;
  gap: var(--sp-2);
}

/* ═══ TABS ═══ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}

.tab {
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--duration);
  text-decoration: none;
  cursor: pointer;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--sp-4);
  opacity: 0.3;
}

.empty-state__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.empty-state__desc {
  color: var(--text-secondary);
  margin-bottom: var(--sp-6);
}

/* ═══ PAGE HEADER ═══ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.page-header__title {
  font-size: var(--text-2xl);
  font-weight: 800;
}

.page-header__subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ═══ SEARCH BAR ═══ */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-4);
  transition: border-color var(--duration);
}

.search-bar:focus-within {
  border-color: var(--primary);
}

.search-bar__icon {
  color: var(--text-muted);
}

.search-bar__input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: var(--text-sm);
  outline: none;
  flex: 1;
}

/* ═══ LOADING ═══ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══ MAIN CONTENT ═══ */
.main-content {
  padding-top: 65px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ═══ ERROR PAGE ═══ */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.error-page__code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--primary);
  opacity: 0.3;
}

.error-page__message {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  margin: var(--sp-4) 0;
}

/* ═══ PERMISSION GRID ═══ */
.perm-group {
  margin-bottom: var(--sp-6);
}

.perm-group__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.perm-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-2);
}

.perm-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--duration);
}

.perm-item:hover {
  background: var(--bg-elevated);
}

.perm-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ═══ CATEGORY FILTER ═══ */
.category-filter {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}

.category-pill {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration);
  text-decoration: none;
}

.category-pill:hover,
.category-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* ═══ ANIMATIONS ═══ */
.fade-in {
  animation: fadeIn var(--duration-md) var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp var(--duration-md) var(--ease);
}

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

  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══ CART DRAWER ═══ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-md);
}

.cart-overlay.show {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-bounce);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer__header {
  padding: var(--sp-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-drawer__close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.cart-drawer__close:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-6);
}

.cart-drawer__footer {
  padding: var(--sp-6);
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}

/* ── TOAST NOTIFICATIONS ── */
#toast-container {
  position: fixed;
  top: 85px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: rgba(26, 26, 46, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  width: 100%;
  animation: toast-progress 4s linear forwards;
}

.toast--error::after {
  background: var(--accent-red);
}

.toast--sale {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.9), rgba(167, 139, 250, 0.9)) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.toast--sale::after {
  display: none;
}

.toast.hiding {
  opacity: 0;
  transform: translateX(100px);
}

@keyframes toast-in {
  0% {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }

  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes toast-progress {
  0% {
    width: 100%;
  }

  100% {
    width: 0%;
  }
}

/* ── PREMIUM MODAL ── */
.ca-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ca-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.ca-modal-card {
  width: 100%;
  max-width: 500px;
  background: rgba(23, 23, 33, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.95) translateY(30px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.ca-modal-overlay.is-active .ca-modal-card {
  transform: scale(1) translateY(0);
}

.ca-modal-header {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent);
}

.ca-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(to right, #fff, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ca-modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ca-modal-close:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

.ca-modal-body {
  padding: 2rem;
}

/* ═══ BENTO GRID ═══ */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  gap: var(--sp-6);
  margin-top: var(--sp-12);
}

.bento__item {
  position: relative;
  overflow: hidden;
}

.bento__item--2x2 {
  grid-column: span 2;
  grid-row: span 2;
}

.bento__item--2x1 {
  grid-column: span 2;
}

.bento__item--1x2 {
  grid-row: span 2;
}

@media (max-width: 1024px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
}

@media (max-width: 640px) {
  .bento {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .bento__item--2x2,
  .bento__item--2x1,
  .bento__item--1x2 {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* ═══ ADVANCED GLASS ═══ */
.glass-card {
  background: rgba(22, 22, 34, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  transition: all var(--duration-md) var(--ease);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: 0.5s;
}

.glass-card:hover::before {
  left: 100%;
}

.glass-card:hover {
  border-color: rgba(108, 99, 255, 0.3);
  background: rgba(22, 22, 34, 0.6);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* ═══ GLOWS ═══ */
.glow-border {
  position: relative;
}

.glow-border::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan), var(--accent-pink));
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
}

.glow-border:hover::after {
  opacity: 0.5;
}

/* ═══ DECORATIVE CSS SHAPES ═══ */
.shape {
  position: absolute;
  filter: blur(60px);
  z-index: -1;
  opacity: 0.3;
  pointer-events: none;
}

.shape--purple {
  background: var(--primary);
  width: 300px;
  height: 300px;
  border-radius: 50%;
}

.shape--cyan {
  background: var(--accent-cyan);
  width: 250px;
  height: 250px;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

/* ═══ ANIMATIONS ═══ */
@keyframes borderRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s var(--ease);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ═══ PREMIUM CTA SECTION ═══ */
.cta-section--premium {
  padding: var(--sp-20) 0;
  position: relative;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(to bottom, transparent, rgba(10, 10, 15, 0.8));
}

.cta-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  filter: blur(100px);
  opacity: 0.4;
  z-index: -1;
}

.cta-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}

.cta-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--sp-10);
}

.cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.cta-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ═══ PREMIUM FOOTER ═══ */
.footer {
  background: rgba(10, 10, 15, 0.4);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid var(--border);
  padding: var(--sp-16) 0 var(--sp-8);
  margin-top: 0;
  /* Continuous flow */
}

.footer__link {
  position: relative;
  padding-bottom: 2px;
}

.footer__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.footer__link:hover::after {
  width: 100%;
}

.footer__heading {
  color: #fff;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-6);
  position: relative;
}

.footer__heading::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--primary);
}

/* ═══ HUD & ERROR PAGE ═══ */
.error-page {
  min-height: calc(100vh - 100px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  padding: var(--sp-12) 0;
}

@media (max-width: 1024px) {
  .error-page {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
}

.error-mega {
  font-size: clamp(8rem, 15vw, 12rem);
  font-weight: 900;
  line-height: 0.8;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(108, 99, 255, 0.3));
  animation: errorPulse 4s ease-in-out infinite;
}

@keyframes errorPulse {

  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 30px rgba(108, 99, 255, 0.3));
  }

  50% {
    opacity: 0.8;
    filter: drop-shadow(0 0 50px rgba(34, 211, 238, 0.5));
  }
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 20px;
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.hud-pill__dot {
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-red);
  animation: blink 1s infinite;
}

.hud-box {
  position: absolute;
  padding: 1px 4px;
  /* Ultra-minimal */
  background: rgba(255, 255, 255, 0.015);
  border: 0.5px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(1px);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.45rem;
  /* ~7px */
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
  opacity: 0.25;
  /* Ghost-like */
  transition: all 0.3s ease;
}

.hud-box--tl {
  top: 5%;
  left: 5%;
}

.hud-box--tr {
  top: 5%;
  right: 5%;
}

.hud-box--bl {
  bottom: 5%;
  left: 5%;
}

.hud-box--br {
  bottom: 5%;
  right: 5%;
}

/* Distributed HUD jitter */
.hud-box:nth-child(1) {
  top: 8%;
  left: 2%;
}

.hud-box:nth-child(2) {
  top: 12%;
  left: 15%;
}

.hud-box:nth-child(3) {
  top: 3%;
  left: 30%;
}

.hud-box:nth-child(4) {
  top: 18%;
  right: 2%;
}

.hud-box:nth-child(5) {
  top: 28%;
  right: 12%;
}

.hud-box:nth-child(6) {
  bottom: 3%;
  left: 20%;
}

.hud-box:nth-child(7) {
  bottom: 15%;
  left: 2%;
}

.hud-box:nth-child(8) {
  bottom: 12%;
  right: 18%;
}

.hud-box:nth-child(9) {
  bottom: 25%;
  right: 2%;
}

.hud-box:nth-child(10) {
  top: 40%;
  left: 1%;
}

.hud-box:nth-child(11) {
  top: 48%;
  right: 1%;
}

.hud-box:nth-child(12) {
  bottom: 38%;
  left: 8%;
}

.hud-box:nth-child(13) {
  bottom: 52%;
  right: 8%;
}

.hud-box:nth-child(14) {
  top: 65%;
  left: 3%;
}

.hud-box:nth-child(15) {
  top: 78%;
  right: 10%;
}

.hud-box:nth-child(16) {
  bottom: 72%;
  left: 2%;
}

.hud-box--label {
  color: var(--accent-cyan);
  font-weight: 700;
  margin-right: 4px;
  opacity: 0.7;
}

.error-terminal {
  background: rgba(10, 10, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 3rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.error-terminal__header {
  display: flex;
  gap: 6px;
  margin-bottom: 1rem;
}

.error-terminal__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.error-log-box {
  padding: 1.5rem;
  background: rgba(10, 10, 15, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
  height: 200px;
  overflow-y: auto;
  mask-image: linear-gradient(to bottom, black 70%, transparent);
}

.log-entry--error {
  color: var(--accent-red);
}

.log-entry--info {
  color: var(--accent-cyan);
}

.log-entry {
  margin-bottom: 4px;
}

/* ── SHATTER EFFECT ── */
#shatter-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  background: transparent;
  transition: background 1s ease;
}

#shatter-overlay.active {
  background: #000;
  pointer-events: all;
}

.shard {
  position: absolute;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.2);
  /* Darker foggy shard */
  backdrop-filter: blur(12px) brightness(0.6);
  /* "مغيم" effect */
  -webkit-backdrop-filter: blur(12px) brightness(0.6);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  transition: transform 1.5s cubic-bezier(0.1, 0, 0.1, 1), opacity 1.5s ease;
  z-index: 10;
}

.shard.shattered {
  opacity: 0;
  transform: translate(calc(var(--tx) * 1px), calc(var(--ty) * 1px)) rotate(calc(var(--tr) * 1deg)) scale(0.3);
}

.visual-center {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.radar-ring {
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(108, 99, 255, 0.1);
  border-radius: 50%;
}

.radar-ring:nth-child(2) {
  width: 450px;
  height: 450px;
  border-style: dashed;
  opacity: 0.5;
  animation: spin 20s linear infinite;
}

.radar-ring:nth-child(3) {
  width: 600px;
  height: 600px;
  opacity: 0.3;
  animation: spin 40s linear infinite reverse;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}