/* ==========================================================================
   مكتبة أ.د. حبيب مونسي - Modern Academic Library Stylesheet
   ========================================================================== */

:root {
  /* Dark / Academic Luxury Palette (Default) */
  --bg-primary: #0b111e;
  --bg-secondary: #131d31;
  --bg-card: rgba(23, 35, 59, 0.75);
  --bg-card-hover: rgba(30, 46, 77, 0.95);
  --border-color: rgba(212, 175, 55, 0.2);
  --border-focus: #e6c66e;
  
  --text-primary: #f3f5f9;
  --text-secondary: #b0bcd3;
  --text-muted: #7888a6;
  
  --accent-gold: #e5b869;
  --accent-gold-glow: rgba(229, 184, 105, 0.35);
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 8px 30px rgba(229, 184, 105, 0.2);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --font-serif: 'Amiri', serif;
  --font-sans: 'Cairo', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --bg-header: rgba(248, 250, 252, 0.95);
  --border-color: rgba(199, 154, 39, 0.3);
  --border-subtle: #e2e8f0;
  --border-focus: #b4851e;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --accent-gold: #b4851e;
  --accent-gold-glow: rgba(180, 133, 30, 0.2);
  --accent-blue: #2563eb;
  --accent-emerald: #059669;
  --accent-emerald-glow: rgba(5, 150, 105, 0.2);
  
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.12);
  --shadow-gold: 0 6px 25px rgba(180, 133, 30, 0.15);
}

[data-theme="dark"] {
  --bg-primary: #0b111e;
  --bg-secondary: #131d31;
  --bg-page: #0d121c;
  --bg-surface: #151d2d;
  --bg-card: rgba(23, 35, 59, 0.75);
  --bg-card-hover: rgba(30, 46, 77, 0.95);
  --bg-subtle: #1c273c;
  --bg-header: rgba(13, 18, 28, 0.94);
  --border-color: rgba(212, 175, 55, 0.2);
  --border-subtle: #1e2a3d;
  --border-focus: #e6c66e;
  
  --text-primary: #f3f5f9;
  --text-secondary: #b0bcd3;
  --text-muted: #7888a6;
  
  --accent-gold: #e5b869;
  --accent-gold-glow: rgba(229, 184, 105, 0.35);
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 8px 30px rgba(229, 184, 105, 0.2);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Typography Enhancements */
h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
  line-height: 1.35;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  filter: brightness(1.2);
}

/* Subtle Background Texture & Glows */
.ambient-glow {
  position: fixed;
  top: -15vw;
  left: 20vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(229, 184, 105, 0.08) 0%, rgba(59, 130, 246, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

.ambient-glow-secondary {
  position: fixed;
  bottom: -10vw;
  right: -10vw;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, rgba(229, 184, 105, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 17, 30, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

[data-theme="light"] .site-header {
  background: rgba(248, 250, 252, 0.9);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-gold), #8a6a24);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b111e;
  font-size: 1.4rem;
  font-weight: bold;
  box-shadow: var(--shadow-gold);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

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

.nav-link:hover, .nav-link.active {
  color: var(--accent-gold);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-gold);
  transition: var(--transition);
}

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

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

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--accent-gold);
  color: #0b111e;
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 4.5rem 0 3.5rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(229, 184, 105, 0.1);
  border: 1px solid rgba(229, 184, 105, 0.3);
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.hero-title .highlight {
  color: var(--accent-gold);
  position: relative;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 620px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--accent-gold), #c9983d);
  color: #0b111e;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 12px 30px rgba(229, 184, 105, 0.35);
  color: #000;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-gold);
  font-family: var(--font-serif);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Hero Author Card */
.hero-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  overflow: hidden;
}

.hero-card::before {
  content: '“';
  position: absolute;
  top: -20px;
  right: 20px;
  font-size: 140px;
  font-family: var(--font-serif);
  color: var(--accent-gold);
  opacity: 0.08;
  pointer-events: none;
}

.author-avatar {
  width: 175px;
  height: 175px;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius-full);
  padding: 5px;
  background: linear-gradient(135deg, var(--accent-gold), #8a6a24, var(--accent-blue));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--shadow-gold);
  position: relative;
  transition: transform 0.4s ease;
}

.author-avatar:hover {
  transform: scale(1.04);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-full);
  background: #1e293b;
  display: block;
}

