/**
 * REQUASOL Custom CSS 2025-2026
 * Built on Bootstrap 5.3.8
 * Modern, Clean & Professional Design
 */

/* ============================================
   ROOT VARIABLES - Color Palette 2025
   ============================================ */
:root {
  /* Primary Green - Modern & Fresh */
  --rqs-green-primary: #198754;
  --rqs-green-dark: #146c43;
  --rqs-green-light: #20c997;
  --rqs-green-lighter: #d1f2eb;

  /* Accent Colors */
  --rqs-blue-accent: #0dcaf0;
  --rqs-yellow-accent: #ffc107;
  --rqs-orange-accent: #fd7e14;

  /* Neutral Palette */
  --rqs-gray-50: #f8f9fa;
  --rqs-gray-100: #f1f3f5;
  --rqs-gray-200: #e9ecef;
  --rqs-gray-300: #dee2e6;
  --rqs-gray-700: #495057;
  --rqs-gray-800: #343a40;
  --rqs-gray-900: #212529;

  /* Shadows - Modern Depth */
  --rqs-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --rqs-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --rqs-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --rqs-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);

  /* Border Radius - Soft & Modern */
  --rqs-radius-sm: 0.375rem;
  --rqs-radius-md: 0.5rem;
  --rqs-radius-lg: 0.75rem;
  --rqs-radius-xl: 1rem;

  /* Transitions */
  --rqs-transition-fast: 0.15s ease-in-out;
  --rqs-transition-base: 0.3s ease-in-out;
  --rqs-transition-slow: 0.5s ease-in-out;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--rqs-gray-800);
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0 !important;
  padding: 0 !important;
}

/* Wrapper for sticky footer */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 0 !important;
}

/* Navbar stays at top */
.navbar {
  flex-shrink: 0;
  margin: 0 !important;
}

/* Main content grows to fill available space */
main {
  flex: 1 0 auto;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

/* Remove bottom margin from last child in main */
main > *:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Remove margins from containers at the end of main */
main .container:last-child,
main .container-fluid:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */
.navbar-custom {
  background: linear-gradient(135deg, var(--rqs-green-primary) 0%, var(--rqs-green-dark) 100%);
  box-shadow: var(--rqs-shadow-md);
  padding: 0.75rem 1rem;
  transition: all var(--rqs-transition-base);
}

.navbar-custom .navbar-brand {
  transition: transform var(--rqs-transition-fast);
}

.navbar-custom .navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-custom .nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--rqs-radius-md);
  transition: all var(--rqs-transition-base);
  position: relative;
  overflow: hidden;
}

.navbar-custom .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.9);
  transition: all var(--rqs-transition-base);
  transform: translateX(-50%);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link:focus {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.navbar-custom .nav-link:hover::before {
  width: 80%;
}

.navbar-custom .nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-weight: 600;
}

.navbar-custom .dropdown-menu {
  background-color: var(--rqs-green-primary);
  border: none;
  border-radius: var(--rqs-radius-md);
  box-shadow: var(--rqs-shadow-lg);
  padding: 0.5rem;
  margin-top: 0.5rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar-custom .dropdown-item {
  border-radius: var(--rqs-radius-sm);
  padding: 0.5rem 1rem;
  transition: all var(--rqs-transition-fast);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.navbar-custom .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateX(5px);
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* ============================================
   CAROUSEL / HERO SECTION
   ============================================ */
#carousel-homepage {
  margin-top: 0;
  border-radius: 0;
  overflow: hidden;
}

#carousel-homepage .carousel-item {
  height: 400px;
  position: relative;
}


#carousel-homepage .carousel-item img {
  object-fit: cover; /* Gardez cover pour un bon rendu responsive */
  height: 100%;
  width: 100%;
  /* Ajoutez ceci si l'image semble trop zoomée */
  object-position: center center;
}

