/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --dark-bg: #0f0f23;
  --darker-bg: #0a0a1a;
  --card-bg: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #27272a;
  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  --gradient-accent: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.25);
}

/* Font Definitions */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.6;
  direction: ltr;
  overflow-x: hidden;
  transition: all 0.3s ease;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Arabic Language Support with Multiple Font Options */
body.lang-ar {
  font-family: "IBM Plex Sans Arabic", "Tajawal", "Cairo", "Amiri", "Segoe UI Arabic", "Tahoma", sans-serif;
  direction: rtl;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
}

/* English Language Support - Force LTR */
body.lang-en {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  direction: ltr;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

/* Specific Arabic Font Classes for Different Elements */
.arabic-display {
  font-family: "Amiri", "IBM Plex Sans Arabic", serif;
  font-weight: 700;
}

.arabic-body {
  font-family: "IBM Plex Sans Arabic", "Tajawal", sans-serif;
  font-weight: 400;
}

.arabic-heading {
  font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
  font-weight: 700;
}

/* Apply Arabic fonts when in Arabic mode */
body.lang-ar .hero-title,
body.lang-ar .section-title {
  font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.lang-ar .hero-subtitle,
body.lang-ar .section-subtitle {
  font-family: "IBM Plex Sans Arabic", "Tajawal", sans-serif;
  font-weight: 600;
}

body.lang-ar .hero-description,
body.lang-ar p,
body.lang-ar .research-description {
  font-family: "IBM Plex Sans Arabic", "Tajawal", sans-serif;
  font-weight: 400;
  line-height: 1.8;
}

body.lang-ar .nav-link,
body.lang-ar .btn,
body.lang-ar .language-toggle {
  font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
  font-weight: 500;
}

body.lang-ar h1,
body.lang-ar h2,
body.lang-ar h3,
body.lang-ar h4,
body.lang-ar h5,
body.lang-ar h6 {
  font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
  font-weight: 700;
}

/* Enhanced Arabic Typography */
body.lang-ar {
  font-size: 16px;
  line-height: 1.7;
}

body.lang-ar .hero-title {
  font-size: 4.2rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

body.lang-ar .section-title {
  font-size: 3.2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

body.lang-ar .hero-subtitle {
  font-size: 1.6rem;
  line-height: 1.4;
}

body.lang-ar .hero-description {
  font-size: 1.3rem;
  line-height: 1.8;
}

/* Arabic Number Formatting */
body.lang-ar .stat-number {
  font-family: "IBM Plex Sans Arabic", monospace;
  font-feature-settings: "tnum" 1;
}

/* Enhanced Direction Support */
html[dir="rtl"] {
  direction: rtl;
}

html[dir="ltr"] {
  direction: ltr;
}

/* Force LTR for English */
body.lang-en,
body.lang-en * {
  direction: ltr !important;
}

body.lang-en .nav-container,
body.lang-en .nav-menu,
body.lang-en .nav-actions,
body.lang-en .hero-actions,
body.lang-en .hero-stats,
body.lang-en .search-input-container,
body.lang-en .results-header,
body.lang-en .research-meta,
body.lang-en .meta-item,
body.lang-en .research-actions,
body.lang-en .about-grid,
body.lang-en .floating-card,
body.lang-en .contributor-overlay .social-links,
body.lang-en .footer-content,
body.lang-en .footer-info,
body.lang-en .footer-links,
body.lang-en .contact-item {
  flex-direction: row !important;
  text-align: left !important;
}

/* RTL Layout Adjustments */

html[dir="rtl"] .nav-link {
  flex-direction: row-reverse;
}

html[dir="rtl"] .nav-actions {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero-actions {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero-stats {
  flex-direction: row-reverse;
}

html[dir="rtl"] .search-input-container {
  direction: rtl;
}

html[dir="rtl"] .search-input {
  text-align: right;
  padding: 2rem 2.5rem 2rem 5rem;
}

html[dir="rtl"] .search-btn {
  right: auto;
  left: 10px;
}

html[dir="rtl"] .results-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .research-meta {
  direction: rtl;
}

html[dir="rtl"] .meta-item {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .research-actions {
  flex-direction: row-reverse;
}

html[dir="rtl"] .about-grid {
  direction: rtl;
}

html[dir="rtl"] .floating-card {
  flex-direction: row-reverse;
}

html[dir="rtl"] .contributor-overlay .social-links {
  flex-direction: row-reverse;
}

html[dir="rtl"] .footer-content {
  direction: rtl;
}

html[dir="rtl"] .footer-info {
  flex-direction: row-reverse;
}

html[dir="rtl"] .footer-links {
  flex-direction: row-reverse;
}

html[dir="rtl"] .contact-item {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .back-to-top {
  right: auto;
  left: 2rem;
}

/* LTR Layout (Default) - Force for English */
html[dir="ltr"] .search-input,
body.lang-en .search-input {
  text-align: left !important;
  padding: 2rem 5rem 2rem 2.5rem !important;
}

html[dir="ltr"] .search-btn,
body.lang-en .search-btn {
  right: 10px !important;
  left: auto !important;
}

html[dir="ltr"] .meta-item,
body.lang-en .meta-item {
  text-align: left !important;
}

html[dir="ltr"] .contact-item,
body.lang-en .contact-item {
  text-align: left !important;
}

html[dir="ltr"] .back-to-top,
body.lang-en .back-to-top {
  right: 2rem !important;
  left: auto !important;
}

/* Search Instructions Direction Fix */
body.lang-en .search-instructions {
  text-align: center !important;
  direction: ltr !important;
}

body.lang-en .search-tips {
  text-align: left !important;
  direction: ltr !important;
}

body.lang-en .search-tips li {
  text-align: left !important;
  direction: ltr !important;
}

/* Mobile RTL Adjustments */
@media (max-width: 768px) {
  html[dir="rtl"] .search-input {
    padding: 1.5rem 2rem 1.5rem 4rem;
  }

  html[dir="rtl"] .search-btn {
    right: auto;
    left: 8px;
  }

  html[dir="ltr"] .search-input,
  body.lang-en .search-input {
    padding: 1.5rem 4rem 1.5rem 2rem !important;
  }

  html[dir="ltr"] .search-btn,
  body.lang-en .search-btn {
    right: 8px !important;
    left: auto !important;
  }
}

@media (max-width: 480px) {
  html[dir="rtl"] .search-input {
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
  }

  html[dir="rtl"] .search-btn {
    right: auto;
    left: 6px;
  }

  html[dir="ltr"] .search-input,
  body.lang-en .search-input {
    padding: 1.2rem 3.5rem 1.2rem 1.5rem !important;
  }

  html[dir="ltr"] .search-btn,
  body.lang-en .search-btn {
    right: 6px !important;
    left: auto !important;
  }
}

html {
  scroll-behavior: smooth;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--darker-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader {
  text-align: center;
}

.loader-inner {
  width: 80px;
  height: 80px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.loader-inner i {
  font-size: 2rem;
  color: var(--primary-color);
}

.loader p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Particles Background */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(15, 15, 35, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(10, 10, 26, 0.98);
  box-shadow: var(--shadow-lg);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.8rem 1.2rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

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

/* Language Toggle */
.language-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.8rem 1.2rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--primary-color);
  border-radius: 12px;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-family: inherit;
}

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

.language-toggle.switching {
  transform: scale(0.95);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0.1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 0%, var(--dark-bg) 70%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.title-line {
  display: block;
  opacity: 0;
  transform: translateY(30px);
  animation: slideUp 0.8s ease forwards;
}

.title-line:nth-child(2) {
  animation-delay: 0.2s;
}

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

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  font-weight: 600;
  opacity: 0;
  animation: slideUp 0.8s ease 0.4s forwards;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  line-height: 1.8;
  opacity: 0;
  animation: slideUp 0.8s ease 0.6s forwards;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: slideUp 0.8s ease 0.8s forwards;
}

.hero-stats {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3rem;
  opacity: 0;
  animation: slideUp 0.8s ease 1s forwards;
}

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

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Search Section - ENHANCED */
.search-section {
  background: var(--darker-bg);
  position: relative;
  overflow: hidden;
  padding: 6rem 0;
}

.search-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.search-container {
  position: relative;
  z-index: 2;
}

/* Search Box Styling */
.search-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.search-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-primary);
}

/* Search Input Container */
.search-input-container {
  position: relative;
  margin-bottom: 0;
}

.search-input {
  width: 100%;
  padding: 2rem 5rem 2rem 2.5rem;
  background: var(--darker-bg);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), inset 0 2px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* Search Button */
.search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 15px;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.search-btn:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.search-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* Search Instructions */
.search-instructions {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.instructions-icon {
  width: 120px;
  height: 120px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-size: 3rem;
  color: var(--primary-color);
  animation: pulse 2s ease-in-out infinite;
}

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

.search-instructions h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.search-instructions p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.search-tips {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 2rem;
  margin-top: 2rem;
  text-align: left;
}

.search-tips h4 {
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-tips h4::before {
  content: "💡";
  font-size: 1.2rem;
}

.search-tips ul {
  list-style: none;
  padding: 0;
}

.search-tips li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

.search-tips li::before {
  content: "•";
  color: var(--primary-color);
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Search Results Container */
.search-results {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.search-results::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-accent);
}

/* Results Header */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-count {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.count-number {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.2rem;
}

/* Results Grid */
.results-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
  min-height: 200px;
  transition: all 0.3s ease;
}

.results-grid:empty {
  display: none;
}

/* Research Card Styles - ENHANCED */
.research-card {
  background: var(--darker-bg);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.5s ease-out forwards;
}

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.research-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-primary);
}

.research-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

.research-card:hover::after {
  opacity: 1;
}

/* Research Header */
.research-header {
  margin-bottom: 2rem;
}

.research-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0;
  transition: color 0.3s ease;
}

/* Research Description */
.research-description {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* Research Meta Information */
.research-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(5px);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.meta-item i {
  color: var(--primary-color);
  width: 20px;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.meta-item span {
  color: var(--text-secondary);
}

/* Research Actions */
.research-actions {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: flex-start;
}

.research-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: inherit;
  box-shadow: var(--shadow-md);
}

.research-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.research-btn:active {
  transform: translateY(-1px);
}

.research-btn i {
  font-size: 1.1rem;
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.no-results-icon {
  width: 100px;
  height: 100px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-size: 2.5rem;
  color: var(--primary-color);
  animation: pulse 2s ease-in-out infinite;
}

.no-results h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.no-results p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Loading Results State */
.loading-results {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.loading-spinner {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
  animation: spin 1s linear infinite;
}

.loading-spinner i {
  display: block;
  margin-bottom: 1rem;
}

.loading-results p {
  font-size: 1.2rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

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

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

/* Section Styles */
section {
  padding: 6rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-line {
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  margin: 0 auto 2rem;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

/* About Section */
.about-section {
  background: var(--darker-bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-content {
  display: grid;
  gap: 2rem;
}

.about-card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-primary);
}

.about-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.card-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: white;
  font-size: 1.5rem;
}

.about-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.about-card p {
  color: var(--text-secondary);
  line-height: 1.8;
}

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

.visual-element {
  position: relative;
  width: 100%;
  height: 100%;
}

.floating-card {
  position: absolute;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  animation: float 3s ease-in-out infinite;
  box-shadow: var(--shadow-lg);
}

.floating-card:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.floating-card:nth-child(2) {
  top: 50%;
  left: 30%;
  animation-delay: 1s;
}

.floating-card:nth-child(3) {
  top: 80%;
  left: 5%;
  animation-delay: 2s;
}

.floating-card i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

/* Features Section */
.features-section {
  background: var(--dark-bg);
}

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

.feature-card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::before {
  opacity: 0.05;
}

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

.feature-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: white;
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

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

.feature-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8rem;
  color: var(--primary-color);
  opacity: 0.03;
  pointer-events: none;
}

/* Contributors Section */
.contributors-section {
  background: var(--darker-bg);
}

.contributors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.contributor-card {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.contributor-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.contributor-image {
  position: relative;
  height: 200px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-placeholder {
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
}

.contributor-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--secondary-color);
  transform: scale(1.1);
}

.contributor-info {
  padding: 2rem;
  text-align: center;
}

.contributor-info h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.contributor-role {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.contributor-bio {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Footer */
.footer {
  background: var(--darker-bg);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.8rem;
}

.footer-section ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--primary-color);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-secondary);
}

.contact-item i {
  color: var(--primary-color);
  width: 20px;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-info p {
  color: var(--text-muted);
  margin: 0;
}

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

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

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

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Animation Classes */
[data-aos] {
  opacity: 0;
  transition: all 0.6s ease;
}

[data-aos].aos-animate {
  opacity: 1;
}

[data-aos="fade-up"] {
  transform: translateY(30px);
}

[data-aos="fade-up"].aos-animate {
  transform: translateY(0);
}

[data-aos="zoom-in"] {
  transform: scale(0.8);
}

[data-aos="zoom-in"].aos-animate {
  transform: scale(1);
}

[data-aos="slide-right"] {
  transform: translateX(-30px);
}

[data-aos="slide-right"].aos-animate {
  transform: translateX(0);
}

/* --- Fix: keep mobile menu vertical in English/LTR --- */
@media (max-width: 768px) {
  /* اجبار اتجاه عمودي في الجوال مهما كانت اللغة */
  body.lang-en .nav-menu,
  html[dir="ltr"] .nav-menu,
  html[dir="rtl"] .nav-menu {
    flex-direction: column !important;
    justify-content: center;
    align-items: center;
  }

  /* منع كسر سطر نص الروابط مثل "About Project" */
  .nav-link,
  .nav-link span {
    white-space: nowrap;
  }

  /* أيقونة يسار في LTR ويمين في RTL */
  html[dir="ltr"] .nav-link i { margin-right: .5rem; margin-left: 0; }
  html[dir="rtl"] .nav-link i { margin-left: .5rem;  margin-right: 0; }
}


/* Responsive Design */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .research-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--darker-bg);
    flex-direction: column;
    justify-content: flex-start;
    padding: 2rem;
    transition: left 0.3s ease;
    border-top: 1px solid var(--border-color);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .hero-title {
    font-size: 2.5rem;
  }

  body.lang-ar .hero-title {
    font-size: 2.8rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-stats {
    position: static;
    transform: none;
    justify-content: center;
    margin-top: 3rem;
    flex-wrap: wrap;
  }

  .section-title {
    font-size: 2rem;
  }

  body.lang-ar .section-title {
    font-size: 2.2rem;
  }

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

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

  .footer-info {
    flex-direction: column;
    text-align: center;
  }

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

  .search-box {
    padding: 2rem;
  }

  .search-input {
    padding: 1.5rem 4rem 1.5rem 2rem;
    font-size: 1rem;
  }

  body.lang-ar .search-input {
    padding: 1.5rem 2rem 1.5rem 4rem;
  }

  .search-btn {
    width: 50px;
    height: 50px;
    right: 8px;
  }

  body.lang-ar .search-btn {
    right: auto;
    left: 8px;
  }

  .search-results {
    padding: 2rem;
  }

  .research-card {
    padding: 2rem;
  }

  .research-meta {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .research-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .research-btn {
    justify-content: center;
  }

  .results-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .search-instructions {
    padding: 3rem 1rem;
  }

  .instructions-icon {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
  }

  .search-instructions h3 {
    font-size: 1.5rem;
  }

  .search-instructions p {
    font-size: 1rem;
  }

  .search-tips {
    padding: 1.5rem;
    text-align: center;
  }

  /* Force LTR for English on mobile */
  body.lang-en .search-tips {
    text-align: left !important;
  }

  body.lang-en .search-tips li {
    text-align: left !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .nav-container {
    padding: 1rem 15px;
  }

  .hero-content {
    padding: 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  body.lang-ar .hero-title {
    font-size: 2.2rem;
  }

  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  .about-card,
  .feature-card,
  .contributor-info {
    padding: 1.5rem;
  }

  .search-box {
    padding: 1.5rem;
  }

  .search-input {
    padding: 1.2rem 3.5rem 1.2rem 1.5rem;
    font-size: 0.95rem;
  }

  body.lang-ar .search-input {
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
  }

  .search-btn {
    width: 45px;
    height: 45px;
    right: 6px;
  }

  body.lang-ar .search-btn {
    right: auto;
    left: 6px;
  }

  .search-results {
    padding: 1.5rem;
  }

  .research-card {
    padding: 1.5rem;
  }

  .research-title {
    font-size: 1.2rem;
  }

  .language-toggle {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .search-instructions {
    padding: 2rem 1rem;
  }

  .instructions-icon {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  .search-instructions h3 {
    font-size: 1.3rem;
  }

  .search-instructions p {
    font-size: 0.9rem;
  }

  .search-tips {
    padding: 1rem;
  }

  .search-tips h4 {
    font-size: 1rem;
  }

  .search-tips li {
    font-size: 0.9rem;
  }
}

/* Font Loading Optimization */
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-display: swap;
}

@font-face {
  font-family: "Tajawal";
  font-display: swap;
}

@font-face {
  font-family: "Cairo";
  font-display: swap;
}

@font-face {
  font-family: "Amiri";
  font-display: swap;
}

/* FIXED MOBILE NAVIGATION */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
    min-height: 70px;
    position: relative;
  }

  .nav-brand {
    font-size: 1.3rem;
    z-index: 1002;
    position: relative;
  }

  .brand-icon {
    width: 35px;
    height: 35px;
  }

  /* CRITICAL FIX: Hide mobile menu by default */
  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    gap: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border: none;
    overflow-y: auto;
    z-index: 1000;
    /* FORCE HIDE WHEN NOT ACTIVE */
    visibility: hidden;
    opacity: 0;
  }

  /* Show menu only when active */
  .nav-menu.active {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
  }

  .nav-link {
    width: auto;
    padding: 1.2rem 2rem;
    border-radius: 12px;
    margin-bottom: 0;
    justify-content: center;
    font-size: 1.2rem;
    text-align: center;
    min-width: 200px;
    /* ENSURE LINKS ARE HIDDEN WHEN MENU IS CLOSED */
    display: flex;
  }

  .nav-link span {
    display: inline;
  }

  .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
  }

  .nav-actions {
    z-index: 1002;
    gap: 0.8rem;
    position: relative;
  }

  .nav-toggle {
    display: flex;
    z-index: 1002;
    position: relative;
  }

  .language-toggle {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    min-width: 85px;
    z-index: 1002;
    position: relative;
  }

  /* RTL Mobile Menu */
  html[dir="rtl"] .nav-menu {
    transform: translateX(100%);
  }

  html[dir="rtl"] .nav-menu.active {
    transform: translateX(0);
  }

  /* Force LTR for English - CRITICAL FIX */
  body.lang-en .nav-menu {
    transform: translateX(-100%) !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  body.lang-en .nav-menu.active {
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Prevent body scroll when menu is open */
  body.nav-open {
    overflow: hidden;
  }

  /* Hero section adjustment for mobile */
  .hero-section {
    padding-top: 70px;
    z-index: 1;
    position: relative;
  }
}

/* Additional mobile fixes */
@media (max-width: 480px) {
  .nav-container {
    padding: 0.8rem;
  }

  .nav-brand {
    font-size: 1.2rem;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .language-toggle {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    min-width: 80px;
  }
}
