/* REDESIGN SYSTEM - FIT-Entreprises */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap");

:root {
  /* Brand Palette - FIT Premium */
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-glow: rgba(249, 115, 22, 0.3);

  --secondary: #5d4037;
  --secondary-dark: #3e2723;
  --secondary-light: #8d6e63;

  /* Light Theme (Warmer, Premium) */
  --bg-light: #fdfcfb;
  --surface-light: #ffffff;
  --surface-light-soft: #f5f3f1;
  --text-main: #1c1917;
  --text-muted: #4b5563; /* Darker for better contrast */
  --text-soft: #71717a;
  --border-light: rgba(93, 64, 55, 0.1);

  /* Dark Theme (Deep Charcoal & Brown) */
  --bg-dark: #0f0e0d;
  --surface-dark: #1c1a19;
  --surface-dark-soft: #2a2726;
  --text-dark: #fafaf9;
  --text-dark-muted: #a1a1aa;
  --text-dark-soft: #71717a;
  --border-dark: rgba(255, 255, 255, 0.08);

  /* Shared UI Tokens */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --nav-height: 80px;
}

/* Base Styles */
body {
  font-family: "Montserrat", sans-serif;
  color: var(--text-main);
  background: var(--bg-light);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.font-display {
  font-family: "Montserrat", sans-serif;
}

/* Glassmorphism Classes */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
  background: rgba(30, 28, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.reveal {
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* === SCROLL PROGRESS BAR === */
#scroll-progress-container {
  position: fixed;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  z-index: 2147483647 !important; /* Max Z-Index */
  background: rgba(15, 14, 13, 0.9);
  padding: 0.1rem 1rem; /* Padding vertical réduit */
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(249, 115, 22, 0.3); /* Orange border visible */
  box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.8);
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

/* Hide scroll indicator when a modal is open */
body.modal-open #scroll-progress-container {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#scroll-progress-container:hover {
  transform: translateX(-50%) translateY(-2px);
  background: #0f0e0d;
  border-color: var(--primary);
  box-shadow: 0 15px 50px -5px rgba(249, 115, 22, 0.2);
}

.progress-label {
  color: var(--primary);
  font-family: "Inter", sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 0.5rem;
}

.progress-track {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-thumb {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 10px;
  transition: width 0.1s linear;
  box-shadow: 0 0 15px var(--primary);
}

@media (max-width: 640px) {
  #scroll-progress-container {
    bottom: 1.5rem;
    padding: 0.15rem 1.25rem;
    width: auto;
    max-width: 90%;
  }

  .progress-track {
    width: 120px;
  }
}

/* === SMOOTH SCROLL ANIMATIONS === */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Variations d'animations */
.scroll-fade-in {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.scroll-fade-in.visible {
  opacity: 1;
}

.scroll-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-scale-up {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-scale-up.visible {
  opacity: 1;
  transform: scale(1);
}

.scroll-rotate-in {
  opacity: 0;
  transform: rotate(-5deg) translateY(20px);
  transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-rotate-in.visible {
  opacity: 1;
  transform: rotate(0deg) translateY(0);
}

.scroll-blur-in {
  opacity: 0;
  filter: blur(5px);
  transform: translateY(20px);
  transition: all 0.8s ease-out;
}

.scroll-blur-in.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* Premium Card Style */
.premium-card {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

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

/* Button Refinement */
.btn-primary {
  background: #5d4037 !important;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
  background: #ea580c;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
}

/* Fix Input & Form Contrast - Enhanced */
input,
select,
textarea {
  background-color: var(--surface-light) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-light) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: var(--shadow-sm);
}

.dark input,
.dark select,
.dark textarea {
  background-color: var(--surface-dark-soft) !important;
  color: var(--text-dark) !important;
  border: 1px solid var(--border-dark) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px var(--primary-glow) !important;
  outline: none !important;
}

/* Visibility Fixes & Hero Support */
.hero-text-shadow {
  text-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, #fb923c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #fb923c;
  /* -webkit-text-fill-color: transparent; */
}

.dark-overlay-premium {
  background: radial-gradient(
    circle at center,
    rgba(30, 26, 25, 0.3) 0%,
    rgba(15, 14, 13, 0.6) 100%
  );
}

/* Hero Slider Animation */
.hero-slider-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: heroSlideAnim 18s linear infinite;
  background-size: cover;
  background-position: center;
}

.hero-slide:nth-child(1) {
  animation-delay: 0s;
}
.hero-slide:nth-child(2) {
  animation-delay: 6s;
}
.hero-slide:nth-child(3) {
  animation-delay: 12s;
}

@keyframes heroSlideAnim {
  0% {
    opacity: 0;
    transform: scale(1.1);
  }
  5% {
    opacity: 1;
  }
  33% {
    opacity: 1;
  }
  38% {
    opacity: 0;
    transform: scale(1);
  }
  100% {
    opacity: 0;
  }
}

.hero-title-clean {
  font-family: "Inter", sans-serif;
  letter-spacing: -0.02em;
  font-weight: 800;
}

/* Fix White on White & Semantic Colors */
.text-on-light {
  color: var(--text-main) !important;
}
.text-on-dark {
  color: var(--text-dark) !important;
}

.dark .text-muted {
  color: var(--text-dark-muted) !important;
}
.text-muted {
  color: var(--text-muted);
}

/* Navigation Overhaul Support */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Custom Scrollbar - Global Override */
::-webkit-scrollbar {
  width: 0px; /* Hide vertical scrollbar completely */
  height: 12px; /* Horizontal scrollbar height */
  background: transparent;
}

::-webkit-scrollbar-track {
  background-color: #1a1a1a; /* Dark track per photo */
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #f97316; /* Orange pill */
  border-radius: 10px;
  border: 3px solid #1a1a1a; /* Creates the floating pill effect */
}

::-webkit-scrollbar-thumb:hover {
  background-color: #ea580c; /* Darker orange on hover */
}

/* Horizontal Wrapper Specifics */
#horizontal-wrapper::-webkit-scrollbar {
  height: 14px;
  background-color: #121212;
}

#horizontal-wrapper::-webkit-scrollbar-track {
  background-color: #121212;
}

#horizontal-wrapper::-webkit-scrollbar-thumb {
  background-color: #fb923c;
  border: 4px solid #121212;
  border-radius: 10px;
}

