/* ============================================
   WATHAEQ.ONLINE — Design System 2026
   RTL First | Arabic | Google Standards
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;900&family=Tajawal:wght@300;400;500;700;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  /* Colors */
  --primary:       #1B4F8A;
  --primary-dark:  #0F3060;
  --primary-light: #2E6FBF;
  --accent:        #E84855;
  --accent-dark:   #C0313D;
  --success:       #27AE60;
  --warning:       #F59E0B;
  --bg:            #F4F6FA;
  --bg-card:       #FFFFFF;
  --bg-dark:       #0F1623;
  --text:          #1A1A2E;
  --text-muted:    #6B7A99;
  --text-light:    #9BA8C0;
  --border:        #E2E8F0;
  --border-dark:   #CBD5E1;

  /* Typography */
  --font-main:    'Cairo', 'Tajawal', sans-serif;
  --font-display: 'Cairo', sans-serif;

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

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

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(27,79,138,0.08), 0 1px 2px rgba(27,79,138,0.04);
  --shadow-md:  0 4px 16px rgba(27,79,138,0.12), 0 2px 8px rgba(27,79,138,0.06);
  --shadow-lg:  0 12px 40px rgba(27,79,138,0.16), 0 4px 16px rgba(27,79,138,0.08);
  --shadow-xl:  0 24px 64px rgba(27,79,138,0.20);

  /* Transitions */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Container */
  --container: 1200px;
  --container-sm: 800px;
}

/* ---- Dark Mode ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0F1623;
    --bg-card:  #1A2438;
    --text:     #E8EDF5;
    --text-muted: #8A9BBF;
    --border:   #2A3A55;
    --border-dark: #3A4F70;
  }
}
[data-theme="dark"] {
  --bg:       #0F1623;
  --bg-card:  #1A2438;
  --text:     #E8EDF5;
  --text-muted: #8A9BBF;
  --border:   #2A3A55;
  --border-dark: #3A4F70;
}
[data-theme="light"] {
  --bg:       #F4F6FA;
  --bg-card:  #FFFFFF;
  --text:     #1A1A2E;
  --text-muted: #6B7A99;
  --border:   #E2E8F0;
  --border-dark: #CBD5E1;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  direction: rtl;
}

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

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  height: 70px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.logo-text {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.logo-text span { color: var(--accent); }

.main-nav { display: flex; align-items: center; gap: var(--space-xs); }
.nav-link {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: rgba(27,79,138,0.08);
}

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

.btn-theme {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 16px;
  transition: all var(--transition);
  border: 1px solid var(--border);
}
.btn-theme:hover { color: var(--primary); border-color: var(--primary); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-lg);
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(27,79,138,0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(27,79,138,0.4);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-lg);
  background: var(--accent);
  color: white;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(232,72,85,0.3);
}
.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,72,85,0.4);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-lg);
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  cursor: pointer;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  padding: var(--space-3xl) 0 var(--space-2xl);
  overflow: hidden;
  background: linear-gradient(160deg, var(--bg) 0%, rgba(27,79,138,0.04) 100%);
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(27,79,138,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(232,72,85,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(27,79,138,0.08);
  border: 1px solid rgba(27,79,138,0.15);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: 6px var(--space-md);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  animation: fadeInDown 0.6s ease both;
}
.hero-badge::before {
  content: '◆';
  font-size: 8px;
  color: var(--accent);
}

.hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.6s ease 0.1s both;
}
.hero-title .highlight {
  color: var(--primary);
  position: relative;
}
.hero-title .accent { color: var(--accent); }

.hero-desc {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.8;
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* ---- Search Box ---- */
.search-box {
  position: relative;
  max-width: 640px;
  margin: 0 auto var(--space-xl);
  animation: fadeInUp 0.6s ease 0.3s both;
}
.search-input {
  width: 100%;
  padding: 18px 64px 18px 140px;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-xl);
  font-size: 16px;
  font-family: var(--font-main);
  background: var(--bg-card);
  color: var(--text);
  direction: rtl;
  outline: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(27,79,138,0.1), var(--shadow-md);
}
.search-input::placeholder { color: var(--text-light); }
.search-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-main);
  transition: all var(--transition);
}
.search-btn:hover { background: var(--primary-dark); }
.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  animation: fadeInUp 0.6s ease 0.4s both;
}
.stat-item { text-align: center; }
.stat-number {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-dark);
}

