/* ============================================
   SIGMA HUB - Design System
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Variables (Light Mode Default) ---- */
:root {
  /* Primary Colors */
  --primary: #1a8fe3;
  --primary-dark: #0d5ca8;
  --primary-light: #4db0f0;
  --primary-rgb: 26, 143, 227;

  /* Accent */
  --accent: #f5a623;
  --accent-dark: #d4891a;
  --accent-light: #ffc965;
  --accent-rgb: 245, 166, 35;

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Backgrounds */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #edf1f7;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-overlay: rgba(0, 0, 0, 0.5);

  /* Text */
  --text-primary: #0a1628;
  --text-secondary: #4a5568;
  --text-muted: #8896a8;
  --text-inverse: #ffffff;

  /* Borders */
  --border-color: #e2e8f0;
  --border-light: #f0f3f8;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
  --shadow-glow: 0 0 30px rgba(26, 143, 227, 0.3);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Typography */
  --font-en: 'Inter', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  --font-family: var(--font-en);

  /* Navbar */
  --navbar-height: 72px;

  /* Gradient */
  --gradient-primary: linear-gradient(135deg, #1a8fe3 0%, #0d5ca8 100%);
  --gradient-accent: linear-gradient(135deg, #f5a623 0%, #ff6b35 100%);
  --gradient-hero: linear-gradient(135deg, #0a1628 0%, #1a3a5c 50%, #0d5ca8 100%);
  --gradient-card: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --bg-primary: #0a1628;
  --bg-secondary: #111d33;
  --bg-tertiary: #1a2940;
  --bg-card: #15233d;
  --bg-glass: rgba(17, 29, 51, 0.8);
  --bg-overlay: rgba(0, 0, 0, 0.7);

  --text-primary: #e8edf5;
  --text-secondary: #a0b0c5;
  --text-muted: #607590;
  --text-inverse: #0a1628;

  --border-color: #1e3050;
  --border-light: #162540;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px rgba(26, 143, 227, 0.2);

  --gradient-card: linear-gradient(145deg, #15233d 0%, #1a2940 100%);
}

/* ---- RTL Support ---- */
[dir="rtl"] {
  --font-family: var(--font-ar);
}

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

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

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition-base), color var(--transition-base);
}

[dir="rtl"] body {
  font-family: var(--font-ar);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul, ol {
  list-style: none;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  outline: none;
  border: none;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

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

.text-accent {
  color: var(--accent);
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* ---- Flex / Grid Utilities ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.grid {
  display: grid;
  gap: var(--space-lg);
}

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

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all var(--transition-base);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.4rem;
  font-weight: 800;
  direction: ltr;
  unicode-bidi: bidi-override;
}

.navbar-brand img {
  height: 42px;
  width: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--primary-rgb), 0.2);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.15);
  background: var(--bg-secondary);
  padding: 3px;
}

.navbar-brand span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

[dir="rtl"] .nav-links a::after {
  left: auto;
  right: 0;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Theme & Language Toggle */
.toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-color);
}

.toggle-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Mobile Menu */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1001;
  position: relative;
}

.mobile-toggle span {
  width: 24px;
  height: 2.5px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}
.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Hero Section ---- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  padding-top: var(--navbar-height);
  background: var(--gradient-hero);
  overflow: hidden;
}

.hero-inner {
  gap: var(--space-3xl);
  min-height: calc(100vh - var(--navbar-height));
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(26, 143, 227, 0.15) 0%, transparent 70%),
              radial-gradient(ellipse at 70% 30%, rgba(245, 166, 35, 0.1) 0%, transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-content h1 {
  color: #ffffff;
  margin-bottom: var(--space-lg);
  font-weight: 900;
}

.hero-content h1 .highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.15rem;
  margin-bottom: var(--space-xl);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-image {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-visual {
  position: relative;
  width: 400px;
  height: 400px;
}

.hero-visual .floating-card {
  position: absolute;
  background: var(--bg-glass);
  backdrop-filter: blur(15px);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid rgba(255,255,255,0.15);
  animation: float 6s ease-in-out infinite;
  color: white;
}

.hero-visual .floating-card:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.hero-visual .floating-card:nth-child(2) { top: 45%; right: 0; animation-delay: 2s; }
.hero-visual .floating-card:nth-child(3) { bottom: 5%; left: 15%; animation-delay: 4s; }

.hero-visual .floating-card i {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  color: var(--accent);
}

.hero-visual .floating-card h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: var(--space-xs);
}

.hero-visual .floating-card p {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
}

/* Animated particles */
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1;
}

.hero-particles .particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: particleFloat linear infinite;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(var(--primary-rgb), 0.5);
}

.btn-accent {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.4);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(var(--accent-rgb), 0.5);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

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