.bio-author-badge {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.bio-author-img {
  width: 95px;
  height: 95px;
  border-radius: var(--radius-full);
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--accent-gold);
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
}
  border-radius: var(--radius-full);
  background: #1e293b;
}

.author-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.author-role {
  font-size: 0.95rem;
  color: var(--accent-gold);
  margin-bottom: 1.2rem;
}

.author-quote-box {
  background: rgba(0, 0, 0, 0.15);
  border-right: 3px solid var(--accent-gold);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-align: right;
  margin-top: 1rem;
}

.author-quote-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-style: italic;
}

/* ==========================================================================
   Controls Bar (Search, Filters, Sort)
   ========================================================================== */
.controls-section {
  padding: 1rem 0 2.5rem;
  position: sticky;
  top: 78px;
  z-index: 90;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.search-and-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 0.85rem 3rem 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
  background: var(--bg-card-hover);
}

.search-icon {
  position: absolute;
  top: 50%;
  right: 1.2rem;
  transform: translateY(-50%);
  color: var(--accent-gold);
  font-size: 1.1rem;
  pointer-events: none;
}

.clear-search {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: none;
}

.clear-search.active {
  display: block;
}

.sort-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sort-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-select {
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.sort-select:focus {
  border-color: var(--border-focus);
}

/* Category Filter Tabs */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.filter-tab {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-tab:hover {
  background: var(--bg-card-hover);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.filter-tab.active {
  background: var(--accent-gold);
  color: #0b111e;
  border-color: var(--accent-gold);
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.filter-badge {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
}

.filter-tab.active .filter-badge {
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}

/* ==========================================================================
   Books Grid & 3D Cards
   ========================================================================== */
.books-section {
  padding-bottom: 5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.section-title::before {
  content: '';
  width: 5px;
  height: 28px;
  background: var(--accent-gold);
  border-radius: 4px;
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 2rem;
}

/* Individual Book Card */
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  border-color: var(--border-focus);
}

/* Card Cover Container */
.book-cover-wrap {
  position: relative;
  height: 330px;
  background: linear-gradient(180deg, #111b2f 0%, #0c1424 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  perspective: 1000px;
  overflow: hidden;
}

.book-cover-3d {
  position: relative;
  width: 175px;
  height: 260px;
  border-radius: 4px 8px 8px 4px;
  box-shadow: -8px 10px 25px rgba(0, 0, 0, 0.6), inset 3px 0 6px rgba(255, 255, 255, 0.2);
  transition: transform 0.4s ease;
  transform: rotateY(-8deg) rotateX(4deg);
}

.book-card:hover .book-cover-3d {
  transform: rotateY(0deg) rotateX(0deg) scale(1.05);
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px 8px 8px 4px;
  display: block;
}

/* Fallback Art Cover if image fails */
.book-cover-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid var(--accent-gold);
  border-radius: 4px 8px 8px 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  text-align: center;
  color: var(--accent-gold);
}

.book-cover-fallback .fallback-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1.4;
  color: #fff;
}

.book-cover-fallback .fallback-author {
  font-size: 0.8rem;
  color: var(--accent-gold);
}

/* Cover Badges */
.card-badges {
  position: absolute;
  top: 1rem;
  right: 1rem;
  left: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

.category-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(11, 17, 30, 0.85);
  border: 1px solid var(--border-color);
  color: var(--accent-gold);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.edition {
  background: rgba(229, 184, 105, 0.15);
  color: var(--accent-gold);
  border-color: rgba(229, 184, 105, 0.3);
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* Card Body */
.book-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.book-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.book-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-subtitle {
  font-size: 0.85rem;
  color: var(--accent-gold);
  margin-bottom: 0.9rem;
}

.book-card-brief {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Actions */
.book-card-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.btn-card {
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: 1px solid transparent;
}

.btn-card-primary {
  background: linear-gradient(135deg, var(--accent-gold), #c49536);
  color: #0b111e;
}

.btn-card-primary:hover {
  filter: brightness(1.15);
  box-shadow: var(--shadow-gold);
  color: #000;
}

.btn-card-outline {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-card-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* ==========================================================================
   Modal: In-Depth Book Details & AI Review
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open,
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-card {
  background: var(--bg-card, var(--bg-surface));
  border: 1px solid var(--border-focus, var(--border-color));
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 620px;
  box-shadow: var(--shadow-lg), 0 0 50px rgba(0, 0, 0, 0.4);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal-card,
.modal-overlay[style*="display: flex"] .modal-card,
.modal-overlay[style*="display:flex"] .modal-card {
  transform: translateY(0) scale(1);
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg), 0 0 50px rgba(229, 184, 105, 0.15);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-close {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
  z-index: 10;
}

.modal-close:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: rotate(90deg);
}

.modal-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.5rem;
  padding: 2.5rem;
}

.modal-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-cover-wrap {
  width: 200px;
  height: 300px;
  border-radius: 6px 12px 12px 6px;
  box-shadow: -10px 15px 35px rgba(0, 0, 0, 0.6);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.modal-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: rgba(0, 0, 0, 0.15);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  text-align: right;
  margin-bottom: 1.5rem;
}

.modal-info-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.4rem;
}

.modal-info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.modal-info-label {
  color: var(--text-muted);
}

.modal-info-value {
  color: var(--text-primary);
  font-weight: 600;
}

.modal-main {
  display: flex;
  flex-direction: column;
}

.modal-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.modal-subtitle {
  font-size: 1.05rem;
  color: var(--accent-gold);
  font-weight: 600;
}

/* AI Review Box inside Modal */
.ai-review-box {
  background: linear-gradient(145deg, rgba(229, 184, 105, 0.06), rgba(59, 130, 246, 0.04));
  border: 1px solid rgba(229, 184, 105, 0.3);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--accent-gold), #b38629);
  color: #0b111e;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow-sm);
}

.ai-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

.ai-themes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.ai-themes-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.ai-themes-list li::before {
  content: '✦';
  color: var(--accent-gold);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.ai-quote-card {
  background: rgba(0, 0, 0, 0.25);
  border-right: 3px solid var(--accent-gold);
  padding: 0.9rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--accent-gold);
  font-style: italic;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 1.5rem;
}

/* ==========================================================================
   Author Bio & Academic Journey Section
   ========================================================================== */
.author-section {
  padding: 4.5rem 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.bio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
}

.bio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.bio-text-wrap h3 {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.bio-honorific {
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.bio-paragraph {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.timeline-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 1.2rem;
}

.timeline-list {
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.timeline-list::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 0;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 7px;
  right: -1.8rem;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(229, 184, 105, 0.2);
}

.timeline-year {
  font-size: 0.8rem;
  color: var(--accent-gold);
  font-weight: 700;
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   Lectures & Audio Section
   ========================================================================== */
.lectures-section {
  padding: 4.5rem 0;
}

.lectures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.lecture-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.lecture-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-md);
}

.lecture-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.lecture-type {
  font-size: 0.8rem;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.lecture-duration {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lecture-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.lecture-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.btn-play {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(229, 184, 105, 0.1);
  color: var(--accent-gold);
  border: 1px solid var(--border-color);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-play:hover {
  background: var(--accent-gold);
  color: #0b111e;
  border-color: var(--accent-gold);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #070c16;
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer-brand h4 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}

.footer-brand p {
  line-height: 1.8;
  max-width: 400px;
}

.footer-col h5 {
  font-size: 1rem;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  font-weight: 700;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent-gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--accent-gold);
  color: var(--text-primary);
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .modal-sidebar {
    flex-direction: row;
    gap: 1.5rem;
    align-items: flex-start;
  }
  .modal-cover-wrap {
    width: 140px;
    height: 210px;
    margin-bottom: 0;
  }
  .bio-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .hero-title {
    font-size: 2.1rem;
  }
  .hero-stats {
    flex-wrap: wrap;
    gap: 1.5rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .modal-sidebar {
    flex-direction: column;
    align-items: center;
  }
  .modal-cover-wrap {
    width: 160px;
    height: 240px;
  }
}

/* ==========================================================================
   Content Injection Modal (نافذة تطعيم الموقع)
   ========================================================================== */
.admin-modal-container {
  max-width: 780px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.5rem 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

@media (max-width: 680px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-label .required {
  color: #ef4444;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
  background: rgba(0, 0, 0, 0.3);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.btn-inject {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  font-weight: 700;
}

.btn-inject:hover {
  filter: brightness(1.15);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
  color: #fff;
}

.btn-export {
  background: rgba(229, 184, 105, 0.15);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.btn-export:hover {
  background: var(--accent-gold);
  color: #0b111e;
}

/* ==========================================================================
   Academic Studies & Theses Section (قسم الأطروحات والدراسات)
   ========================================================================== */
.studies-section {
  padding: 4.5rem 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.studies-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.studies-tabs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.study-tab {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.study-tab.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  font-weight: 700;
}

.studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.8rem;
}

.study-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.study-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-md);
}

.study-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.study-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
}

.study-badge.phd {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.study-badge.master {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.study-badge.article {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.study-badge.book {
  background: rgba(229, 184, 105, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 184, 105, 0.3);
}

.study-badge.press {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.study-badge.audio {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

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

.study-year {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.study-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.7rem;
  line-height: 1.5;
}

.study-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

.study-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.study-summary {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex: 1;
}

.study-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: auto;
}



/* ==========================================================================
   منصة العقد الفريد | محرك البحث الفوري والذكي (Master Search Engine Modal)
   ========================================================================== */

.aqd-search-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3.5rem 1rem 2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.aqd-search-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.aqd-search-box {
  width: 100%;
  max-width: 760px;
  max-height: 84vh;
  background: #111a2e;
  border: 1px solid rgba(229, 184, 105, 0.35);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 30px rgba(229, 184, 105, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-20px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.aqd-search-overlay.active .aqd-search-box {
  transform: translateY(0) scale(1);
}

.aqd-search-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.4rem;
  background: rgba(23, 35, 59, 0.65);
  border-bottom: 1px solid rgba(229, 184, 105, 0.18);
}

.aqd-search-icon {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--accent-gold, #e5b869);
}

.aqd-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans, 'Cairo', sans-serif);
  font-size: 1.15rem;
  color: #f3f5f9;
  font-weight: 500;
}

.aqd-search-input::placeholder {
  color: #7888a6;
  font-size: 1rem;
}

.aqd-btn-clear {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #b0bcd3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.aqd-btn-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.aqd-btn-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #b0bcd3;
  padding: 0.4rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-sans, inherit);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.aqd-btn-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.aqd-search-filters {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  background: rgba(13, 21, 37, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  scrollbar-width: thin;
}

.aqd-filter-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #b0bcd3;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.83rem;
  font-family: var(--font-sans, inherit);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.aqd-filter-chip:hover {
  background: rgba(229, 184, 105, 0.15);
  border-color: rgba(229, 184, 105, 0.35);
  color: #f3f5f9;
}

.aqd-filter-chip.active {
  background: var(--accent-gold, #e5b869);
  color: #0b111e;
  border-color: var(--accent-gold, #e5b869);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(229, 184, 105, 0.25);
}

.aqd-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.4rem;
  min-height: 280px;
  max-height: calc(84vh - 170px);
}

.aqd-search-results::-webkit-scrollbar {
  width: 6px;
}
.aqd-search-results::-webkit-scrollbar-thumb {
  background: rgba(229, 184, 105, 0.25);
  border-radius: 3px;
}

.aqd-suggest-wrapper {
  display: flex;
  flex-direction: column;
}

.aqd-suggest-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-gold, #e5b869);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.aqd-suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.aqd-quick-tag {
  background: rgba(229, 184, 105, 0.08);
  border: 1px solid rgba(229, 184, 105, 0.22);
  color: #f3f5f9;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.84rem;
  font-family: var(--font-sans, inherit);
  cursor: pointer;
  transition: all 0.2s ease;
}

.aqd-quick-tag:hover {
  background: rgba(229, 184, 105, 0.22);
  border-color: var(--accent-gold, #e5b869);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(229, 184, 105, 0.2);
}

.aqd-recent-list,
.aqd-results-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.aqd-result-card {
  display: block;
  text-decoration: none;
  background: rgba(23, 35, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  transition: all 0.22s ease;
  position: relative;
}

.aqd-result-card:hover,
.aqd-result-card.selected {
  background: rgba(30, 46, 77, 0.85);
  border-color: rgba(229, 184, 105, 0.45);
  transform: translateX(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.aqd-result-card.selected {
  outline: 2px solid var(--accent-gold, #e5b869);
}

.aqd-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.aqd-space-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid currentColor;
}

.aqd-cat-pill {
  background: rgba(255, 255, 255, 0.07);
  color: #a0aec0;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.74rem;
}

.aqd-date {
  color: #7888a6;
  font-size: 0.76rem;
}

.aqd-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.aqd-snippet {
  font-size: 0.88rem;
  color: #b0bcd3;
  line-height: 1.65;
}

.search-highlight {
  background: rgba(229, 184, 105, 0.38);
  color: #ffffff;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-weight: 700;
}

.aqd-no-results {
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.aqd-search-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.4rem;
  background: rgba(13, 21, 37, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  color: #7888a6;
}

.aqd-search-shortcuts {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.aqd-search-shortcuts kbd {
  background: rgba(255, 255, 255, 0.09);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  font-size: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

/* Light Mode Overrides */
[data-theme="light"] .aqd-search-overlay {
  background: rgba(15, 23, 42, 0.65);
}

[data-theme="light"] .aqd-search-box {
  background: #ffffff;
  border-color: rgba(199, 154, 39, 0.35);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .aqd-search-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .aqd-search-input {
  color: #0f172a;
}

[data-theme="light"] .aqd-search-input::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .aqd-btn-clear {
  background: #f1f5f9;
  color: #64748b;
}

[data-theme="light"] .aqd-btn-close {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .aqd-search-filters {
  background: #f1f5f9;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .aqd-filter-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] .aqd-filter-chip.active {
  background: #b4851e;
  color: #ffffff;
  border-color: #b4851e;
}

[data-theme="light"] .aqd-result-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .aqd-result-card:hover,
[data-theme="light"] .aqd-result-card.selected {
  background: #fdfbf7;
  border-color: #b4851e;
}

[data-theme="light"] .aqd-title {
  color: #0f172a;
}

[data-theme="light"] .aqd-snippet {
  color: #475569;
}

[data-theme="light"] .search-highlight {
  background: rgba(180, 133, 30, 0.25);
  color: #0f172a;
}

[data-theme="light"] .aqd-quick-tag {
  background: rgba(180, 133, 30, 0.08);
  border-color: rgba(180, 133, 30, 0.25);
  color: #334155;
}

[data-theme="light"] .aqd-search-footer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .aqd-search-shortcuts kbd {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
