:root {
  --navy: #003B71;
  --gold: #C9A84C;
  --gold-light: #E8C96A;
  --cream: #FAFAF7;
  --white: #FFFFFF;
  --gray-100: #F4F4F0;
  --gray-200: #E8E8E2;
  --gray-400: #9C9C8E;
  --gray-700: #3D3D35;
  --shadow-sm: 0 2px 8px rgba(0,59,113,0.08);
  --shadow-md: 0 6px 24px rgba(0,59,113,0.12);
  --shadow-lg: 0 16px 48px rgba(0,59,113,0.16);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Heebo', sans-serif;
  background: var(--cream);
  color: var(--gray-700);
  direction: rtl;
  overflow-x: hidden;
}

/* ===== NAVBAR ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 40px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand { display: flex; align-items: center; gap: 16px; }

.nav-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
}
.nav-title span { color: var(--gold); }

.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-admin {
  background: var(--navy);
  color: white !important;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem !important;
}
.nav-admin:hover { background: var(--gold) !important; color: var(--navy) !important; }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  background: linear-gradient(160deg, #001f3f 0%, #003B71 55%, #005a9e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 40px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 800px;
}

.hero-logo {
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.1s;
}

.hero-badge {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.3px;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.2s;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 700;
  color: white;
  line-height: 1.1;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.35s;
}
.hero-title span { color: var(--gold-light); }

/* ===== SEARCH ===== */
.search-container {
  width: 100%;
  max-width: 720px;
  position: relative;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.5s;
  margin-bottom: 24px;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(201,168,76,0.5);
  border-radius: 18px;
  height: 64px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.28);
  overflow: hidden;
  transition: var(--transition);
}
.search-wrapper:focus-within {
  border-color: var(--gold);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 0 3px rgba(201,168,76,0.25);
}

.search-filter-select {
  background: transparent;
  border: none;
  border-left: 1.5px solid rgba(0,59,113,0.12);
  height: 100%;
  padding: 0 16px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  outline: none;
  cursor: pointer;
  min-width: 110px;
  direction: rtl;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23003B71'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  padding-left: 28px;
}

.search-bar {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0 16px;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.2px;
  color: var(--navy);
  outline: none;
  direction: rtl;
  height: 100%;
}
.search-bar::placeholder { color: rgba(0,59,113,0.35); }

.search-icon { padding: 0 12px; color: rgba(0,59,113,0.3); font-size: 1rem; flex-shrink: 0; }

.search-btn {
  height: calc(100% - 12px);
  margin: 6px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 12px;
  padding: 0 28px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.search-btn:hover { background: var(--navy); color: white; }

/* ===== TRENDING ===== */
.trending {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.65s;
}
.trending-label { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.trending-tag {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75);
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Heebo', sans-serif;
}
.trending-tag:hover {
  background: rgba(201,168,76,0.2);
  border-color: rgba(201,168,76,0.4);
  color: var(--gold-light);
}

/* ===== HERO STATS ===== */
.hero-stats {
  display: flex;
  gap: 48px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.75s;
  margin-top: 8px;
}
.stat { text-align: center; }
.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.5); font-weight: 500; }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.1); align-self: center; }

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.3);
  font-size: 0.75rem;
}
.scroll-arrow {
  width: 20px; height: 20px;
  border-right: 2px solid rgba(255,255,255,0.3);
  border-bottom: 2px solid rgba(255,255,255,0.3);
  transform: rotate(45deg);
  animation: bounce 2s ease-in-out infinite;
}

/* ===== SECTIONS ===== */
.section-inner { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.btn-see-all {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  border: 1.5px solid var(--gray-200);
  padding: 8px 18px;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-see-all:hover { background: var(--navy); color: white; border-color: var(--navy); }

.btn-clear-search {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--gray-700);
  transition: var(--transition);
}
.btn-clear-search:hover { border-color: #e74c3c; color: #e74c3c; }

/* ===== CATEGORIES ===== */
.categories-section { padding: 80px 0; }
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.category-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid var(--gray-200);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 0;
  background: var(--gold);
  transition: height 0.3s ease;
}
.category-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0,59,113,0.18);
  border-color: transparent;
}
.category-card:hover::before { height: 100%; }
.category-card:hover::after { opacity: 1; }

.category-icon { font-size: 2rem; margin-bottom: 14px; }
.category-name { font-weight: 700; color: var(--navy); font-size: 1rem; margin-bottom: 6px; }
.category-count { font-size: 0.8rem; color: var(--gray-400); }

/* ===== FILES LIST ===== */
.files-section { padding: 0 0 80px; }
.files-list { display: flex; flex-direction: column; gap: 12px; }