#carousel-homepage .carousel-caption {
  z-index: 2;
  bottom: 50%;
  transform: translateY(50%);
  /* Ajoutez une ombre portée au texte pour une meilleure lisibilité sur fond clair */
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

#carousel-homepage .carousel-caption h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease-out;
}

#carousel-homepage .carousel-caption h2 {
  font-size: 1.5rem;
  font-weight: 400;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.carousel-control-prev,
.carousel-control-next {
  width: 5%;
  opacity: 0.7;
  transition: opacity var(--rqs-transition-base);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 6px;
  transition: all var(--rqs-transition-base);
}

.carousel-indicators button.active {
  width: 30px;
  border-radius: 6px;
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */
.card {
  border: 1px solid var(--rqs-gray-200);
  border-radius: var(--rqs-radius-lg);
  box-shadow: var(--rqs-shadow-md);
  transition: all var(--rqs-transition-base);
  overflow: hidden;
  background-color: #ffffff;
}

.card:hover {
  box-shadow: var(--rqs-shadow-xl);
  transform: translateY(-4px);
  border-color: var(--rqs-green-light);
}

.card-body {
  padding: 2rem;
}

.card h1,
.card h2,
.card h3 {
  color: var(--rqs-green-dark);
  margin-bottom: 1rem;
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */
.alert {
  border: none;
  border-radius: var(--rqs-radius-md);
  border-left: 4px solid;
  padding: 1rem 1.5rem;
  box-shadow: var(--rqs-shadow-sm);
  animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-info {
  background-color: #e7f6fd;
  border-left-color: var(--rqs-blue-accent);
  color: #055160;
}

.alert-info a {
  color: #023e51;
  font-weight: 600;
  text-decoration: underline;
  transition: color var(--rqs-transition-fast);
}

.alert-info a:hover {
  color: var(--rqs-blue-accent);
}

.alert-warning {
  background-color: #fff8e1;
  border-left-color: var(--rqs-yellow-accent);
  color: #664d03;
}

.alert-danger {
  background-color: #f8d7da;
  border-left-color: #dc3545;
  color: #842029;
}

.alert-success {
  background-color: #d1e7dd;
  border-left-color: var(--rqs-green-primary);
  color: #0f5132;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  padding: 0.625rem 1.5rem;
  font-weight: 600;
  border-radius: var(--rqs-radius-md);
  transition: all var(--rqs-transition-base);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-success {
  background: linear-gradient(135deg, var(--rqs-green-primary) 0%, var(--rqs-green-dark) 100%);
  box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 135, 84, 0.4);
}

.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #ffffff;
  background-color: transparent;
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--rqs-gray-700);
}

.btn-secondary:hover {
  background-color: var(--rqs-gray-800);
  transform: translateY(-2px);
}

/* ============================================
   FORMS
   ============================================ */
.form-label {
  font-weight: 600;
  color: var(--rqs-gray-800);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.form-control,
.form-select {
  border: 2px solid var(--rqs-gray-300);
  border-radius: var(--rqs-radius-md);
  padding: 0.75rem 1rem;
  transition: all var(--rqs-transition-base);
  font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--rqs-green-primary);
  box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.15);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--rqs-gray-900);
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.3px;
}

h3 {
  font-size: 1.75rem;
  color: var(--rqs-green-dark);
}

h4 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

a {
  color: var(--rqs-green-primary);
  text-decoration: none;
  transition: color var(--rqs-transition-fast);
}

a:hover {
  color: var(--rqs-green-dark);
  text-decoration: underline;
}

/* ============================================
   IMAGES
   ============================================ */
.img-fluid {
  border-radius: var(--rqs-radius-md);
}

.img-thumbnail {
  border: none;
  border-radius: var(--rqs-radius-lg);
  box-shadow: var(--rqs-shadow-md);
  padding: 0.5rem;
  background-color: #fff;
  transition: all var(--rqs-transition-base);
}

