:root {
  /* Premium Colors */
  --saudi-green: #006C35;
  --saudi-green-light: #00A651;
  --saudi-green-dark: #004D26;
  --gold: #D4AF37;
  --gold-light: #F4E4A6;
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;

  /* Neutrals */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --white: #ffffff;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--saudi-green) 0%, var(--saudi-green-light) 100%);
  --gradient-gold: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(0, 108, 53, 0.15);

  /* Radii */
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  overflow-x: hidden;
  direction: rtl;
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
  color: var(--saudi-green-dark);
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 600;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

/* Layout & Spacing */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-spacing {
  padding: 6rem 0;
}

/* Premium Header & Nav */
header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem 0;
  position: relative;
  /* top: 0; Removed for non-sticky */
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

nav a {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  position: relative;
}

nav a:not(.btn-primary):hover {
  color: var(--saudi-green);
  background: rgba(0, 108, 53, 0.05);
}

nav a.active {
  color: var(--saudi-green);
  font-weight: 700;
}

/* Mobile Nav Toggle */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--saudi-green);
  z-index: 1001;
  padding: 0.5rem;
  line-height: 1;
}



@media (max-width: 768px) {
  .nav-wrapper {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .mobile-menu-btn {
    display: block !important;
  }

  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin: 1rem 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2000;
  }

  nav.active {
    display: flex !important;
    animation: slideDown 0.3s ease-out;
  }

  nav ul {
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 0.5rem;
  }

  nav li {
    width: 100%;
  }

  nav a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  nav a:hover {
    background: var(--gray-50);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Improved Inputs */
.input-wrapper {
  background: #fff;
  border: 2px solid #E5E7EB;
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.input-wrapper:focus-within {
  border-color: var(--saudi-green);
  box-shadow: 0 0 0 4px rgba(0, 108, 53, 0.1);
  transform: translateY(-2px);
}

/* Feature Cards with more breathing room */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  margin-top: 4rem;
}

.feature-card {
  background: white;
  padding: 3rem 2rem;
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Premium Footer */
footer {
  margin-top: 8rem;
  padding-top: 6rem;
  padding-bottom: 4rem;
  background: linear-gradient(135deg, #022c14 0%, #004d26 50%, #006C35 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

/* Footer Background Decoration */
footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 20%);
  pointer-events: none;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  position: relative;
  z-index: 2;
  margin-bottom: 4rem;
}

.footer-col h3 {
  color: #fff !important;
  /* Force white */
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 0;
  width: 40px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  display: block;
}

.footer-col a:hover {
  color: var(--white);
  transform: translateX(-5px);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.footer-socials {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
  background: var(--gold);
  color: var(--gray-900);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

/* Mobile Footer */
@media (max-width: 900px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-col h3::after {
    right: 50%;
    transform: translateX(50%);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* Mobile Spacing & Layout Fixes */
@media (max-width: 768px) {

  html,
  body {
    overflow-x: hidden;
    width: 100%;
  }

  .section-spacing {
    padding: 3rem 0;
  }

  .container {
    padding: 0 1.25rem;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .features-grid {
    gap: 2rem;
    grid-template-columns: 1fr;
  }

  /* Fix Hero Overflow */
  h1 {
    font-size: 2rem;
    /* Reduce from 3rem */
  }

  .features-list {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .feature-pill {
    width: 100%;
    /* Stack pills on very small screens */
    justify-content: center;
  }
}

/* Button Styles */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 108, 53, 0.2), 0 2px 4px -1px rgba(0, 108, 53, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  /* For links */
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 15px -3px rgba(0, 108, 53, 0.3), 0 4px 6px -2px rgba(0, 108, 53, 0.15);
  color: white;
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Ripple Effect */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease-out, height 0.6s ease-out;
}

.btn-primary:active::after {
  width: 300px;
  height: 300px;
}

/* Processing State */
.btn-primary.processing {
  pointer-events: none;
  opacity: 0.8;
}

.btn-primary.processing::before {
  content: '';
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Comparison Tool Styles */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: flex-start;
  /* Align top for better label flow */
  margin-bottom: 2rem;
}

.job-col {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.job-col:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.job-col h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  color: var(--saudi-green);
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.75rem;
}

.vs-badge {
  background: var(--gradient-gold);
  color: var(--gray-900);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
  margin-top: 2rem;
  /* visually align with inputs */
  z-index: 2;
}

/* Comparison Inputs */
.job-col .input-wrapper {
  margin-bottom: 1rem;
}

.job-col input {
  width: 100%;
  padding: 1rem;
  border: none;
  outline: none;
  font-size: 1rem;
}

/* Winner Result Styling */
.winner-card {
  background: #F0FDF4;
  border: 1px solid var(--saudi-green);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .vs-badge {
    margin: -1rem auto;
    /* Overlap slightly */
    transform: rotate(90deg);
    /* Optional stylistic choice */
  }
}