/* ==========================================================================
   قاف (QAAF) - Design System & Global Styles
   Platform for Learning Videos & Forensic Content Protection
   ========================================================================== */

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

:root {
  /* Color Palette - Security & Education */
  --bg-darkest: #040812;
  --bg-dark: #070e1c;
  --bg-card: #0d172a;
  --bg-card-hover: #13223e;
  --bg-surface: rgba(15, 25, 45, 0.75);
  
  --primary: #06b6d4;
  --primary-light: #38bdf8;
  --primary-glow: rgba(6, 182, 212, 0.35);
  
  --accent-shield: #10b981;
  --accent-shield-light: #34d399;
  --accent-shield-glow: rgba(16, 185, 129, 0.35);
  
  --accent-purple: #6366f1;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-primary: #38bdf8;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(6, 182, 212, 0.25);
  --border-shield: rgba(16, 185, 129, 0.25);
  
  /* Gradients */
  --grad-cyan-emerald: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 50%, #10b981 100%);
  --grad-emerald-cyan: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --grad-card: linear-gradient(180deg, rgba(20, 32, 58, 0.6) 0%, rgba(10, 18, 33, 0.8) 100%);
  --grad-hero-glow: radial-gradient(circle at 50% 20%, rgba(6, 182, 212, 0.15) 0%, rgba(16, 185, 129, 0.05) 50%, transparent 80%);
  --grad-danger: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);

  /* Typography */
  --font-arabic-heading: 'Alexandria', 'Cairo', system-ui, sans-serif;
  --font-arabic-body: 'Cairo', 'Alexandria', system-ui, sans-serif;
  --font-latin: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.3);
  --shadow-glow-shield: 0 0 25px rgba(16, 185, 129, 0.3);

  /* Transitions */
  --tr-fast: 0.15s ease;
  --tr-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --tr-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 9999px;
  --container-max: 1280px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  direction: rtl;
  text-align: right;
  background-color: var(--bg-darkest);
  color: var(--text-main);
  font-family: var(--font-arabic-body);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-darkest);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 35%, rgba(16, 185, 129, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 5px;
  border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-arabic-heading);
  color: var(--text-main);
  line-height: 1.35;
  font-weight: 800;
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

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

ul {
  list-style: none;
}

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

button, input, select {
  font-family: inherit;
  font-size: inherit;
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.text-gradient {
  background: var(--grad-cyan-emerald);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-shield {
  background: var(--grad-emerald-cyan);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.latin-text {
  font-family: var(--font-latin);
  direction: ltr;
  display: inline-block;
}

.mono-text {
  font-family: var(--font-mono);
  direction: ltr;
  display: inline-block;
}

/* Glassmorphism Card Base */
.glass-card {
  background: var(--grad-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--tr-normal), border-color var(--tr-normal), box-shadow var(--tr-normal);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg), var(--shadow-glow-cyan);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  width: fit-content;
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--primary-light);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-shield-light);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulseAnim 2s infinite ease-in-out;
}

@keyframes pulseAnim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all var(--tr-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--grad-cyan-emerald);
  color: #030712;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.5);
  filter: brightness(1.05);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}

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

.btn-shield {
  background: var(--grad-emerald-cyan);
  color: #030712;
  box-shadow: 0 4px 18px var(--accent-shield-glow);
}

.btn-shield:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
}

.btn-glow-effect::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  transform: scale(0);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.btn-glow-effect:hover::before {
  transform: scale(1);
  opacity: 1;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: background-color var(--tr-normal), backdrop-filter var(--tr-normal), padding var(--tr-normal), border-color var(--tr-normal);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(4, 8, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.3));
}

.brand-name-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-main);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

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

.brand-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-shield-light);
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 0%;
  height: 2px;
  background: var(--grad-cyan-emerald);
  transition: width var(--tr-normal);
  border-radius: 2px;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 3.5rem auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary-light);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 900;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.section-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Grid helper */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* Padding utilities */
.py-section {
  padding: 6.5rem 0;
  position: relative;
}

.py-section-lg {
  padding: 8rem 0;
  position: relative;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #02050d;
  border-top: 1px solid var(--border-subtle);
  padding: 5rem 0 2rem 0;
  position: relative;
  overflow: hidden;
}

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

.footer-brand p {
  margin: 1.25rem 0;
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 380px;
}

.footer-col-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  position: relative;
}

.footer-links li {
  margin-bottom: 0.85rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: all var(--tr-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links a:hover {
  color: var(--primary-light);
  transform: translateX(-4px);
}

.security-cert-badges {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cert-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.cert-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-shield-light);
  flex-shrink: 0;
}

.cert-text h5 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.cert-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a:hover {
  color: var(--text-main);
}
