/* ==========================================================================
   1. CSS VARIABLES
   ========================================================================== */
:root {
  --primary-color: #c4a052;
  --primary-hover: #a88c3d;
  --primary-dark: #b38d3a;
  --primary-light: #e9d18b;
  --primary-bg: #f0e6c9;
  --text-color: #1a1a1a;
  --text-secondary: #666;
  --text-dark: #333;
  --text-darker: #191818;
  --bg-light: #f9f9f9;
  --bg-white: #fff;
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-primary: 0 0 15px rgba(196, 160, 82, 0.7),
    0 0 30px rgba(196, 160, 82, 0.3);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 15px;
  --radius-round: 50%;
  --transition: all 0.3s ease;
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
         2. GLOBAL STYLES
         ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Cairo", "Tajawal", sans-serif;
}

html {
  scroll-behavior: smooth;
}

/* --- START: Consolidated Background Styling --- */
body,
.about,
.timeline,
.services,
.contact,
footer {
  background-image: url("../../img/background-new.svg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

body {
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  color: var(--text-dark);
  /* Apply fixed attachment specifically to body by default */
  background-attachment: fixed;
}
/* --- END: Consolidated Background Styling --- */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

a {
  text-decoration: none;
  color: var(--text-color);
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* Common Section Styling */
.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-size: 36px;
  color: var(--text-color);
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.section-header h2:after {
  content: "";
  position: absolute;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 18px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Common Button Styling */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: var(--bg-white);
  border-radius: var(--radius-sm);
  font-weight: bold;
  text-transform: uppercase;
  transition: var(--transition);
  font-size: 14px;
  max-width: 200px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.timeline-btn {
  padding: 15px 35px;
  font-size: 18px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-light)
  );
  color: var(--bg-white);
  border-radius: 50px;
  box-shadow: 0 10px 25px rgba(196, 160, 82, 0.4);
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.timeline-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 35px rgba(196, 160, 82, 0.6);
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary-light)
  );
}

.timeline-btn::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(196, 160, 82, 0.3) 0%,
    transparent 70%
  );
  top: -50%;
  left: -50%;
  transition: all 0.5s ease;
}

/* ==========================================================================
         3. ANIMATIONS
         ========================================================================== */
@keyframes section-glow {
  0% {
    box-shadow: 0 0 15px rgba(196, 160, 82, 0.5),
      0 0 30px rgba(196, 160, 82, 0.2);
  }
  100% {
    box-shadow: 0 0 20px rgba(196, 160, 82, 0.7),
      0 0 40px rgba(196, 160, 82, 0.4);
  }
}

@keyframes pulse-effect {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(196, 160, 82, 0.3),
      0 0 20px rgba(196, 160, 82, 0.6);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(196, 160, 82, 0.2),
      0 0 30px rgba(196, 160, 82, 0.7);
  }
}