.bg-bg-light {
  background: var(--bg-light);
}
.bg-bg-dark,
.bg-background-dark {
  background: var(--bg-dark);
}
.bg-surface-light {
  background: var(--surface-light);
}
.bg-surface-dark {
  background: var(--surface-dark);
}
.bg-secondary-dark {
  background: var(--secondary-dark);
}
.text-text-main {
  color: var(--text-main);
}
.text-text-muted {
  color: var(--text-muted);
}
.text-text-soft {
  color: var(--text-soft);
}
.text-text-dark {
  color: var(--text-dark);
}
.border-border {
  border-color: var(--border);
}

.bg-surface-2 {
  background: rgba(93, 64, 55, 0.03);
}
.dark .bg-surface-2 {
  background: rgba(255, 255, 255, 0.04);
}

.section-label {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.2);
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  text-transform: uppercase;
}
.dark .section-label {
  background: rgba(249, 115, 22, 0.1);
}

.vision-feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.vision-icon-box {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: rgba(249, 115, 22, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vision-card {
  position: relative;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}
.dark .vision-card {
  background: var(--surface-dark);
  border-color: rgba(255, 255, 255, 0.06);
}
.lovemark-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.65rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
}

.history-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .history-grid {
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
  }
}
.history-image-placeholder {
  background: linear-gradient(135deg, var(--secondary-dark), var(--secondary));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.value-card {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.value-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.dark .value-card {
  background: var(--surface-dark);
}

@keyframes pulseSlow {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.6;
  }
}
.animate-pulse-slow {
  animation: pulseSlow 4s ease-in-out infinite;
}

/* --- HORIZONTAL SCROLL SYSTEM (SPA FEEL) --- */

/* Base container setup */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* overflow: hidden;  <-- This can break some layouts if not careful, but needed for the pure horizontal feel. */
}

/* Wrapper */
#horizontal-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  height: 100vh;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  /* Disable snap and smooth behavior for JS control */
  /* scroll-behavior: smooth; */
  /* scroll-snap-type: x mandatory; */

  /* Hide scrollbar mostly for aesthetics */
  scrollbar-width: thin;
  -ms-overflow-style: none;
}

#horizontal-wrapper::-webkit-scrollbar {
  height: 6px;
  background-color: var(--bg-light);
}
#horizontal-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 4px;
}

/* Sections */
.horizontal-section {
  width: 100vw;
  height: 100vh;
  flex: 0 0 100vw; /* Prevent shrinking */
  /* scroll-snap-align: start; */ /* Disabled for fluid JS scroll */
  overflow-y: auto; /* Allow internal vertical scroll */
  position: relative;
}