/* ============================================
   CATEGORIES
   ============================================ */
.section { padding: var(--space-2xl) 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}
.section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}
.section-title span { color: var(--primary); }
.section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: gap var(--transition);
}
.section-link:hover { gap: var(--space-sm); }

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 3px;
  background: var(--cat-color, var(--primary));
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: right;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--cat-color, var(--primary));
}
.category-card:hover::before { transform: scaleX(1); }

.category-icon {
  width: 60px; height: 60px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto var(--space-md);
  background: var(--cat-bg, rgba(27,79,138,0.08));
}
.category-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-xs);
}
.category-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   DOCUMENTS GRID
   ============================================ */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}
.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-dark);
}
.doc-card-preview {
  height: 140px;
  background: linear-gradient(135deg, rgba(27,79,138,0.06), rgba(27,79,138,0.02));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.doc-preview-icon {
  font-size: 48px;
  opacity: 0.3;
}
.doc-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px var(--space-sm);
  border-radius: var(--radius-full);
}
.doc-badge.free { background: var(--success); }
.doc-card-body { padding: var(--space-lg); flex: 1; display: flex; flex-direction: column; }
.doc-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}
.doc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
  flex: 1;
}
.doc-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.doc-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.doc-actions {
  display: flex;
  gap: var(--space-sm);
}
.btn-download {
  flex: 1;
  padding: 10px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  text-align: center;
  transition: all var(--transition);
}
.btn-download:hover { background: var(--primary-dark); }
.btn-fill {
  padding: 10px var(--space-md);
  background: rgba(232,72,85,0.08);
  color: var(--accent);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  text-align: center;
  transition: all var(--transition);
  border: 1px solid rgba(232,72,85,0.2);
}
.btn-fill:hover { background: var(--accent); color: white; }

/* ============================================
   AI SECTION
   ============================================ */
.ai-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  color: white;
  position: relative;
  overflow: hidden;
  margin: var(--space-2xl) 0;
}
.ai-section::before {
  content: '◈';
  position: absolute;
  top: -20px; left: 40px;
  font-size: 160px;
  color: rgba(255,255,255,0.04);
  font-weight: 900;
  pointer-events: none;
}
.ai-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  position: relative;
  z-index: 1;
}
.ai-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: var(--space-md);
}
.ai-title span { color: #FFD93D; }
.ai-desc {
  font-size: 16px;
  opacity: 0.85;
  line-height: 1.8;
  margin-bottom: var(--space-xl);
}
.btn-white {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px var(--space-xl);
  background: white;
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 800;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }

.ai-chat-demo {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  backdrop-filter: blur(10px);
}
.chat-message {
  margin-bottom: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}
.chat-message.user { flex-direction: row-reverse; }
.chat-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.chat-avatar.user-av { background: rgba(255,255,255,0.2); }
.chat-avatar.ai-av { background: #FFD93D; color: var(--primary-dark); font-weight: 700; }
.chat-bubble {
  max-width: 85%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.6;
}
.chat-bubble.user-bubble { background: rgba(255,255,255,0.15); color: white; }
.chat-bubble.ai-bubble { background: rgba(255,255,255,0.95); color: var(--text); }

.chat-input-demo {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-md);
}
.chat-input-demo input {
  flex: 1;
  padding: 10px var(--space-md);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  color: white;
  font-size: 13px;
  outline: none;
  direction: rtl;
}
.chat-input-demo input::placeholder { color: rgba(255,255,255,0.5); }
.chat-send {
  width: 36px; height: 36px;
  background: #FFD93D;
  color: var(--primary-dark);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
}
.chat-send:hover { transform: scale(1.1); }

/* ============================================
   HOW IT WORKS
   ============================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  position: relative;
}
.steps-grid::before {
  content: '';
  position: absolute;
  top: 32px;
  right: 16.5%;
  width: 67%;
  height: 2px;
  background: linear-gradient(to left, var(--border), var(--primary), var(--border));
}
.step-card {
  text-align: center;
  position: relative;
}
.step-number {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  font-size: 24px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(27,79,138,0.4);
}
.step-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text);
}
.step-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ============================================
   BLOG / POSTS
   ============================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-card-img {
  height: 180px;
  background: linear-gradient(135deg, rgba(27,79,138,0.08), rgba(232,72,85,0.04));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
}
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: var(--space-lg); }
.blog-tag {
  display: inline-block;
  background: rgba(27,79,138,0.08);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
}
.blog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
  transition: color var(--transition);
}
.blog-card:hover .blog-title { color: var(--primary); }
.blog-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   SINGLE DOCUMENT PAGE
   ============================================ */
.doc-page { padding: var(--space-2xl) 0; }
.doc-page-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-xl);
  align-items: start;
}
.doc-main { }
.doc-sidebar {
  position: sticky;
  top: 90px;
}

.doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}
.doc-breadcrumb a { color: var(--primary); transition: opacity var(--transition); }
.doc-breadcrumb a:hover { opacity: 0.7; }
.doc-breadcrumb span { color: var(--text-light); }

.doc-header { margin-bottom: var(--space-xl); }
.doc-header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}
.meta-tag.category { background: rgba(27,79,138,0.08); color: var(--primary); }
.meta-tag.country { background: rgba(39,174,96,0.08); color: var(--success); }
.meta-tag.free { background: rgba(39,174,96,0.1); color: var(--success); }

.doc-page-title {
  font-size: 30px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: var(--space-md);
}
.doc-description {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* Preview */
.doc-preview-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.preview-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.preview-actions { display: flex; gap: var(--space-sm); }
.preview-doc {
  padding: var(--space-xl);
  min-height: 300px;
  direction: rtl;
  font-family: 'Cairo', serif;
}
.preview-doc.blurred { filter: blur(4px); pointer-events: none; user-select: none; }

/* Fill Form */
.fill-form-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}
.fill-form-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.fill-form-title::before {
  content: '✦';
  color: var(--accent);
}
.form-group { margin-bottom: var(--space-lg); }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
}
.form-label .required { color: var(--accent); margin-right: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px var(--space-md);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  outline: none;
  transition: all var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,79,138,0.1);
  background: var(--bg-card);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

.btn-generate {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(232,72,85,0.35);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(232,72,85,0.45);
}
.btn-generate:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Sidebar Download Box */
.download-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.download-box-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}
.download-format {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}
.download-format:last-child { border-bottom: none; }
.format-info { display: flex; align-items: center; gap: var(--space-md); }
.format-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: white;
}
.format-icon.pdf { background: #E84855; }
.format-icon.docx { background: #2B579A; }
.format-icon.txt { background: #6B7A99; }
.format-name { font-size: 14px; font-weight: 600; color: var(--text); }
.format-size { font-size: 12px; color: var(--text-muted); }
.btn-format-dl {
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-main);
  transition: all var(--transition);
}
.btn-format-dl:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Result Box */
.result-box {
  background: linear-gradient(135deg, rgba(39,174,96,0.05), rgba(39,174,96,0.02));
  border: 1px solid rgba(39,174,96,0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  display: none;
}
.result-box.show { display: block; animation: fadeInUp 0.4s ease; }
.result-icon { font-size: 48px; margin-bottom: var(--space-md); }
.result-title { font-size: 18px; font-weight: 800; color: var(--success); margin-bottom: var(--space-sm); }
.result-desc { font-size: 14px; color: var(--text-muted); margin-bottom: var(--space-lg); }
.result-actions { display: flex; gap: var(--space-sm); justify-content: center; flex-wrap: wrap; }

/* Loading */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,22,35,0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.loading-overlay.show { display: flex; }
.loading-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  max-width: 300px;
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-lg);
}
.loading-text { font-size: 16px; font-weight: 600; color: var(--text); }
.loading-sub { font-size: 13px; color: var(--text-muted); margin-top: var(--space-xs); }

/* ============================================
   LIBRARY / ARCHIVE PAGE
   ============================================ */
.library-page { padding: var(--space-2xl) 0; }
.library-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.library-title { font-size: 36px; font-weight: 900; color: var(--text); margin-bottom: var(--space-md); }
.library-desc { font-size: 16px; color: var(--text-muted); }

.filters-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  align-items: center;
}
.filter-label { font-size: 13px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.filter-select {
  padding: 8px var(--space-md);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--primary); }