@keyframes shine-effect {
  0% {
    opacity: 0.5;
    top: -50%;
    left: -50%;
  }
  100% {
    opacity: 0;
    top: 100%;
    left: 100%;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes border-glow {
  0% {
    opacity: 0.5;
    box-shadow: 0 0 10px rgba(196, 160, 82, 0.3);
  }
  100% {
    opacity: 0.8;
    box-shadow: 0 0 20px rgba(196, 160, 82, 0.6);
  }
}

@keyframes hero-glow {
  0% {
    opacity: 0.5;
    transform: scale(1);
  }
  100% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes shine {
  0% {
    opacity: 0.5;
    top: -50%;
    left: -50%;
  }
  100% {
    opacity: 0;
    top: 100%;
    left: 100%;
  }
}

@keyframes timeline-glow {
  0% {
    box-shadow: 0 0 15px rgba(196, 160, 82, 0.5),
      0 0 30px rgba(196, 160, 82, 0.2);
  }
  100% {
    box-shadow: 0 0 20px rgba(196, 160, 82, 0.7),
      0 0 40px rgba(196, 160, 82, 0.4);
  }
}

/* ==========================================================================
         4. HEADER & NAVIGATION
         ========================================================================== */
header {
  background-color: var(--bg-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 10px 0;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 90px;
}

nav .menu {
  display: flex;
}

nav .menu li {
  margin-right: 20px;
}

nav .menu li:last-child {
  margin-right: 0;
}

nav .menu li a {
  font-weight: 600;
  padding: 10px 15px;
  position: relative;
}

nav .menu li a:after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  bottom: 0;
  left: 0;
  transition: width 0.3s ease;
}

nav .menu li a:hover:after,
nav .menu li a.active:after {
  width: 100%;
}

.menu-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

/* ==========================================================================
         5. HERO SECTION
         ========================================================================== */
.hero {
  height: 100vh;
  /* NOTE: Hero keeps its specific gradient + image background */
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url("../../img/hero-bg.jpg") no-repeat center center/cover;
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--bg-white);
  padding-top: 80px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(196, 160, 82, 0.3) 0%,
    transparent 70%
  );
  animation: hero-glow 5s infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
  box-shadow: var(--shadow-primary);
  animation: section-glow 3s infinite alternate;
}

.hero-content {
  position: relative;
  z-index: 2;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(196, 160, 82, 0.3);
  backdrop-filter: blur(5px);
  max-width: 800px;
  margin: 0 auto;
}

.hero-content::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(196, 160, 82, 0.3),
    transparent
  );
  z-index: -1;
  border-radius: 17px;
  animation: border-glow 3s infinite alternate;
}

.hero-content h1 {
  font-size: 48px;
  margin-bottom: 20px;
  animation: fadeInDown 1s ease;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}

.hero-content h2 {
  font-size: 36px;
  margin-bottom: 20px;
  color: var(--primary-color);
  animation: fadeInUp 1s ease 0.2s;
  animation-fill-mode: both;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.hero-content p {
  font-size: 20px;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 1s ease 0.4s;
  animation-fill-mode: both;
  line-height: 1.8;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.hero-content .btn {
  animation: fadeInUp 1s ease 0.6s;
  animation-fill-mode: both;
  padding: 12px 25px;
  font-size: 16px;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 250px;
  margin: 0 auto;
}

.hero-content .btn::after {
  content: "\f3c5";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-right: 8px;
  font-size: 14px;
}

.hero-content .btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  background-color: var(--primary-dark);
}

.hero-content .btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.6s ease;
}

.hero-content .btn:hover::before {
  left: 100%;
}

.timeline-btn:hover::after {
  top: -50%;
  left: -50%;
  animation: shine 1.5s infinite;
}

/* ==========================================================================
       6. ABOUT SECTION
       ========================================================================== */
.about {
  padding: 100px 0;
  position: relative;
  overflow: hidden;
  /* background rule is now consolidated */
}

.about::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 5px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
  bottom: 0;
  left: 0;
  box-shadow: var(--shadow-primary);
  animation: section-glow 3s infinite alternate;
}

.about-content {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}

.about-text {
  flex: 1;
  width: 100%;
  padding: 30px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(196, 160, 82, 0.1);
  transition: var(--transition);
  max-width: 1000px;
  margin: 0 auto;
}

.about-text:hover {
  box-shadow: 0 15px 40px rgba(196, 160, 82, 0.15);
  border-color: rgba(196, 160, 82, 0.3);
}

.about-text h3 {
  font-size: 28px;
  margin-bottom: 20px;
  color: var(--text-color);
}

.about-text p {
  line-height: 1.7;
  margin-bottom: 20px;
  font-size: 17px;
  color: var(--text-dark);
  text-align: justify;
}

.about-text p:first-of-type {
  font-size: 16px;
  color: var(--text-darker);
  font-weight: 400;
  border-right: 3px solid var(--primary-color);
  padding-right: 15px;
  margin-bottom: 25px;
}

.about-text p:hover {
  color: #222;
}

.about-text strong {
  color: var(--primary-color);
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding: 0 2px;
}

.about-text strong::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
  bottom: -2px;
  left: 0;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.about-text strong:hover::after {
  transform: scaleX(1);
}

