@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;800&display=swap');

:root {
  --primary-color: #0169b5;
  --bg-color: #ffffff; /* Pure white background */
  --text-dark: #0f172a;
  --text-light: #334155;
}

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

html,
body {
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

html {
  /* Removed scroll snapping as requested */
}

body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  position: fixed; /* Keep it fixed for the whole site */
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100; /* Ensure header is above 3D model */
  background-color: #ffffff; /* Solid white background */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Subtle shadow to distinguish it from the background */
}

/* Right section: Logo */
.header-right {
  display: flex;
  align-items: center;
}

.header-logo {
  height: 40px;
  /* Adjust height based on logo proportions */
  width: auto;
}

/* Left section: Nav + Globe */
.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Language Switcher (Glassmorphism) */
.lang-switcher {
  position: relative;
  display: inline-block;
  user-select: none;
}

.current-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.4);
  padding: 0.6rem;
  border-radius: 50%;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  width: 44px;
  height: 44px;
}

#currentLangText {
  display: none !important;
}

.current-lang:hover {
  background: rgba(255, 255, 255, 0.6);
}

.current-lang .globe-icon {
  width: 24px;
  height: 24px;
  color: #000;
  /* User requested black in old version, but let's keep black */
  transition: transform 0.3s;
}

.current-lang:hover .globe-icon {
  transform: scale(1.1);
}

.lang-dropdown {
  position: absolute;
  top: 130%;
  left: 50%;
  right: auto;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -10px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.lang-dropdown li {
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  color: var(--text-dark);
  font-weight: 600;
  text-align: right;
}

.lang-dropdown li:hover {
  background: rgba(1, 105, 181, 0.1);
  /* primary color */
  color: var(--primary-color);
}

/* Hide Google Translate Top Bar */
body,
html {
  top: 0 !important;
  margin-top: 0 !important;
}

.goog-te-banner-frame {
  display: none !important;
  visibility: hidden !important;
}

.goog-te-balloon-frame {
  display: none !important;
}

.goog-logo-link {
  display: none !important;
}

.goog-te-gadget {
  height: 0 !important;
  overflow: hidden !important;
  display: none !important;
}

.skiptranslate iframe {
  display: none !important;
  visibility: hidden !important;
}

#goog-gt-tt {
  display: none !important;
}

/* Translation Loading Overlay */
.translation-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.translation-loading.active {
  opacity: 1;
  visibility: visible;
}

.translation-loading .loading-logo {
  width: 120px;
  margin-bottom: 20px;
  animation: pulse 1.5s infinite alternate;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(1, 105, 181, 0.2);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.translation-loading p {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}

@keyframes pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.05);
  }
}

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

  100% {
    transform: rotate(360deg);
  }
}

/* --- LTR / Translation Flip Styles --- */
html.translated-ltr {
  direction: ltr !important;
}

html.translated-ltr .lang-dropdown {
  /* Uses the same centering logic */
}

html.translated-ltr .lang-dropdown li {
  text-align: left !important;
}

html.translated-ltr .text-section {
  text-align: left !important;
}

html.translated-ltr .footer-badge {
  text-align: left !important;
}

/* Mirror the 3D Spline container using ScaleX for 100% guarantee */
html.translated-ltr .spline-container {
  transform: scaleX(-1) !important;
}

@media (max-width: 768px) {
  html.translated-ltr .mobile-nav {
    left: 0 !important;
    right: auto !important;
    transform: translateX(-100%);
  }

  html.translated-ltr .mobile-nav.active {
    transform: translateX(0);
  }
}

.logo-text {
  display: none;
  /* Safely hidden if remnants remain */
}

nav.desktop-nav {
  display: flex;
  gap: 2.5rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

nav.desktop-nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 700;
  font-size: 1.05rem;
  transition: color 0.3s;
}

nav.desktop-nav a:hover {
  color: var(--primary-color);
}

/* Mobile Nav (hidden on desktop) */
.mobile-nav {
  display: none;
}


/* Main Layout */
.main-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  pointer-events: none;
  /* Let mouse clicks pass through to the 3D background */
}

