/* 
 * HSuez Logistics
 * Corporate CSS Architecture
 * Aesthetic: Industrial utilitarian meets premium corporate
 * Variables & Base Setup 
 */

:root {
  /* Light Theme Color System (Default) */
  --color-primary: #0A192F;
  /* Deep Marine Blue - Corporate Trust */
  --color-primary-light: #112240;
  /* Slightly lighter shade for cards */
  --color-primary-dark: #020c1b;
  /* Darker shade for depth */

  --color-accent: #FF6B00;
  /* Safety/Industrial Orange - Action/Highlight */
  --color-accent-hover: #E65C00;

  --color-text-main: #1E293B;
  /* Slate 800 - High contrast readable text */
  --color-text-muted: #475569;
  /* Slate 600 - Secondary text */
  --color-text-light: #F8FAFC;
  /* Slate 50 - Text on dark backgrounds */

  --color-bg-white: #FFFFFF;
  --color-bg-light: #F8FAFC;
  /* Slate 50 */
  --color-bg-alt: #F1F5F9;
  /* Slate 100 */
  --color-border: #E2E8F0;

  --color-whatsapp: #25D366;
  --color-whatsapp-hover: #1EBE5A;

  /* Typography */
  --font-heading: 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spatial & Sizing */
  --container-max-width: 1200px;
  --spacing-section: 6rem;
  --spacing-section-mobile: 4rem;

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-Index Scale */
  --z-below: -1;
  --z-normal: 1;
  --z-header: 40;
  --z-overlay: 50;
}

[data-theme="dark"] {
  /* Dark Theme Color System */
  --color-primary: #F8FAFC;
  /* headings become light */
  --color-primary-light: #1E293B;
  --color-primary-dark: #0f172a;

  --color-text-main: #E2E8F0;
  /* Slate 200 */
  --color-text-muted: #94A3B8;
  /* Slate 400 */
  --color-text-light: #FFFFFF;

  --color-bg-white: #0A192F;
  /* Dark Marine Blue as base bg */
  --color-bg-light: #112240;
  /* Slightly lighter for sections */
  --color-bg-alt: #020c1b;
  --color-border: #1E293B;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* =========================================
   Reset & Normalize
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-main);
  background-color: var(--color-bg-white);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Direction aware padding/margin for RTL */
html[dir="rtl"] {
  --font-heading: 'Cairo', system-ui, sans-serif;
  --font-body: 'Tajawal', system-ui, sans-serif;
}

.no-scroll-x {
  overflow-x: hidden;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.2s;
}

html[dir="rtl"] .skip-link {
  left: auto;
  right: 0;
}

.skip-link:focus {
  top: 0;
}

/* Accessible hidden element for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Visible focus states */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

ul {
  list-style: none;
}

/* =========================================
   Typography
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--color-text-light);
  /* Enforce readable heading in dark mode */
}

/* Special case for hero title which is on dark bg always */
.hero__title {
  color: #FFFFFF !important;
}

p {
  margin-bottom: 1rem;
}

/* =========================================
   Layout & Utility Classes
   ========================================= */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: var(--spacing-section) 0;
}

.bg-light {
  background-color: var(--color-bg-light);
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 2rem;
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =========================================
   Components (Buttons, Cards, Badges)
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.btn--primary {
  background-color: var(--color-accent);
  color: #FFFFFF;
}

.btn--primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background-color: transparent;
  border-color: #FFFFFF;
  color: #FFFFFF;
}