.file-item {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.file-item:hover { border-color: rgba(201,168,76,0.4); box-shadow: var(--shadow-sm); transform: translateX(-2px); }

.file-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.file-icon.pdf { background: #fff0f0; }
.file-icon.docx { background: #f0f4ff; }

.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 600; color: var(--navy); font-size: 0.95rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 0.78rem; color: var(--gray-400); }
.file-stars { color: #F59E0B; font-size: 0.72rem; margin-top: 2px; display: block; }

.file-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-grade { background: #f0fff4; color: #2d9e5a; }
.badge-type { background: var(--gray-100); color: var(--gray-700); }

.file-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.btn-icon {
  width: 34px; height: 34px;
  border: 1.5px solid var(--gray-200);
  background: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
  color: var(--gray-400);
}
.btn-icon:hover { background: var(--gray-100); color: var(--navy); }

.btn-download {
  background: var(--navy);
  color: white !important;
  border-radius: 8px;
  padding: 7px 14px;
  border: none;
  font-family: 'Heebo', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-download:hover { background: var(--gold); color: var(--navy) !important; }

/* ===== AI SECTION ===== */
.ai-section { padding: 0 0 80px; }

.ai-card {
  background: var(--navy);
  border-radius: 24px;
  padding: 52px 56px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}

.ai-pulse-wrapper { position: relative; display: inline-block; }
.ai-pulse-wrapper::before, .ai-pulse-wrapper::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 100px;
  border: 1.5px solid rgba(201,168,76,0.5);
  animation: pulse-ring 2.5s ease-out infinite;
}
.ai-pulse-wrapper::after { animation-delay: 1.25s; }

.sparkle { display: inline-block; animation: sparkle 1.8s ease-in-out infinite; }

.ai-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: white;
  line-height: 1.15;
  margin: 20px 0 16px;
}
.ai-title span { color: var(--gold-light); }

.ai-desc { color: rgba(255,255,255,0.65); font-size: 0.95rem; line-height: 1.7; margin-bottom: 16px; }
.ai-disclaimer { color: rgba(255,255,255,0.35); font-size: 0.75rem; }

.ai-right {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  max-height: 320px;
  overflow-y: auto;
}

.msg {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 90%;
}
.msg-ai {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  align-self: flex-end;
  border-bottom-left-radius: 4px;
}
.msg-user {
  background: var(--gold);
  color: var(--navy);
  align-self: flex-start;
  border-bottom-right-radius: 4px;
  font-weight: 600;
}

.chat-input-row { display: flex; gap: 8px; }
.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px 14px;
  color: white;
  font-family: 'Heebo', sans-serif;
  font-size: 0.85rem;
  outline: none;
  direction: rtl;
  transition: var(--transition);
}
.chat-input:focus { border-color: rgba(201,168,76,0.5); }
.chat-input::placeholder { color: rgba(255,255,255,0.3); }

.chat-send {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.chat-send:hover { background: var(--gold-light); }

/* ===== CONTRIBUTORS ===== */
.contributors-section { background: var(--gray-100); padding: 60px 0; border-top: 1px solid var(--gray-200); }
.contributors-inner { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.contributors-grid { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }

.contributor-card {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 180px;
  transition: var(--transition);
  cursor: default;
}
.contributor-card:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.contributor-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--navy));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: white; flex-shrink: 0;
}
.contributor-name { font-size: 0.88rem; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.contributor-count { font-size: 0.75rem; color: var(--gray-400); }
.contributor-badge { margin-right: auto; font-size: 1.1rem; }

/* ===== UPLOAD BANNER ===== */
.upload-banner {
  background: linear-gradient(135deg, #FFF8E7, #FFFDF5);
  border: 1.5px solid rgba(201,168,76,0.25);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px auto;
}
.upload-banner-text { display: flex; align-items: center; gap: 16px; }
.upload-icon { font-size: 2rem; }
.upload-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.upload-sub { font-size: 0.82rem; color: var(--gray-400); }

.btn-upload {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-upload:hover { background: var(--navy); color: white; }

/* ===== SEARCH RESULTS ===== */
.search-results-section { padding: 80px 0 40px; }

/* ===== PAGE HEADER ===== */
.page-header {
  background: linear-gradient(160deg, #001f3f 0%, #003B71 100%);
  padding: 120px 0 60px;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin: 8px 0 12px;
}
.page-subtitle { color: rgba(255,255,255,0.5); font-size: 0.95rem; }
.back-link {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.88rem;
  display: inline-block;
  margin-bottom: 16px;
  transition: var(--transition);
}
.back-link:hover { color: var(--gold-light); }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; align-items: center; }

.filter-select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.85rem;
  color: white;
  outline: none;
  cursor: pointer;
  direction: rtl;
}
.filter-select option { background: var(--navy); color: white; }

.filter-input {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.85rem;
  color: white;
  outline: none;
  flex: 1;
  min-width: 180px;
  direction: rtl;
  transition: var(--transition);
}
.filter-input:focus { border-color: rgba(201,168,76,0.5); }
.filter-input::placeholder { color: rgba(255,255,255,0.35); }

.btn-upload-small {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-upload-small:hover { background: var(--gold-light); }

/* ===== COURSES GRID ===== */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.course-card {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  display: block;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.course-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 0;
  background: var(--gold);
  transition: height 0.3s ease;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.course-card:hover::before { height: 100%; }

.course-card-category { font-size: 0.72rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.course-card-name { font-weight: 700; color: var(--navy); font-size: 1rem; margin-bottom: 12px; line-height: 1.4; }
.course-card-meta { font-size: 0.78rem; color: var(--gray-400); }
.course-card-count {
  margin-top: 16px;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  display: inline-block;
}

/* ===== FILES TABLE ===== */
.files-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1.5px solid var(--gray-200); }

.files-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}
.files-table th {
  background: var(--gray-100);
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-700);
  text-align: right;
  white-space: nowrap;
  border-bottom: 1.5px solid var(--gray-200);
}
.files-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
.files-table tr:last-child td { border-bottom: none; }
.files-table tr:hover td { background: var(--gray-100); }

.td-name { font-weight: 600; color: var(--navy); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ===== PREVIEW PANEL ===== */
.preview-panel {
  position: fixed;
  top: 0; left: 0;
  width: 50%;
  height: 100%;
  background: white;
  box-shadow: 4px 0 32px rgba(0,0,0,0.2);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}
.preview-panel.open { transform: translateX(0); }

.preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.preview-backdrop.open { opacity: 1; pointer-events: all; }

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  color: var(--navy);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.preview-close {
  background: var(--gray-100);
  border: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--gray-700);
  transition: var(--transition);
}
.preview-close:hover { background: var(--gray-200); }
.preview-btn-dl {
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.preview-btn-dl:hover { background: var(--gold); color: var(--navy); }
.preview-iframe { flex: 1; border: none; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-family: 'Playfair Display', serif; color: var(--navy); font-size: 1.2rem; }
.modal-close {
  background: var(--gray-100);
  border: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--gray-700);
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 24px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-control {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.88rem;
  color: var(--gray-700);
  outline: none;
  transition: var(--transition);
  direction: rtl;
}
.form-control:focus { border-color: var(--navy); }

.file-drop-zone {
  border: 2px dashed var(--gray-200);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  color: var(--gray-400);
}
.file-drop-zone:hover { border-color: var(--gold); color: var(--navy); background: #FFFDF5; }
.file-drop-zone.has-file { border-color: var(--gold); background: #FFFDF5; color: var(--navy); font-weight: 600; }

.btn-upload-submit {
  width: 100%;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
}
.btn-upload-submit:hover { background: var(--gold); color: var(--navy); }
.btn-upload-submit:disabled { background: var(--gray-200); color: var(--gray-400); cursor: not-allowed; }

.upload-note { font-size: 0.75rem; color: var(--gray-400); text-align: center; margin-top: 10px; }

/* ===== ADMIN ===== */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.admin-login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.admin-stat-card {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.admin-stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.admin-stat-label { font-size: 0.8rem; color: var(--gray-400); }

.pending-card {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.pending-info { flex: 1; }
.pending-name { font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.pending-meta { font-size: 0.78rem; color: var(--gray-400); }
.pending-actions { display: flex; gap: 8px; }
.btn-approve {
  background: #e8f5e9;
  color: #2d9e5a;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-approve:hover { background: #2d9e5a; color: white; }
.btn-reject {
  background: #fff0f0;
  color: #e74c3c;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-reject:hover { background: #e74c3c; color: white; }
.btn-delete {
  background: #fff0f0;
  color: #e74c3c;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-delete:hover { background: #e74c3c; color: white; }

/* ===== FOOTER ===== */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.4);
  text-align: center;
  padding: 32px 40px;
  font-size: 0.82rem;
}
footer span { color: var(--gold-light); }

/* ===== MISC ===== */
.loading-spinner { text-align: center; color: var(--gray-400); padding: 40px; font-size: 0.9rem; }
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--navy);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 999;
  transition: transform 0.3s ease;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #2d9e5a; }
.toast.error { background: #e74c3c; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translate(0,0); }
  50% { transform: rotate(45deg) translate(4px,4px); }
}
@keyframes pulse-ring {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.25) rotate(12deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .nav-links { gap: 16px; }
  .hero { padding: 100px 20px 60px; }
  .hero-stats { gap: 24px; }
  .section-inner { padding: 0 20px; }
  .ai-card { grid-template-columns: 1fr; padding: 32px 24px; }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .preview-panel { width: 100%; }
  .filter-bar { flex-direction: column; }
  .filter-select, .filter-input { width: 100%; }
}

.skeleton-card,.skeleton-row{background:#f8f8f8;border-radius:10px;padding:16px;margin-bottom:10px;}
.sk{background:linear-gradient(90deg,#e8e8e8 25%,#f5f5f5 50%,#e8e8e8 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:6px;height:14px;margin:6px 0;}
.sk-title{width:60%;height:18px;}.sk-line{width:90%;}.sk-badge{width:80px;height:22px;border-radius:20px;}.sk-short{width:40%;}
@keyframes shimmer{0%{background-position:200% 0;}100%{background-position:-200% 0;}}

/* Admin search fix */
#adminSearch {
  background: white;
  border: 1.5px solid var(--gray-200);
  color: var(--navy);
}
#adminSearch::placeholder { color: var(--gray-400); }