.btn-ghost:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: var(--space-lg);
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.card-title {
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
  font-weight: 700;
}

.card-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-meta span i { color: var(--accent); }

/* ---- Stats Section ---- */
.stats {
  background: var(--gradient-primary);
  padding: var(--space-3xl) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

.stat-item {
  text-align: center;
  color: white;
}

.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: 0.95rem;
  opacity: 0.85;
}

/* ---- Features Section ---- */
.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.feature-icon {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-lg);
  background: rgba(var(--primary-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: 1.8rem;
  color: var(--primary);
  transition: all var(--transition-base);
}

.feature-card:hover .feature-icon {
  background: var(--gradient-primary);
  color: white;
  transform: scale(1.1);
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.15rem;
}

.feature-card p {
  font-size: 0.9rem;
}

/* ---- Categories Section ---- */
.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gradient-primary);
  padding: var(--space-xl);
  color: white;
  transition: all var(--transition-base);
  cursor: pointer;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
  transition: all var(--transition-base);
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.category-card:hover::before {
  background: linear-gradient(135deg, rgba(0,0,0,0), rgba(0,0,0,0.2));
}

.category-card:nth-child(2) { background: linear-gradient(135deg, #f5a623, #ff6b35); }
.category-card:nth-child(3) { background: linear-gradient(135deg, #10b981, #059669); }
.category-card:nth-child(4) { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.category-card i {
  position: relative;
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  z-index: 1;
}

.category-card h3 {
  position: relative;
  color: white;
  font-size: 1.1rem;
  z-index: 1;
}

.category-card p {
  position: relative;
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  z-index: 1;
}

/* ---- CTA Section ---- */
.cta-section {
  background: var(--gradient-hero);
  padding: var(--space-4xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(26, 143, 227, 0.1), transparent 70%);
  animation: rotateBg 20s linear infinite;
}

.cta-section h2 { color: white; margin-bottom: var(--space-md); position: relative; }
.cta-section p { color: rgba(255,255,255,0.8); font-size: 1.1rem; margin-bottom: var(--space-xl); position: relative; max-width: 600px; margin-left: auto; margin-right: auto; margin-bottom: var(--space-xl); }
.cta-section .btn { position: relative; }

/* ---- Footer ---- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-3xl) 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand p {
  margin-top: var(--space-md);
  font-size: 0.9rem;
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 1px solid var(--border-color);
}

.footer-social a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: var(--space-lg);
  position: relative;
  padding-bottom: var(--space-sm);
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

[dir="rtl"] .footer-col h4::after {
  left: auto;
  right: 0;
}

.footer-col ul li {
  margin-bottom: var(--space-sm);
}

.footer-col ul li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.footer-col ul li a:hover {
  color: var(--primary);
  padding-left: 5px;
}

[dir="rtl"] .footer-col ul li a:hover {
  padding-left: 0;
  padding-right: 5px;
}

.footer-contact li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-contact li i {
  color: var(--primary);
  width: 18px;
}

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

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: all var(--transition-base);
  border: 1px solid var(--border-color);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-color);
}

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

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  background: var(--bg-tertiary);
}

.modal-close:hover {
  background: var(--danger);
  color: white;
}

.modal-body {
  padding: var(--space-xl);
}

.modal-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

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

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

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

/* ---- Page Header ---- */
.page-header {
  padding: calc(var(--navbar-height) + var(--space-3xl)) 0 var(--space-3xl);
  background: var(--gradient-hero);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(26, 143, 227, 0.15), transparent 70%);
}

.page-header h1 {
  color: white;
  margin-bottom: var(--space-md);
  position: relative;
}

.page-header p {
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* ---- Contact Form Section ---- */
.contact-section {
  padding: var(--space-4xl) 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-3xl);
  align-items: start;
}

.contact-info-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  transition: all var(--transition-base);
}

.contact-info-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

[dir="rtl"] .contact-info-card:hover {
  transform: translateX(-5px);
}

.contact-info-card .icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: var(--radius-md);
  background: rgba(var(--primary-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.3rem;
}

.contact-form-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

/* ---- Course Filter ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.filter-bar .search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.filter-bar .search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

[dir="rtl"] .filter-bar .search-box i {
  left: auto;
  right: 14px;
}

.filter-bar .search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
}

[dir="rtl"] .filter-bar .search-box input {
  padding: 12px 42px 12px 16px;
}

.filter-bar .search-box input:focus {
  border-color: var(--primary);
}

.filter-chips {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-chip {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ---- Alerts / Toast ---- */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + var(--space-md));
  right: var(--space-lg);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

[dir="rtl"] .toast-container {
  right: auto;
  left: var(--space-lg);
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 300px;
  animation: slideInRight 0.3s ease forwards;
  font-size: 0.9rem;
}

[dir="rtl"] .toast {
  animation: slideInLeft 0.3s ease forwards;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

[dir="rtl"] .toast.success { border-left: none; border-right: 4px solid var(--success); }
[dir="rtl"] .toast.error { border-left: none; border-right: 4px solid var(--danger); }
[dir="rtl"] .toast.warning { border-left: none; border-right: 4px solid var(--warning); }
[dir="rtl"] .toast.info { border-left: none; border-right: 4px solid var(--info); }

.toast i { font-size: 1.2rem; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

/* ---- Loading Spinner ---- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.page-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  gap: var(--space-md);
  color: var(--text-muted);
}

.loader-brand {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: 3px;
  color: var(--accent); /* SIGMA Color */
  position: relative;
  display: inline-block;
  text-transform: uppercase;
}

.loader-brand span {
  color: var(--primary); /* HUB Color */
}

.loader-brand::after {
  content: "SIGMA HUB";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  color: var(--primary);
  overflow: hidden;
  animation: loadText 2s infinite linear;
  white-space: nowrap;
}

@keyframes loadText {
  0% { width: 0; }
  50% { width: 100%; }
  100% { width: 0; }
}

.loader-dots {
  display: flex;
  gap: 5px;
}

.loader-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: dotPulse 1s infinite ease-in-out;
}

.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 100% { transform: scale(0.3); opacity: 0.3; }
  50% { transform: scale(1); opacity: 1; }
}

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-primary { background: rgba(var(--primary-rgb), 0.1); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.filter-chips {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding: 4px 2px var(--space-sm);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-xl);
}

.filter-chips::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.filter-chip {
  flex-shrink: 0;
  padding: 10px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.filter-chip.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  color: var(--border-color);
}

/* ---- Animations ---- */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

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

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

@keyframes rotateBg {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

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

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

  .hero .container {
    flex-direction: column;
    text-align: center;
  }

  .hero-content { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-image { display: none; }

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

@media (max-width: 768px) {
  /* Mobile Navbar */
  .navbar .container {
    padding: 0 var(--space-md);
  }

  .navbar-brand {
    font-size: 1.1rem;
    gap: var(--space-xs);
  }

  .navbar-brand img {
    height: 34px;
    width: 34px;
  }

  .nav-links {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: var(--space-xl);
    gap: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    font-size: 1.05rem;
    padding: var(--space-sm) 0;
  }

  .mobile-toggle { display: flex; }

  .nav-actions {
    gap: var(--space-sm);
  }

  .toggle-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  /* Grid fixes */
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }

  [dir="rtl"] .footer-grid { text-align: center; }

  .footer-col h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  [dir="rtl"] .footer-col h4::after {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

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

  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-brand p {
    text-align: center;
  }

  .footer-contact li {
    justify-content: center;
  }

  /* Filter bar */
  .filter-bar { flex-direction: column; }

  .filter-bar .search-box {
    min-width: 100%;
  }

  .filter-chips {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-xs);
    flex-wrap: nowrap;
  }

  .filter-chip {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Contact form */
  .form-row { grid-template-columns: 1fr; }

  .contact-info-card {
    padding: var(--space-lg);
  }

  /* Hero */
  .hero {
    padding-top: var(--navbar-height);
    padding-bottom: var(--space-2xl);
  }

  .hero-inner {
    min-height: auto !important;
    gap: var(--space-xl);
    padding-top: var(--space-xl);
    padding-bottom: var(--space-md);
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  /* Page header */
  .page-header {
    padding: calc(var(--navbar-height) + var(--space-2xl)) 0 var(--space-2xl);
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  /* Section spacing */
  .section {
    padding: var(--space-3xl) 0;
  }

  .section-header {
    margin-bottom: var(--space-2xl);
  }

  /* Cards */
  .card-img {
    height: 180px;
  }

  /* Modal */
  .modal {
    max-width: 95%;
    margin: var(--space-md);
  }

  .modal-body {
    padding: var(--space-lg);
  }

  /* Toast */
  .toast-container {
    right: var(--space-md);
    left: var(--space-md);
  }

  [dir="rtl"] .toast-container {
    left: var(--space-md);
    right: var(--space-md);
  }

  .toast {
    min-width: auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  html { font-size: 14px; }

  .container {
    padding: 0 var(--space-md);
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }

  .category-card {
    min-height: 120px;
    padding: var(--space-lg);
  }

  /* CTA section */
  .cta-section {
    padding: var(--space-2xl) 0;
  }

  .cta-section h2 {
    font-size: 1.4rem;
  }

  /* Feature cards */
  .feature-card {
    padding: var(--space-lg);
  }

  .feature-icon {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }
}

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

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

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

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

/* ---- Selection ---- */
::selection {
  background: rgba(var(--primary-rgb), 0.2);
  color: var(--text-primary);
}