.filter-chips { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border-dark);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-chip:hover, .filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================
   BLOG SINGLE
   ============================================ */
.blog-single { padding: var(--space-2xl) 0; }
.blog-single-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-xl);
  align-items: start;
}
.article-header { margin-bottom: var(--space-xl); }
.article-title {
  font-size: 34px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: var(--space-lg);
}
.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.article-content {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text);
}
.article-content h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: var(--space-xl) 0 var(--space-md);
}
.article-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: var(--space-lg) 0 var(--space-md);
}
.article-content p { margin-bottom: var(--space-md); }
.article-content ul { margin: var(--space-md) 0; padding-right: var(--space-xl); }
.article-content li { margin-bottom: var(--space-sm); }
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content blockquote {
  border-right: 4px solid var(--primary);
  padding: var(--space-md) var(--space-lg);
  background: rgba(27,79,138,0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.widget-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.75);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-3xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}
.footer-brand { }
.footer-logo {
  font-size: 24px;
  font-weight: 900;
  color: white;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.footer-logo span { color: #FFD93D; }
.footer-desc {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: var(--space-lg);
}
.footer-social { display: flex; gap: var(--space-sm); }
.social-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  transition: all var(--transition);
}
.social-btn:hover { background: var(--primary); color: white; transform: translateY(-2px); }

.footer-col-title {
  font-size: 14px;
  font-weight: 700;
  color: white;
  margin-bottom: var(--space-lg);
}
.footer-links { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-link {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}
.footer-link:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.footer-bottom-links { display: flex; gap: var(--space-lg); }

/* ============================================
   ADZONE
   ============================================ */
.adzone {
  background: var(--bg-card);
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius-md);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 12px;
  margin: var(--space-lg) 0;
  overflow: hidden;
}

/* ============================================
   SCHEMA / SEO HIDDEN
   ============================================ */
.schema-data { display: none; }

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.animate-fade-in { animation: fadeInUp 0.5s ease both; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* ============================================
   RESPONSIVE — MOBILE FIRST
   ============================================ */
@media (max-width: 1024px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .docs-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .doc-page-grid { grid-template-columns: 1fr; }
  .doc-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .ai-content { grid-template-columns: 1fr; }
  .ai-chat-demo { display: none; }
  .blog-single-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .hero { padding: var(--space-2xl) 0 var(--space-xl); }
  .hero-title { font-size: 28px; }
  .hero-stats { gap: var(--space-lg); }
  .stat-number { font-size: 22px; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .docs-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .steps-grid::before { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: var(--space-md); text-align: center; }
  .form-grid { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; align-items: flex-start; }
  .doc-page-grid { gap: var(--space-lg); }
  .article-title { font-size: 24px; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-md); }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
  .hero-stats { flex-direction: column; gap: var(--space-md); }
  .stat-divider { display: none; }
  .hero-desc { font-size: 15px; }
  .search-input { padding: 14px 50px 14px 120px; font-size: 14px; }
}