/* 3D Model Area (Absolute Background for Hero Only) */
.spline-container {
  position: absolute;
  top: 88px;
  /* Start exactly below the desktop header (24px + 40px + 24px) */
  left: 0;
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 88px);
  z-index: 1;
  /* Stay above body background */
  overflow: hidden;
  /* Prevents seeing the overflowing parts (including the logo) */
  pointer-events: auto;
  /* Catch mouse events for the robot */
}

spline-viewer {
  position: absolute;
  width: 145%;
  /* Make it much wider to cover the right side after a deep left shift */
  left: -45%;
  /* Push it significantly to the left to fill the empty space */
  height: calc(100% + 120px);
  /* Extend height to crop logo at the bottom */
  top: 0;
  /* Keep top aligned to push the robot down naturally */
}

/* Fallback CSS to hide logo if possible */
spline-viewer::part(logo) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Content Area */
.content-overlay {
  position: relative;
  z-index: 10;
  display: flex;
  width: 100%;
  padding: 2rem 4rem;
  pointer-events: none;
  /* Let clicks pass to 3D model */
}

.content-overlay.section {
  min-height: 100vh;
  align-items: center;
  position: relative; /* Needed for the separator */
}

/* Elegant Gradient Separator Line */
.content-overlay.section:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 15%;
  width: 70%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(1, 105, 181, 0.4) 50%, transparent 100%);
  border-radius: 50%;
  box-shadow: 0 2px 15px rgba(1, 105, 181, 0.15);
}

/* Text on the right, constrained to 45% so it never touches the robot */
.text-section {
  width: 45%;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: auto;
  /* Ensure text can be selected */
  animation: fadeIn 1s ease-out forwards;
}