.btn--outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn--large {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

.btn--full {
  width: 100%;
}

.btn--whatsapp {
  background-color: var(--color-whatsapp);
  color: #FFFFFF;
  gap: 0.5rem;
}

.btn--whatsapp:hover {
  background-color: var(--color-whatsapp-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.badge--orange {
  background-color: rgba(255, 107, 0, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(255, 107, 0, 0.3);
}

.card {
  background: var(--color-bg-white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: var(--transition-smooth);
  height: 100%;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
  transform: translateY(-4px);
}

.card__icon {
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

/* =========================================
   Header & Navigation
   ========================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: var(--z-header);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .header {
  background-color: rgba(10, 25, 47, 0.95);
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
  /* Use padding inside container instead of header padding if jumping occurs */
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  transition: height 0.3s ease;
}

.header--scrolled .header__container {
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand__name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

/* Nav setup */
.nav,
.header__actions {
  display: none;
}

/* Contact Info Header snippet */
.header-contact {
  display: none;
}

@media (min-width: 1024px) {

  .nav,
  .header__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .header-contact {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-right: 1.5rem;
    text-align: right;
  }

  html[dir="rtl"] .header-contact {
    margin-right: 0;
    margin-left: 1.5rem;
    text-align: left;
  }

  .header-contact a {
    color: var(--color-text-main);
    font-weight: 600;
  }

  .header-contact a:hover {
    color: var(--color-accent);
  }

  .nav__list {
    display: flex;
    gap: 2rem;
  }

  .nav__link {
    font-weight: 500;
    color: var(--color-text-main);
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
  }

  .nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
  }

  html[dir="rtl"] .nav__link::after {
    left: auto;
    right: 0;
  }

  .nav__link:hover::after {
    width: 100%;
  }

  .mobile-toggle {
    display: none !important;
  }
}

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: none;
  color: var(--color-text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  background-color: var(--color-bg-light);
}

/* Dark mode icon swap */
.icon-moon {
  display: block;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0.5rem;
  z-index: 51;
}

.mobile-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-primary);
  transition: var(--transition-smooth);
}

.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar:nth-child(2) {
  opacity: 0;
}

.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Panel */
.mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--color-bg-white);
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  box-shadow: var(--shadow-md);
  visibility: hidden;
  /* Hide for accessibility when not open */
}

.mobile-nav[aria-hidden="false"] {
  max-height: 500px;
  visibility: visible;
}

.mobile-nav__list {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-nav__link {
  font-weight: 600;
  font-size: 1.1rem;
  display: block;
  padding: 0.5rem 0;
}

/* =========================================
   Sections
   ========================================= */

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background-color: #0A192F;
  color: #FFFFFF;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(10, 25, 47, 0.8), rgba(10, 25, 47, 0.95)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 20px, transparent 20px, transparent 40px);
  z-index: 0;
}

.hero__container {
  position: relative;
  z-index: 1;
}

.hero__content {
  max-width: 800px;
}

.hero__subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: #CBD5E1;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* About & Geo Summary */
.about__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 992px) {
  .about__container {
    grid-template-columns: 1.2fr 1fr;
    gap: 5rem;
  }
}

.section__desc {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.about .section__desc {
  margin-left: 0;
  margin-right: 0;
}

.geo-summary {
  background: var(--color-bg-light);
  border-left: 4px solid var(--color-accent);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 0 4px 4px 0;
  font-weight: 500;
  color: var(--color-text-main);
}

html[dir="rtl"] .geo-summary {
  border-left: none;
  border-right: 4px solid var(--color-accent);
  border-radius: 4px 0 0 4px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-list__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
}

.feature-list__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: rgba(255, 107, 0, 0.1);
  color: var(--color-accent);
  border-radius: 50%;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.about__visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stat-card {
  background: var(--color-bg-white);
  padding: 2.5rem 1.5rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .stat-card {
  background: var(--color-bg-light);
  /* To lift it from dark bg */
}

.stat-card--accent {
  background: #0A192F;
  /* Always dark blue */
  color: white;
  border: none;
  transform: translateY(20px);
}

[data-theme="dark"] .stat-card--accent {
  background: var(--color-bg-alt);
}

.stat-card__number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-card__label {
  font-weight: 600;
  font-size: 0.95rem;
}

.stat-card--accent .stat-card__label {
  color: #CBD5E1;
}

/* Coverage Area Grid */
.route-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .route-list {
    flex-direction: row;
    justify-content: center;
    gap: 4rem;
  }
}

.route-block {
  background: var(--color-bg-white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  min-width: 280px;
  border-top: 4px solid #0A192F;
}

[data-theme="dark"] .route-block {
  background: var(--color-bg-light);
  border-top-color: var(--color-border);
}

.route-block:last-child {
  border-top-color: var(--color-accent);
}

.route-block__title {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.route-list__items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.route-list__items li {
  padding-left: 1.5rem;
  position: relative;
  font-weight: 500;
  color: var(--color-text-muted);
}

html[dir="rtl"] .route-list__items li {
  padding-left: 0;
  padding-right: 1.5rem;
}

.route-list__items li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-accent);
}

html[dir="rtl"] .route-list__items li::before {
  left: auto;
  right: 0;
}

.route-arrow {
  display: none;
}

@media (min-width: 768px) {
  .route-arrow {
    display: block;
  }

  html[dir="rtl"] .route-arrow svg {
    transform: rotate(180deg);
  }
}

/* Advantages Grid */
.advantage-item {
  padding: 2rem;
  border-left: 2px solid var(--color-border);
  transition: var(--transition-smooth);
}

html[dir="rtl"] .advantage-item {
  border-left: none;
  border-right: 2px solid var(--color-border);
}

.advantage-item:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-white);
}

