/* ============================================
   AIXRA - Premium AI Platform Design System
   ============================================ */

:root {
  /* Brand Colors */
  --aixra-black: #0A0A0F;
  --aixra-bg: #0B0D14;
  --aixra-surface: #11141C;
  --aixra-surface-2: #1A1F2E;
  --aixra-border: #1F2937;
  --aixra-border-light: #2D3748;
  
  /* Blue Gradient */
  --aixra-blue-deep: #1E3A8A;
  --aixra-blue: #2563EB;
  --aixra-blue-light: #3B82F6;
  --aixra-blue-glow: #60A5FA;
  
  /* Text */
  --aixra-text: #F5F5F7;
  --aixra-text-muted: #9CA3AF;
  --aixra-text-dim: #6B7280;
  
  /* Accents */
  --aixra-success: #10B981;
  --aixra-warning: #F59E0B;
  --aixra-danger: #EF4444;
  
  /* Effects */
  --aixra-glow: 0 0 40px rgba(59, 130, 246, 0.35);
  --aixra-glow-strong: 0 0 60px rgba(59, 130, 246, 0.5);
  --aixra-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.5);
  
  /* Gradients */
  --grad-primary: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
  --grad-dark: linear-gradient(180deg, #0A0A0F 0%, #11141C 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(59,130,246,0.15), transparent 70%);
  
  /* Typography */
  --font-display: 'Tajawal', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-body: 'Tajawal', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

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

/* Animated background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* Glow orb background */
body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(59,130,246,0.15), transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

main, .page-wrap { position: relative; z-index: 1; }

/* ============ Typography ============ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }

.gradient-text {
  background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 50%, #1E40AF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-muted { color: var(--aixra-text-muted); }
.text-dim { color: var(--aixra-text-dim); }

/* ============ Navbar ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--aixra-border);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--aixra-text);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.nav-logo .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aixra-blue-light);
  box-shadow: 0 0 12px var(--aixra-blue-light);
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--aixra-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover { color: var(--aixra-text); }

.nav-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s;
}
.btn-primary:hover::before { left: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--aixra-text);
  border: 1px solid var(--aixra-border-light);
}
.btn-ghost:hover {
  background: var(--aixra-surface);
  border-color: var(--aixra-blue);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-block { width: 100%; }

/* ============ Containers ============ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============ Cards ============ */
.card {
  background: var(--aixra-surface);
  border: 1px solid var(--aixra-border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--aixra-blue);
  transform: translateY(-4px);
  box-shadow: var(--aixra-shadow);
}

.card-glow {
  background: linear-gradient(180deg, var(--aixra-surface) 0%, var(--aixra-surface-2) 100%);
  border: 1px solid var(--aixra-blue);
  box-shadow: var(--aixra-glow);
}

/* ============ Forms ============ */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--aixra-text-muted);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--aixra-surface);
  border: 1px solid var(--aixra-border-light);
  border-radius: 10px;
  color: var(--aixra-text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--aixra-blue-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

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

/* ============ Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-blue {
  background: rgba(59,130,246,0.1);
  color: var(--aixra-blue-light);
  border: 1px solid rgba(59,130,246,0.3);
}

.badge-success {
  background: rgba(16,185,129,0.1);
  color: var(--aixra-success);
  border: 1px solid rgba(16,185,129,0.3);
}

.badge-warning {
  background: rgba(245,158,11,0.1);
  color: var(--aixra-warning);
  border: 1px solid rgba(245,158,11,0.3);
}

.badge-danger {
  background: rgba(239,68,68,0.1);
  color: var(--aixra-danger);
  border: 1px solid rgba(239,68,68,0.3);
}

/* ============ Dashboard Layout ============ */
.dash-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--aixra-surface);
  border-left: 1px solid var(--aixra-border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-logo {
  padding: 0.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--aixra-border);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--aixra-text);
  text-decoration: none;
}

.sidebar-section {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--aixra-text-dim);
  padding: 1rem 1rem 0.5rem;
  letter-spacing: 0.1em;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--aixra-text-muted);
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-link:hover {
  background: var(--aixra-surface-2);
  color: var(--aixra-text);
}

.sidebar-link.active {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.sidebar-link svg, .sidebar-link i {
  width: 20px; height: 20px;
  flex-shrink: 0;
}

.dash-main {
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--aixra-border);
}

.dash-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.dash-subtitle {
  color: var(--aixra-text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* ============ Stats ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--aixra-surface);
  border: 1px solid var(--aixra-border);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(59,130,246,0.1), transparent);
  border-radius: 50%;
  transform: translate(40%, -40%);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59,130,246,0.1);
  color: var(--aixra-blue-light);
  margin-bottom: 1rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--aixra-text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--aixra-text);
}

.stat-trend {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: var(--aixra-success);
}

/* ============ Tables ============ */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--aixra-surface);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--aixra-border);
}

.table th {
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
  color: var(--aixra-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--aixra-surface-2);
  border-bottom: 1px solid var(--aixra-border);
}

.table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--aixra-border);
  font-size: 0.95rem;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(59,130,246,0.04); }

/* ============ Alerts ============ */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.3);
  color: var(--aixra-success);
}

.alert-warning {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.3);
  color: var(--aixra-warning);
}

.alert-danger {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.3);
  color: var(--aixra-danger);
}

/* ============ Animations ============ */
.fade-up {
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ============ Footer ============ */
.footer {
  margin-top: 6rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--aixra-border);
  background: var(--aixra-surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-desc {
  color: var(--aixra-text-muted);
  font-size: 0.9rem;
  max-width: 320px;
}

.footer-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: var(--aixra-text);
}

.footer ul { list-style: none; }
.footer li { margin-bottom: 0.5rem; }
.footer a {
  color: var(--aixra-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer a:hover { color: var(--aixra-blue-light); }

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--aixra-border);
  text-align: center;
  color: var(--aixra-text-dim);
  font-size: 0.85rem;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .dash-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dash-main { padding: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .container { padding: 0 1rem; }
}

/* ============ Utilities ============ */
.flex { display: flex; }
.grid { display: grid; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mt-8 { margin-top: 4rem; }
.w-full { width: 100%; }
.hidden { display: none; }