.about-text strong:hover {
  color: var(--primary-dark);
  text-shadow: 0 0 2px rgba(196, 160, 82, 0.4);
  transform: translateY(-2px);
  transition: var(--transition);
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 3px;
}

.about-features {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 30px;
}

/* Common feature card styling */
.feature,
.service-card {
  flex: 1;
  min-width: 200px;
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #ffffff, #f5f5f5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08),
    0 5px 15px rgba(196, 160, 82, 0.1);
  transition: var(--transition-bounce);
  border: 1px solid rgba(196, 160, 82, 0.2);
  backdrop-filter: blur(5px);
  opacity: 0;
  transform: translateY(30px);
}

.feature.animated,
.service-card.animated {
  opacity: 1;
  transform: translateY(0);
}

.feature:hover,
.service-card:hover {
  transform: translateY(-15px);
  box-shadow: 0 20px 40px rgba(196, 160, 82, 0.25),
    0 15px 20px rgba(0, 0, 0, 0.1);
  border-color: rgba(196, 160, 82, 0.6);
  background: linear-gradient(145deg, #ffffff, #f8f8f8);
}

/* Common icon styling */
.feature i,
.service-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(145deg, #f0e6c9, #f8f2e0);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 20px rgba(196, 160, 82, 0.25),
    0 0 0 8px rgba(255, 255, 255, 0.6);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature i {
  font-size: 30px;
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(196, 160, 82, 0.3);
}

.service-icon i {
  font-size: 36px;
  color: var(--primary-color);
}

.feature i::after,
.service-icon::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  top: -50%;
  left: -50%;
  transition: all 0.5s ease;
}

.feature:hover i,
.service-card:hover .service-icon {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(196, 160, 82, 0.4),
    0 0 0 10px rgba(255, 255, 255, 0.8);
  color: var(--primary-dark);
}

.service-card:hover .service-icon {
  animation: pulse-effect 2s infinite;
}

.feature:hover i::after,
.service-card:hover .service-icon::after {
  top: 0;
  left: 0;
  animation: shine-effect 1.5s infinite;
}

/* Common heading styling for features and services */
.feature h4,
.service-card h3 {
  position: relative;
  padding-bottom: 15px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
  color: var(--text-color);
}

.feature h4 {
  font-size: 18px;
  margin-bottom: 10px;
}

.service-card h3 {
  font-size: 22px;
}

.feature h4::after,
.service-card h3::after {
  content: "";
  position: absolute;
  width: 50px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 4px rgba(196, 160, 82, 0.3);
}

.feature p {
  font-size: 14px;
  color: var(--text-secondary);
}

.service-card p {
  color: var(--text-darker);
}
/* ==========================================================================
       7. TIMELINE SECTION
       ========================================================================== */
.timeline {
  padding: 100px 0;
  position: relative;
  overflow: hidden;
  /* background rule is now consolidated */
}

.timeline-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
  min-height: 800px;
}

.timeline-container::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    var(--primary-color),
    var(--primary-light),
    var(--primary-color)
  );
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  border-radius: 4px;
  box-shadow: var(--shadow-primary);
  clip-path: polygon(0 0, 100% 0, 100% 95%, 0 95%);
  animation: timeline-glow 3s infinite alternate;
}