.text-section.w-100 {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.text-center {
  text-align: center;
  align-items: center;
}

.second-section, .fourth-section {
  background-color: #ffffff; /* White background for alternating sections */
  position: relative;
  z-index: 20;
  justify-content: center;
  overflow: hidden;
}

.fourth-section, .fifth-section, .seventh-section, .tenth-section {
  justify-content: flex-start !important; /* Force alignment to the right edge */
  padding-top: 100px !important; /* Clear header */
  padding-bottom: 2rem !important;
}

.eighth-section, .ninth-section, .eleventh-section, .twelfth-section, .thirteenth-section, .fourteenth-section {
  justify-content: center !important;
  align-items: center;
  padding-top: 100px !important;
}

.sixth-section {
  justify-content: space-between !important;
  align-items: center;
  padding-top: 100px !important;
}

.sixth-section .image-section {
  width: 45%;
  pointer-events: auto;
  animation: fadeInRight 1s ease-out forwards;
}

.sixth-section .image-section img {
  width: 100%;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(1, 105, 181, 0.15);
  object-fit: cover;
  border: 8px solid #f8fafc;
}

/* Compact spacing to ensure it fits in one page */
.fourth-section .text-section h1, .fifth-section .text-section h1, .sixth-section .text-section h1, .seventh-section .text-section h1, .eighth-section .text-section h1, .ninth-section .text-section h1, .tenth-section .text-section h1, .eleventh-section .text-section h1, .twelfth-section .text-section h1, .thirteenth-section .text-section h1 {
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  white-space: normal !important;
}

.fourth-section .text-section h2, .fifth-section .text-section h2, .sixth-section .text-section h2, .seventh-section .text-section h2, .eighth-section .text-section h2, .ninth-section .text-section h2, .tenth-section .text-section h2, .eleventh-section .text-section h2, .twelfth-section .text-section h2, .thirteenth-section .text-section h2 {
  margin-bottom: 0.5rem !important;
}

.second-section .text-section h1, .fourth-section .text-section h1, .fifth-section .text-section h1, .sixth-section .text-section h1, .seventh-section .text-section h1, .eighth-section .text-section h1, .ninth-section .text-section h1, .tenth-section .text-section h1, .eleventh-section .text-section h1, .twelfth-section .text-section h1, .thirteenth-section .text-section h1 {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.second-section .text-section h2, .fourth-section .text-section h2, .fifth-section .text-section h2, .sixth-section .text-section h2, .seventh-section .text-section h2, .eighth-section .text-section h2, .ninth-section .text-section h2, .tenth-section .text-section h2, .eleventh-section .text-section h2, .twelfth-section .text-section h2, .thirteenth-section .text-section h2 {
  font-size: 2.2rem;
  line-height: 1.4;
  color: var(--text-dark);
  font-weight: 800;
}

.second-section .text-section p.description, .fourth-section .text-section p.description, .fifth-section .text-section p.description {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  font-size: 1.25rem;
  font-weight: 600;
  color: #475569;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 12px;
  animation: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  width: 100%;
  max-width: 800px;
  white-space: normal; /* Changed from nowrap to support longer text */
}

/* Compact padding/margin for description */
.fourth-section .text-section p.description, .fifth-section .text-section p.description {
  margin-top: 1rem !important;
  padding: 1rem 1.5rem !important;
}

.second-section .footer-badge, .fourth-section .footer-badge, .fifth-section .footer-badge, .sixth-section .footer-badge, .eighth-section .footer-badge, .tenth-section .footer-badge, .eleventh-section .footer-badge {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  animation: none;
  padding: 1.5rem 2rem;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(1, 105, 181, 0.3);
  margin-top: 1.5rem;
  width: 100%;
  max-width: 800px;
}

.second-section .footer-badge p.title, .fourth-section .footer-badge p.title, .fifth-section .footer-badge p.title, .sixth-section .footer-badge p.title, .eighth-section .footer-badge p.title, .tenth-section .footer-badge p.title, .eleventh-section .footer-badge p.title {
  color: #ffffff;
  font-size: 1.2rem;
  line-height: 1.6;
}

/* Compact padding/margin for footer-badge */
.fourth-section .footer-badge, .fifth-section .footer-badge, .sixth-section .footer-badge, .eighth-section .footer-badge, .tenth-section .footer-badge, .eleventh-section .footer-badge {
  margin-top: 1rem !important;
  padding: 1rem 1.5rem !important;
}

.main-pillars-list {
  list-style-type: decimal;
  margin: 1rem 2rem 1rem 0 !important; /* Reduced vertical space */
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-color);
  text-align: right;
  direction: rtl;
  max-width: 800px;
}

.main-pillars-list li {
  margin-bottom: 0.5rem !important; /* Reduced vertical space */
  padding-right: 1rem;
}

html.translated-ltr .main-pillars-list {
  margin: 1.5rem 0 2rem 2rem; /* Indent left for LTR */
  text-align: left;
  direction: ltr;
}

html.translated-ltr .main-pillars-list li {
  padding-right: 0;
  padding-left: 1rem;
}

.transform-items {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0 0.5rem 0;
  flex-wrap: wrap;
}

.transform-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.transform-item {
  background: var(--primary-color);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(1, 105, 181, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.animated-arrow {
  width: 32px;
  height: 32px;
  color: var(--primary-color);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* Skills List (Seventh Section) */
.skills-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two columns */
  gap: 1.5rem; /* Slightly larger gap for grid */
}

@media (max-width: 768px) {
  .skills-list {
    grid-template-columns: 1fr; /* Revert to one column on mobile */
  }
}

@media (min-width: 769px) {
  .nowrap-desktop {
    white-space: nowrap !important;
  }
}

.skills-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  background: #f8fafc;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(1, 105, 181, 0.1);
  transition: transform 0.3s ease, background 0.3s ease;
}

.skills-list li:hover {
  transform: translateX(-8px);
  background: #ffffff;
}

html.translated-ltr .skills-list li:hover {
  transform: translateX(8px);
}

.check-svg {
  width: 28px;
  height: 28px;
  color: #10b981; /* Vibrant green checkmark */
  flex-shrink: 0;
}

/* Dimensions Cards (Eighth Section) */
.dimensions-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.dimension-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 10px 30px rgba(1, 105, 181, 0.05);
  border: 1px solid rgba(1, 105, 181, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dimension-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(1, 105, 181, 0.15);
}

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

.dimension-card h3 {
  color: var(--primary-color);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.dimension-card p {
  color: var(--text-light);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.6;
}

@media (max-width: 992px) {
  .dimensions-cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Ninth Section: AI Cards */
.ai-contrast-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem; /* Reduced gap */
  margin: 1.5rem auto; /* Reduced margin to fit on one page */
  max-width: 900px;
}

.contrast-card {
  border-radius: 20px;
  padding: 1.5rem; /* Reduced padding */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  text-align: center;
  border: 1px solid rgba(0,0,0,0.05);
  background: #ffffff;
  transition: transform 0.3s ease;
}

.contrast-card:hover {
  transform: translateY(-5px);
}

.contrast-card h3 {
  font-size: 1.3rem; /* Reduced font size */
  color: var(--text-dark);
  margin-bottom: 1rem; /* Reduced margin */
}

.contrast-card p {
  font-size: 1.4rem; /* Reduced font size */
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.contrast-card.negative p {
  color: #ef4444;
}

.contrast-card.positive p {
  color: #10b981;
}

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

/* Ninth Section: Supports Grid */
.supports-container {
  margin-top: 1.5rem; /* Reduced margin */
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.supports-title {
  font-size: 1.5rem; /* Reduced font size */
  color: var(--text-dark);
  font-weight: 800;
  margin-bottom: 1rem; /* Reduced margin */
}

.supports-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem; /* Reduced gap */
}

.support-item {
  background: #f8fafc;
  border-radius: 12px; /* Adjusted radius */
  padding: 1rem 0.5rem; /* Reduced padding */
  font-size: 1.1rem; /* Slightly smaller text */
  font-weight: 700;
  color: var(--text-dark);
  border: 1px solid rgba(1, 105, 181, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.support-item:hover {
  transform: translateY(-5px);
  background: var(--primary-color);
  color: #ffffff;
}

@media (max-width: 992px) {
  .ai-contrast-cards {
    grid-template-columns: 1fr;
  }
  .supports-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .supports-grid {
    grid-template-columns: 1fr;
  }
}

/* Tenth Section: Contributions List */
.contributions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem; /* Reduced gap */
  margin: 1.5rem 0; /* Reduced margin */
}

.contribution-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: #f8fafc;
  padding: 1rem 1.5rem; /* Reduced padding */
  border-radius: 16px;
  border: 1px solid rgba(1, 105, 181, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  transition: transform 0.3s ease, background 0.3s ease;
}

.contribution-item:hover {
  transform: translateX(-10px);
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(1, 105, 181, 0.1);
}

html.translated-ltr .contribution-item:hover {
  transform: translateX(10px);
}

.contrib-num {
  font-size: 2rem; /* Reduced font size */
  font-weight: 900;
  color: var(--primary-color);
  opacity: 0.8;
  width: 40px; /* Reduced width */
  flex-shrink: 0;
  text-align: center;
}

.contribution-item p {
  font-size: 1.3rem; /* Reduced font size */
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

/* Eleventh Section: Challenges */
.challenges-title {
  font-size: 1.4rem;
  color: #ef4444; /* red for challenges */
  font-weight: 800;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.challenges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0 auto;
  max-width: 900px;
}

.challenge-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.challenge-item:hover {
  transform: translateY(-3px);
  border-color: rgba(239, 68, 68, 0.3); /* faint red border on hover */
}

.challenge-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.challenge-item p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  text-align: start;
  line-height: 1.4;
}

@media (max-width: 992px) {
  .challenges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .challenges-grid {
    grid-template-columns: 1fr;
  }
}

/* Twelfth Section: Grand Quote */
.grand-quote-container {
  position: relative;
  max-width: 900px;
  margin: 3.5rem auto 0;
  padding: 3rem 4rem;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(1, 105, 181, 0.08);
  border: 1px solid rgba(1, 105, 181, 0.1);
  text-align: center;
}

.quote-mark {
  font-family: serif;
  font-size: 8rem;
  color: var(--primary-color);
  opacity: 0.15;
  position: absolute;
  line-height: 1;
}

.quote-mark.right-mark {
  top: 10px;
  right: 20px;
}

.quote-mark.left-mark {
  bottom: -50px;
  left: 20px;
}

.grand-quote-text {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.8;
  position: relative;
  z-index: 2;
  margin: 0;
}

@media (max-width: 768px) {
  .grand-quote-container {
    padding: 2rem;
  }
  .grand-quote-text {
    font-size: 1.4rem;
  }
  .quote-mark {
    font-size: 6rem;
  }
}

/* Thirteenth Section: Vision Grid */
.vision-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem auto 0;
  max-width: 800px;
}

.vision-card {
  background: linear-gradient(135deg, var(--primary-color), #0284c7);
  border-radius: 16px;
  padding: 1.5rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  box-shadow: 0 10px 25px rgba(1, 105, 181, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.vision-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 35px rgba(1, 105, 181, 0.3);
}

.vision-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vision-icon svg {
  width: 48px;
  height: 48px;
  stroke: #ffffff;
}

.vision-card p {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}

@media (max-width: 768px) {
  .vision-grid {
    grid-template-columns: 1fr;
  }
}

/* Fourteenth Section: Final Page */
.final-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.final-title {
  font-size: 3rem !important;
  color: var(--primary-color) !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.3 !important;
}

.final-subtitle {
  font-size: 1.8rem !important;
  color: var(--text-dark) !important;
  margin-bottom: 4rem !important;
}

.thank-you-container {
  display: inline-block;
  background: var(--primary-color);
  padding: 1.5rem 4rem;
  border-radius: 50px;
  box-shadow: 0 15px 35px rgba(1, 105, 181, 0.3);
  animation: float-thank-you 4s ease-in-out infinite;
}

.thank-you-text {
  font-size: 2.5rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
}

@keyframes float-thank-you {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@media (max-width: 768px) {
  .final-title {
    font-size: 2rem !important;
  }
  .final-subtitle {
    font-size: 1.4rem !important;
    margin-bottom: 2.5rem !important;
  }
  .thank-you-container {
    padding: 1rem 3rem;
  }
  .thank-you-text {
    font-size: 2rem;
  }
}

.text-section h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  color: #0f172a;
  white-space: nowrap;
  /* إجبار النص على البقاء في سطر واحد */
}

.text-section h2 {
  font-size: 1.4rem;
  color: var(--primary-color);
  margin-bottom: 3rem;
}

.text-section p.description {
  font-size: 1.25rem;
  color: var(--text-dark);
  background-color: rgba(255, 255, 255, 0.6);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  max-width: 90%;
  font-weight: 600;
  animation: float 4s ease-in-out infinite;
  /* تأثير الطفو */
}

.footer-badge {
  margin-top: 2rem;
  background-color: rgba(255, 255, 255, 0.6);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  display: inline-block;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  max-width: 90%;
  animation: float 5s ease-in-out infinite 0.5s;
}

.footer-badge p.title {
  font-weight: 800;
  font-size: 1.1rem;
}

.footer-badge p.subtitle {
  color: var(--text-light);
  font-size: 1rem;
  margin-top: 0.25rem;
  font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0);
  }
}

/* Responsive */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-color);
  width: 32px;
  height: 32px;
}

@media (max-width: 992px) {
  .text-section {
    width: 60%;
    max-width: 100%;
  }

  .text-section h1 {
    font-size: 2.8rem;
    white-space: normal !important;
    /* Allow wrap on smaller screens */
  }

  .content-overlay {
    padding: 0 2rem;
  }
}

/* --- Third Section: Diagram --- */
.third-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 2rem 2rem 2rem;
  background-color: var(--bg-color);
  min-height: 100vh;
}

.diagram-wrapper {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.diagram-quote {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 2rem;
  max-width: 800px;
  line-height: 1.6;
}

.diagram-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 400px;
  width: 100%;
  position: relative;
  min-height: 600px;
}

.diagram-box {
  background-color: #4371a5;
  color: white;
  border-radius: 12px;
  padding: 2.5rem 2rem 2rem 2rem;
  width: 280px;
  min-height: 250px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.box-right {
  border-radius: 12px;
  padding-left: 4.5rem;
  /* Leave space for circle overlap on left */
  padding-right: 2rem;
}

.box-left {
  border-radius: 12px;
  padding-right: 4.5rem;
  /* Leave space for circle overlap on right */
  padding-left: 2rem;
}

.box-number {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.2rem;
  color: white;
}

.diagram-box h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 800;
}

.diagram-box ul {
  list-style-type: disc;
  padding-right: 1.5rem;
}

.diagram-box ul li {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Circles */
.diagram-circles {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  /* Above the boxes */
  width: 550px;
  height: 550px;
}

.circle {
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}

.circle-title {
  position: absolute;
  top: 35px;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 20;
}

.circle-number {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: -2px;
}

/* Outer Circle (02) */
.circle-outer {
  width: 550px;
  height: 550px;
  background-color: #3b7b4d;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.circle-outer .circle-title {
  top: 15px;
}

.circle-outer .circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 75px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: -15px;
  margin-left: -37.5px;
}

/* Positioning Outer Texts (Radius = 230px) */
.text-outer-1 {
  transform: rotate(330deg) translate(230px) rotate(-330deg);
}

.text-outer-2 {
  transform: rotate(30deg) translate(230px) rotate(-30deg);
}

.text-outer-3 {
  transform: rotate(90deg) translate(230px) rotate(-90deg);
}

.text-outer-4 {
  transform: rotate(150deg) translate(230px) rotate(-150deg);
}

.text-outer-5 {
  transform: rotate(210deg) translate(230px) rotate(-210deg);
}

/* Middle Circle (03) */
.circle-middle {
  width: 380px;
  height: 380px;
  background-color: #4371a5;
  border: 4px solid white;
}

.circle-middle .circle-title {
  top: 10px;
}

.circle-middle .circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: -15px;
  margin-left: -40px;
}