.advantage-item__title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

/* Process Timeline */
.process-timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 3rem;
  position: relative;
}

@media (min-width: 768px) {
  .process-timeline {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
}

.process-step {
  position: relative;
  padding: 2rem;
  background: var(--color-bg-white);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.process-step__number {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 800;
  color: var(--color-border);
  /* Updated for dark mode support */
  opacity: 0.3;
  position: absolute;
  top: -1px;
  right: 15px;
  line-height: 1;
}

html[dir="rtl"] .process-step__number {
  right: auto;
  left: 15px;
}

/* Testimonials */
.testimonial {
  background: var(--color-bg-white);
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.testimonial::before {
  content: '"';
  position: absolute;
  top: 10px;
  left: 20px;
  font-family: var(--font-heading);
  font-size: 4rem;
  color: var(--color-accent);
  opacity: 0.2;
  line-height: 1;
}

html[dir="rtl"] .testimonial::before {
  left: auto;
  right: 20px;
}

.testimonial__text {
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.testimonial__footer {
  display: flex;
  flex-direction: column;
}

.testimonial__footer strong {
  font-family: var(--font-heading);
  color: var(--color-primary);
}

.testimonial__footer span {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Contact */
.contact__container {
  display: grid;
  grid-template-columns: 1fr;
  text-align: center;
  max-width: 800px;
  background: var(--color-bg-light);
  padding: 4rem 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
  font-size: 1.25rem;
  font-weight: 600;
}

@media (min-width: 768px) {
  .contact-links {
    flex-direction: row;
    justify-content: center;
    gap: 3rem;
  }
}

.contact-links a {
  color: var(--color-text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.contact-links a:hover {
  color: var(--color-accent);
}

.contact-links svg {
  color: var(--color-accent);
}

/* Footer */
.footer {
  background-color: #0A192F;
  color: #F8FAFC;
  padding-top: 5rem;
}

.footer__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer__container {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.brand--footer .brand__name {
  color: #F8FAFC;
}

.footer__desc {
  margin-top: 1.5rem;
  color: #94A3B8;
  /* Slate 400 */
  max-width: 300px;
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer__title {
  color: #F8FAFC;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
}

.footer__list a,
.footer__list li {
  color: #CBD5E1;
}

.footer__list a:hover {
  color: var(--color-accent);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
}

.footer__bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #94A3B8;
}

@media (min-width: 768px) {
  .footer__bottom-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.credit a {
  color: #CBD5E1;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: var(--transition-smooth);
}

.credit a:hover {
  color: #FFFFFF;
  text-decoration-color: #FFFFFF;
}

/* =========================================
   Animations
   ========================================= */

@media (prefers-reduced-motion: no-preference) {
  .fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }

  .fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .delay-1 {
    transition-delay: 150ms;
  }

  .delay-2 {
    transition-delay: 300ms;
  }

  .delay-3 {
    transition-delay: 450ms;
  }
}