.timeline-items {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.timeline-item {
  background: linear-gradient(145deg, #ffffff, #f5f5f5);
  border-radius: 20px;
  width: 30%;
  padding: 20px 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08),
    0 5px 15px rgba(196, 160, 82, 0.1);
  text-align: center;
  transition: var(--transition-bounce);
  position: relative;
  border: 1px solid rgba(196, 160, 82, 0.2);
  opacity: 1;
  transform: translateY(0);
  backdrop-filter: blur(5px);
  margin-bottom: 60px;
}

.timeline-item:nth-child(odd) {
  margin-left: auto;
  margin-right: 200px;
}

.timeline-item:nth-child(even) {
  margin-right: auto;
  margin-left: 200px;
}

.timeline-item:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(196, 160, 82, 0.25),
    0 15px 20px rgba(0, 0, 0, 0.1);
  border-color: rgba(196, 160, 82, 0.6);
  background: linear-gradient(145deg, #ffffff, #f8f8f8);
}

.timeline-item::before {
  content: attr(data-number);
  position: absolute;
  width: 28px;
  height: 28px;
  background: radial-gradient(
    circle,
    var(--primary-light),
    var(--primary-color)
  );
  border-radius: var(--radius-round);
  z-index: 3;
  box-shadow: 0 0 0 6px rgba(196, 160, 82, 0.3),
    0 0 20px rgba(196, 160, 82, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: var(--bg-white);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.timeline-item:nth-child(odd)::before {
  top: 50%;
  left: 0;
  transform: translateY(-50%) translateX(-50%);
  margin-left: 0;
}

.timeline-item:nth-child(even)::before {
  top: 50%;
  right: 0;
  transform: translateY(-50%) translateX(50%);
}

.timeline-item::after {
  content: "";
  position: absolute;
  width: 35px;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--primary-color),
    rgba(196, 160, 82, 0.5)
  );
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.timeline-item:nth-child(odd)::after {
  left: -14px;
  width: 28px;
  right: auto;
  background: linear-gradient(
    to left,
    var(--primary-color),
    rgba(196, 160, 82, 0.5)
  );
}

.timeline-item:nth-child(even)::after {
  right: -14px;
  width: 28px;
  left: auto;
  background: linear-gradient(
    to right,
    var(--primary-color),
    rgba(196, 160, 82, 0.5)
  );
}

.timeline-item .item-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(145deg, #f0e6c9, #f8f2e0);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  box-shadow: 0 8px 20px rgba(196, 160, 82, 0.25),
    0 0 0 8px rgba(255, 255, 255, 0.6);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.timeline-item .item-icon i {
  font-size: 36px;
  color: var(--primary-color);
  transition: var(--transition);
  text-shadow: 0 0 10px rgba(196, 160, 82, 0.3);
  z-index: 2;
}

.timeline-item .item-icon::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  top: -50%;
  left: -50%;
  transition: all 0.5s ease;
}

.timeline-item h3 {
  font-size: 20px;
  margin-bottom: 15px;
  color: var(--text-color);
  font-weight: 700;
  position: relative;
  padding-bottom: 12px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.timeline-item h3::after {
  content: "";
  position: absolute;
  width: 50px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 4px rgba(196, 160, 82, 0.3);
}

.timeline-item p {
  font-size: 15px;
  color: var(--text-darker);
  line-height: 1.6;
  margin-bottom: 0;
}

.timeline-item:hover .item-icon {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(196, 160, 82, 0.4),
    0 0 0 10px rgba(255, 255, 255, 0.8);
}

.timeline-item:hover .item-icon::after {
  top: 0;
  left: 0;
  animation: shine 1.5s infinite;
}

.timeline-item:hover .item-icon i {
  transform: scale(1.2);
  color: var(--primary-dark);
}

.timeline-item:hover::before {
  box-shadow: 0 0 0 8px rgba(196, 160, 82, 0.3),
    0 0 30px rgba(196, 160, 82, 0.7);
}

.timeline-cta {
  text-align: center;
  margin-top: 50px;
  position: relative;
  z-index: 5;
}

/* ==========================================================================
     8. SERVICES SECTION
     ========================================================================== */
.services {
  padding: 100px 0;
  position: relative;
  overflow: hidden;
  /* background rule is now consolidated */
}

.services::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 5px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
  top: 0;
  left: 0;
  box-shadow: var(--shadow-primary);
  animation: section-glow 3s infinite alternate;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

/* ==========================================================================
     9. CONTACT SECTION
     ========================================================================== */
.contact {
  padding: 100px 0;
  /* background rule is now consolidated */
}

.contact-content {
  display: flex;
  flex-wrap: wrap;
  margin-top: 40px;
}

.contact-info {
  flex: 1;
  background: linear-gradient(145deg, #f8f8f8, #ffffff);
  padding: 30px;
  border-radius: var(--radius-md);
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(196, 160, 82, 0.2);
  max-width: 800px;
  margin: 0 auto;
}

.contact-info p {
  margin-bottom: 30px;
  color: var(--text-secondary);
}

.contact-details {
  margin-bottom: 50px;
}

.contact-details .detail {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.detail i {
  width: 40px;
  height: 40px;
  background-color: var(--primary-bg);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  margin-right: 15px; /* Use margin-right for RTL */
}

.detail span {
  color: var(--text-secondary);
  margin-right: 10px; /* Use margin-right for RTL */
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-links a {
  width: 40px;
  height: 40px;
  background-color: var(--primary-bg);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--primary-color);
  color: var(--bg-white);
  transform: translateY(-5px);
}

.detail a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
  border-radius: 5px;
}

.detail a:hover {
  background-color: var(--primary-color);
  color: var(--bg-white);
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
     10. FOOTER
     ========================================================================== */
footer {
  color: var(--bg-white);
  padding: 30px 0;
  /* background rule is now consolidated */
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  color: #aaa;
}
/* ==========================================================================
       11. MEDIA QUERIES
       ========================================================================== */
@media screen and (max-width: 992px) {
  .hero-content h1 {
    font-size: 36px;
  }

  .hero-content h2 {
    font-size: 28px;
  }

  .about-content,
  .contact-content {
    flex-direction: column;
  }

  .about-image {
    margin-bottom: 30px;
  }

  .services-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .feature,
  .service-card {
    margin-bottom: 30px;
    width: 45%; /* Reverted as per original, adjust if needed */
  }

  .about-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* Reverted as per original */
  }

  .services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .timeline-item {
    width: 38%;
    margin-bottom: 50px;
    padding: 20px 15px;
  }

  .timeline-item:nth-child(odd) {
    margin-left: auto;
    margin-right: 100px;
  }

  .timeline-item:nth-child(even) {
    margin-right: auto;
    margin-left: 100px;
  }

  .timeline-item .item-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
  }

  .timeline-item .item-icon i {
    font-size: 30px;
  }
}

@media screen and (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav .menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background-color: var(--bg-white);
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    display: none;
  }

  nav .menu.active {
    display: flex;
  }

  nav .menu li {
    margin: 10px 0;
  }

  .hero-content h1 {
    font-size: 28px !important;
    margin-bottom: 10px !important;
  }

  .hero-content h2 {
    font-size: 22px !important;
    margin-bottom: 10px !important;
  }

  .hero-content p {
    font-size: 16px !important;
    margin-bottom: 20px !important;
    line-height: 1.5 !important;
  }

  .about-features {
    flex-direction: column;
  }

  .feature {
    margin-bottom: 20px;
    width: 100%; /* Ensure full width when stacked */
  }

  .footer-content {
    flex-direction: column;
  }

  .feature,
  .service-card {
    width: 100%;
    margin: 0 auto 30px;
    padding: 20px 15px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .about-text {
    padding: 20px 15px;
  }

  .about-text p {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 20px;
  }

  .timeline-container {
    min-height: auto;
  }

  .timeline-container::after {
    left: 20px; /* Adjust for RTL if needed */
    transform: none;
  }

  .timeline-item {
    width: 70%;
    margin-left: 60px !important; /* Adjust for RTL */
    margin-right: 0 !important;
    margin-bottom: 50px;
  }

  .timeline-item:nth-child(odd)::before,
  .timeline-item:nth-child(even)::before {
    /* This positioning is for LTR timeline based on the image. Needs review for RTL if appearance is wrong */
    left: -40px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  .timeline-item:nth-child(odd)::after,
  .timeline-item:nth-child(even)::after {
    /* This positioning is for LTR timeline based on the image. Needs review for RTL if appearance is wrong */
    left: -25px;
    right: auto;
    width: 25px;
    background: linear-gradient(
      to left,
      /* Adjust gradient direction if needed for RTL */ var(--primary-color),
      rgba(196, 160, 82, 0.5)
    );
  }

  /* Apply scroll attachment to all relevant elements in this breakpoint */
  body,
  .services,
  .about,
  .timeline,
  .contact,
  footer {
    background-attachment: scroll;
  }

  .timeline-btn {
    padding: 12px 30px;
    font-size: 16px;
  }
}

@media screen and (max-width: 576px) {
  .timeline-container::after {
    /* Adjust for RTL if needed */
    left: 20px !important;
    transform: none !important;
    width: 6px !important;
  }

  .timeline-item {
    width: calc(100% - 70px) !important;
    /* Adjust for RTL */
    margin-left: 60px !important;
    margin-right: 0 !important;
    margin-bottom: 40px !important;
    padding: 15px !important;
  }

  .timeline-item:nth-child(odd)::before,
  .timeline-item:nth-child(even)::before {
    /* This positioning is for LTR timeline based on the image. Needs review for RTL if appearance is wrong */
    left: -40px !important;
    right: auto !important;
    top: 20px !important; /* Keep vertical position */
    transform: translateY(0) !important;
  }

  .timeline-item:nth-child(odd)::after,
  .timeline-item:nth-child(even)::after {
    /* This positioning is for LTR timeline based on the image. Needs review for RTL if appearance is wrong */
    left: -20px !important;
    right: auto !important;
    width: 20px !important;
    height: 2px !important;
    top: 20px !important; /* Align vertically with the ::before element */
    transform: translateY(13px) !important; /* Adjust to center on the line */
  }

  .hero-content {
    padding: 25px !important;
    max-width: 90% !important;
  }

  .hero-content h1 {
    font-size: 24px !important;
  }

  .hero-content h2 {
    font-size: 18px !important;
  }

  .hero-content p {
    font-size: 14px !important;
  }

  .hero-content .btn {
    padding: 8px 16px !important;
    font-size: 14px !important;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .contact-info {
    padding: 15px 10px;
    width: 100%;
    margin: 0 auto;
  }

  .contact-details .detail {
    padding: 10px;
    margin-bottom: 10px;
  }

  .social-links {
    margin-top: 15px;
  }

  .social-links a {
    width: 40px;
    height: 40px;
    margin: 0 5px;
  }

  .feature,
  .service-card {
    width: 100%;
    margin: 0 auto 25px;
    padding: 15px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05),
      0 3px 10px rgba(196, 160, 82, 0.1);
  }

  .feature i,
  .service-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
    margin-bottom: 15px;
  }

  .feature h4,
  .service-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .feature p,
  .service-card p {
    font-size: 16px; /* Was 14px, reverted to original */
    line-height: 1.5;
  }

  .timeline {
    padding: 70px 0;
  }

  .timeline-container {
    padding: 10px 0;
  }

  .timeline-container::after {
    left: 15px; /* Adjust for RTL if needed */
    width: 6px;
  }

  .timeline-item {
    width: calc(100% - 60px);
    margin-left: 50px !important; /* Adjust for RTL */
    padding: 15px 10px;
    margin-bottom: 40px;
  }

  .timeline-item:nth-child(odd)::before,
  .timeline-item:nth-child(even)::before {
    width: 24px;
    height: 24px;
    font-size: 14px;
    left: -35px; /* Adjust for RTL */
  }

  .timeline-item:nth-child(odd)::after,
  .timeline-item:nth-child(even)::after {
    left: -20px; /* Adjust for RTL */
    width: 20px;
    height: 2px;
    top: 20px !important; /* Align vertically with the ::before element */
    transform: translateY(11px) !important; /* Adjust to center on the line */
  }

  .timeline-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .timeline-item p {
    font-size: 14px;
    line-height: 1.5;
  }

  .timeline-item .item-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
  }

  .timeline-item .item-icon i {
    font-size: 24px;
  }

  .timeline-btn {
    padding: 10px 25px;
    font-size: 14px;
  }
}

/* --- iOS/Safari Fix --- */
@media not all and (min-resolution: 0.001dpcm), (-webkit-touch-callout: none) {
  @supports (-webkit-appearance: none) {
    /* Apply scroll attachment to all relevant elements here too */
    body,
    .services,
    .about,
    .timeline,
    .contact,
    footer {
      background-attachment: scroll;
    }
  }
}