/* Positioning Middle Texts (Radius = 145px) */
.text-middle-1 {
  transform: rotate(0deg) translate(145px) rotate(0deg);
}

.text-middle-2 {
  transform: rotate(315deg) translate(145px) rotate(-315deg);
}

.text-middle-3 {
  transform: rotate(45deg) translate(145px) rotate(-45deg);
}

.text-middle-4 {
  transform: rotate(90deg) translate(145px) rotate(-90deg);
}

.text-middle-5 {
  transform: rotate(135deg) translate(145px) rotate(-135deg);
}

.text-middle-6 {
  transform: rotate(180deg) translate(145px) rotate(-180deg);
}

.text-middle-7 {
  transform: rotate(225deg) translate(145px) rotate(-225deg);
}

.text-middle-8 {
  transform: rotate(270deg) translate(115px) rotate(-270deg);
}

/* Moved inward to avoid title */

/* Divider Lines */
.divider-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1.5px;
  height: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  transform-origin: bottom center;
  z-index: 0;
}

/* Inner Circle */
.circle-inner {
  width: 200px;
  height: 200px;
  background-color: #3b7b4d;
  border: 4px solid white;
  z-index: 5;
}

.inner-content h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.inner-content p {
  font-size: 0.7rem;
  line-height: 1.4;
  font-weight: 600;
}