/* Content spacing under fixed header */
.section-content {
  padding-top: 100px; /* Space for header */
  min-height: 100%;
  box-sizing: border-box;
  /* display: flex; flex-direction: column; justify-content: center; */ /* Optional centering */
}

/* Header Wrapper for Fixed Positioning */
.fixed-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Added subtle border for separation */
}

/* Dark mode override for the header background */
.dark .fixed-header-wrapper {
  background: var(--bg-dark); /* OR #000000 if you want strict inverse */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Scrolled State (Added via JS) */
.fixed-header-wrapper.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
}

.dark .fixed-header-wrapper.scrolled {
  background: rgba(20, 18, 17, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Navigation Links - Premium Hover */
.nav-link {
  position: relative;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  color: var(--text-main);
  transition: color 0.3s ease;
}

.dark .nav-link {
  color: var(--text-dark);
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  opacity: 1;
}

.nav-link.active {
  color: var(--primary);
}

/* Dropdown Menu - Glass Style */
.nav-dropdown {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  transform-origin: top center;
  animation: dropdownEmerge 0.2s ease-out forwards;
}

.dark .nav-dropdown {
  background: rgba(30, 28, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.5);
}

@keyframes dropdownEmerge {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dropdown Item */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  transition: all 0.2s ease;
  color: var(--text-main);
}
.dark .dropdown-item {
  color: var(--text-dark);
}

.dropdown-item:hover {
  background: rgba(249, 115, 22, 0.08); /* Primary color low opacity */
  padding-left: 20px; /* Slide effect */
}
.dropdown-item:hover span {
  color: var(--primary);
}

/* Logo Area */
.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}
.logo-box:hover {
  transform: rotate(5deg) scale(1.05);
}

/* Action Button in Header */
.header-cta {
  background: linear-gradient(135deg, var(--secondary) 0%, #3e2723 100%);
  color: white;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(93, 64, 55, 0.3);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(93, 64, 55, 0.4);
  background: linear-gradient(135deg, var(--primary) 0%, #ea580c 100%);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--text-muted);
}
.dark .theme-toggle-btn {
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-dark-muted);
}
.theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--primary);
  transform: rotate(15deg);
}
.dark .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* === PRELOADER / ENTRANCE ANIMATION === */
#preloader {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 100%;
  z-index: 99999;
  display: flex;
  pointer-events: none;
}

#preloader:before,
#preloader:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: -1;
  background-color: var(--bg-dark); /* Using theme dark bg for consistency */
  transition: all 0.3s ease 0s;
}

#preloader:after {
  left: auto;
  right: 0;
}

#preloader .line {
    margin: auto;
    width: 3px;
    height: 0; /* Start at 0 */
    position: relative;
    overflow: hidden;
    background-color: rgba(255,255,255,0.1);
}

/* The actual colored line inside */
#preloader .line:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    transform: translateY(-50%);
    background-color: var(--primary); /* Orange brand color */
    animation: lineGrow 1000ms ease-in-out 0s forwards;
}

/* Parent line container needs height */
#preloader .line {
    height: 250px;
    background: transparent;
}

@keyframes lineGrow {
    0% { height: 0; }
    100% { height: 100%; }
}

/* Animation to remove the curtains */
@keyframes openCurtain {
    0% { width: 50%; }
    100% { width: 0; }
}

/* Triggered class */
body.preloaded #preloader .line {
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.preloaded #preloader:before,
body.preloaded #preloader:after {
    animation: openCurtain 0.6s cubic-bezier(0.77, 0, 0.175, 1) 0.5s forwards;
}

/* The Container (Mask) */
.text-mask {
    display: block;
    overflow: hidden;
    position: relative;
}

/* Custom AOS Animation: Slide Up Full */
[data-aos="slide-up-full"] {
    transform: translateY(110%); /* Start fully below */
    opacity: 0;
    transition-property: transform, opacity;
}

[data-aos="slide-up-full"].aos-animate {
    transform: translateY(0);
    opacity: 1;
}

/* Image Reveal Curtain Effect */
.image-reveal-container {
    position: relative;
    overflow: hidden;
}

.image-reveal-container:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface-light); /* Or secondary color */
    transform: translateY(0);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 2;
}

.dark .image-reveal-container:after {
    background: var(--surface-dark);
}

/* When triggered by AOS */
.image-reveal-container.aos-animate:after {
    transform: translateY(-100%);
    transition-delay: 0.2s; /* Wait for things to settle */
}