.img-thumbnail:hover {
  box-shadow: var(--rqs-shadow-lg);
  transform: scale(1.02);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: linear-gradient(135deg, var(--rqs-green-primary) 0%, var(--rqs-green-dark) 100%);
  padding: 3rem 0 1.5rem !important;
  margin: 0 !important;
  margin-top: auto !important;
  border-top: none !important;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.9);
}

/* Eliminate any possible gap */
main + footer {
  margin-top: auto !important;
}

body > footer {
  margin-top: auto !important;
}

footer img {
  filter: brightness(0) invert(1);
  transition: all var(--rqs-transition-base);
}

footer img:hover {
  filter: brightness(0) invert(1) brightness(1.2);
  transform: scale(1.05);
}

footer a {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  transition: color var(--rqs-transition-fast);
}

footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

footer .row:last-child {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Social Media Links */
.footer-social-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.social-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  font-size: 1.3rem;
  transition: all var(--rqs-transition-base);
  backdrop-filter: blur(10px);
}

.social-link:hover {
  transform: translateY(-3px);
  color: white;
  text-decoration: none;
}

/* Facebook hover effect */
.social-facebook:hover {
  background: #1877f2;
  box-shadow: 0 4px 15px rgba(24, 119, 242, 0.4);
}

/* ============================================
   MAP CONTAINER
   ============================================ */
#map {
  min-height: 80vh;
  border-radius: var(--rqs-radius-lg);
  overflow: hidden;
  box-shadow: var(--rqs-shadow-lg);
}

.tooltip {
  position: relative;
  background: rgba(0, 0, 0, 0.85);
  border-radius: var(--rqs-radius-sm);
  color: white;
  padding: 8px 12px;
  font-size: 0.875rem;
  white-space: nowrap;
  box-shadow: var(--rqs-shadow-md);
}

.tooltip-measure {
  opacity: 1;
  font-weight: 600;
  background: rgba(25, 135, 84, 0.95);
}

.tooltip-static {
  background-color: #ffc107;
  color: #000;
  border: 2px solid white;
  font-weight: 600;
}

/* ============================================
   MODAL
   ============================================ */
.modal-content {
  border: none;
  border-radius: var(--rqs-radius-xl);
  box-shadow: var(--rqs-shadow-xl);
}

.modal-header {
  background: linear-gradient(135deg, var(--rqs-green-primary) 0%, var(--rqs-green-dark) 100%);
  color: white;
  border-top-left-radius: var(--rqs-radius-xl);
  border-top-right-radius: var(--rqs-radius-xl);
  padding: 1.5rem;
}

.modal-header .modal-title {
  font-weight: 700;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.modal-header .btn-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border-top: 1px solid var(--rqs-gray-200);
  padding: 1rem 2rem;
}

/* ============================================
   UTILITIES & SPACING
   ============================================ */
.pt-2 {
  padding-top: 1rem !important;
}

.pt-4 {
  padding-top: 2rem !important;
}

/* Container Improvements */
.container {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 992px) {
  #carousel-homepage .carousel-item {
    height: 350px;
  }

  #carousel-homepage .carousel-caption h1 {
    font-size: 2rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  #carousel-homepage .carousel-item {
    height: 280px;
  }

  #carousel-homepage .carousel-caption h1 {
    font-size: 1.5rem;
  }

  #carousel-homepage .carousel-caption h2 {
    font-size: 1rem;
  }

  .navbar-custom .nav-link {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
  }

  .card-body {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  footer {
    text-align: center;
  }

  footer .col-xs-7 {
    margin-bottom: 2rem;
  }
}

/* Small Mobile */
@media (max-width: 576px) {
  #carousel-homepage .carousel-item {
    height: 220px;
  }

  #carousel-homepage .carousel-caption h1 {
    font-size: 1.25rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .alert {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .navbar,
  footer,
  .btn,
  #carousel-homepage {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */
*:focus {
  outline: 3px solid rgba(25, 135, 84, 0.5);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--rqs-green-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   LOADING & ANIMATIONS
   ============================================ */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade in animation for page load */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