/* Ensure Diagram fits on a single page for smaller laptop screens */
@media (max-height: 850px) and (min-width: 769px) {
  .third-section {
    padding-top: 100px !important;
    padding-bottom: 1rem !important;
  }
  .diagram-quote {
    margin-bottom: 1rem !important;
  }
  .diagram-container {
    transform: scale(0.8);
    transform-origin: top center;
    margin-bottom: -120px; /* Compensate for scaled empty space (600 * 0.2) */
  }
}

@media (max-height: 700px) and (min-width: 769px) {
  .diagram-container {
    transform: scale(0.7);
    margin-bottom: -180px; /* Compensate for scaled empty space (600 * 0.3) */
  }
}

@media (max-width: 768px) {
  body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  header {
    padding: 1rem 1.5rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }

  .header-right {
    display: flex !important;
  }

  .header-logo {
    height: 30px !important;
    /* Smaller logo on mobile */
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    /* Space between mobile menu and globe */
  }

  .desktop-nav {
    display: none !important;
  }

  .mobile-menu-btn {
    display: block !important;
  }

  .mobile-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
    z-index: 99;
  }

  .mobile-nav.active {
    display: flex !important;
  }

  .mobile-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    text-align: right;
    transition: color 0.3s, background-color 0.3s;
  }

  .mobile-nav a:hover {
    color: var(--primary-color);
    background-color: #f1f5f9;
  }

  /* Text container on the right side */
  .content-overlay {
    padding: 1rem !important;
    padding-top: 90px !important;
    align-items: flex-start !important;
    text-align: right !important;
    flex-direction: column !important;
  }

  .text-section {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 2rem !important;
    align-items: flex-start !important;
    padding-bottom: 2rem !important;
  }

  .text-section h1 {
    font-size: 1.5rem !important;
    text-align: right !important;
    white-space: normal !important;
    /* Allow wrap on mobile */
  }

  .text-section h2 {
    font-size: 1.1rem !important;
    text-align: right !important;
    margin-bottom: 1rem !important;
  }

  .text-section p.description {
    font-size: 0.85rem !important;
    max-width: 100% !important;
    text-align: right !important;
    padding: 0.75rem !important;
    white-space: normal !important;
  }

  .footer-badge {
    margin-top: 1.5rem !important;
    border-right: none !important;
    border-top: none !important;
    padding: 0.75rem !important;
    border-radius: 12px !important;
    text-align: right !important;
    width: 100% !important;
  }

  .footer-badge p.title {
    font-size: 0.9rem !important;
  }

  .footer-badge p.subtitle {
    font-size: 0.8rem !important;
  }

  /* Start 3D container below mobile header */
  .spline-container {
    top: 65px !important;
    height: calc(100vh - 65px) !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    left: 0 !important;
    position: absolute !important;
  }

  /* Position robot small and on the left */
  spline-viewer {
    width: 250vw !important;
    /* Wide canvas to zoom out the camera */
    left: -110vw !important;
    /* Push it left so the center is around 15-25% of the screen */
    height: calc(100% + 120px) !important;
    top: 0 !important;
  }

  /* Third Section Mobile */
  .third-section {
    padding: 100px 1.5rem 3rem 1.5rem !important;
  }

  .diagram-container {
    flex-direction: column !important;
    gap: 2rem !important;
  }

  .diagram-circles {
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    margin: 1rem 0 2rem 0 !important;
    width: 100% !important;
    height: 380px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  /* Scale down the circles drastically to fit mobile width, but adjust internal text to remain readable */
  .circle-outer {
    transform: translate(-50%, -50%) scale(0.62) !important;
  }

  /* Minor compensation for 0.62 scale */
  .circle-outer .circle-title,
  .circle-middle .circle-title {
    font-size: 1rem !important;
  }

  .circle-number {
    font-size: 1.6rem !important;
  }

  .circle-outer .circle-text,
  .circle-middle .circle-text {
    font-size: 0.8rem !important;
    width: 90px !important;
    margin-left: -45px !important;
    line-height: 1.2 !important;
  }

  .inner-content h4 {
    font-size: 1.15rem !important;
    margin-bottom: 0.4rem !important;
  }

  .inner-content p {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
  }

  .diagram-box {
    width: 100% !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    min-height: auto !important;
  }

  .sixth-section .image-section {
    width: 100% !important;
    margin-top: 2rem !important;
  }

  .transform-items {
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    width: 100%;
    justify-content: space-between;
  }

  .transform-col {
    flex: 1;
    gap: 0.5rem !important;
  }

  .transform-item {
    padding: 0.5rem !important;
    font-size: 0.85rem !important;
    width: 100%;
    text-align: center;
  }
}