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

:root {
  --brand-bg: #050505;
  --brand-surface: rgba(15, 23, 42, 0.6);
  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-secondary: #0ea5e9;
  --brand-secondary-hover: #38bdf8;
  --brand-accent: #8b5cf6;
  --brand-text: #f8fafc;
  --brand-text-muted: #94a3b8;
  --brand-border: rgba(255, 255, 255, 0.08);
  --brand-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  --brand-glass: rgba(15, 23, 42, 0.75);
  --brand-dark: #020617;
  --brand-glow-primary: 0 0 20px rgba(59, 130, 246, 0.4);
  --brand-glow-secondary: 0 0 20px rgba(14, 165, 233, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  color: var(--brand-text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-color: var(--brand-bg);
}
@keyframes ambientGlow {
  0%, 100% {
    background-position: 0% 50%, 100% 0%, 50% 100%;
  }
  50% {
    background-position: 100% 50%, 0% 100%, 50% 0%;
  }
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: 
    radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.4), transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(234, 179, 8, 0.25), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.35), transparent 60%);
  background-size: 200% 200%;
  animation: ambientGlow 25s ease-in-out infinite;
  z-index: -100;
  pointer-events: none;
}

.object-cover {
  object-fit: cover !important;
  object-position: center !important;
}
img.object-cover,
video.object-cover {
  display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .font-display, .navbar-brand {
  font-family: 'Space Grotesk', 'Outfit', sans-serif;
  color: var(--brand-text);
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* Utilities */
.text-primary { color: var(--brand-primary) !important; }
.text-accent { color: var(--brand-accent) !important; }
.text-muted { color: var(--brand-text-muted) !important; }
.text-dark { color: var(--brand-text) !important; }
.text-brand { color: var(--brand-text) !important; }

.bg-surface { 
  background: var(--brand-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--brand-border);
}

.bg-glass {
  background: var(--brand-glass) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--brand-border);
}

/* Buttons */
.btn-pill-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.6rem;
  border-radius: 50px;
  background: var(--brand-primary);
  color: #ffffff !important;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-size: 0.95rem;
  text-decoration: none;
}
.btn-pill-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--brand-glow-primary), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
}

.btn-pill-orange {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.6rem;
  border-radius: 50px;
  background: #ff5722;
  color: #ffffff !important;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-size: 0.95rem;
  text-decoration: none;
}
.btn-pill-orange:hover {
  background: #e64a19;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 20px rgba(255, 87, 34, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
}

.btn-pill-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-text-muted);
  color: var(--brand-text) !important;
  border-radius: 50px;
  padding: 0.5rem 1.4rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-size: 0.95rem;
  text-decoration: none;
}
.btn-pill-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--brand-text);
  transform: translateY(-2px);
  color: #ffffff !important;
}

/* Header & Nav */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
}
.nav-crystal {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
.navbar-pill {
  padding: 0.8rem 0;
}
.navbar-brand span {
  color: var(--brand-text) !important;
}
.nav-link {
  color: var(--brand-text) !important;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--brand-primary) !important;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}
.nav-mobile-service-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  max-width: 46vw;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(59, 130, 246, 0.38);
  border-radius: 999px;
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none;
  text-align: center;
  background: rgba(59, 130, 246, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transition: all 0.3s ease;
}
.nav-mobile-service-link:hover,
.nav-mobile-service-link.active {
  background: var(--brand-primary);
  color: #ffffff !important;
}
.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.65) !important;
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.25) !important;
}
.navbar-toggler-icon {
  filter: invert(1) brightness(2);
}

/* Correction pour les onglets du Dashboard (Pills) */
.nav-pills .nav-link.active {
  background-color: var(--brand-primary) !important;
  color: #ffffff !important;
}

.brand-logo {
  height: 32px; width: auto; 
}

/* Full Width Hero */
.hero-full {
  position: relative;
  width: 100%;
  min-height: 85vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  padding-top: 80px;
}
.hero-full::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 2;
  color: #ffffff;
  text-align: left;
  max-width: 800px;
}
.hero-title {
  color: #ffffff !important;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Cards Overlapping */
.overlap-cards-wrapper {
  position: relative;
  margin-top: -80px;
  z-index: 10;
}
.card-surface { 
  background: var(--brand-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  color: var(--brand-text); 
  box-shadow: var(--brand-shadow);
  overflow: hidden;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease;
  border: 1px solid var(--brand-border);
}
.card-surface:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.card-surface h1, .card-surface h2, .card-surface h3, .card-surface h4, .card-surface h5, .card-surface h6 {
  color: var(--brand-text) !important;
}
.card-surface p {
  color: var(--brand-text-muted) !important;
}

/* Animation Défilement Avis */
.toast-box {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(92vw, 520px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast-message {
  width: fit-content;
  max-width: 100%;
}
.reviews-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  padding: 20px 0;
}
.reviews-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: scroll-reviews 60s linear infinite;
}
.reviews-track:hover {
  animation-play-state: paused;
}
.home-products-track {
  animation-duration: 34s;
}
@keyframes scroll-reviews {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.product-discovery-card {
  touch-action: manipulation;
}
.product-discovery-card:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 4px;
}

.admin-shell .tab-content {
  padding-top: 1.5rem;
}
.admin-shell #adminTabs {
  row-gap: 0.75rem !important;
}

.formations-news-list {
  display: grid;
  gap: 1.25rem;
}
.formation-news-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
}
.formation-news-head {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 1rem;
}
.formation-news-image {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
.formation-news-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
}
.formation-news-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}
.formation-news-details {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  color: var(--brand-text-muted) !important;
}
.formation-news-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--brand-border);
  padding-top: 1rem;
}
.formation-news-price {
  color: #22c55e;
  font-size: 1.1rem;
}

/* Styles pour tous les boutons dans le dashboard (admin-shell) */
.admin-shell .btn {
  /* Contour bleu et texte bleu */
  border-color: var(--brand-primary) !important;
  color: var(--brand-primary) !important;
  /* Fond transparent par défaut pour un effet "outline" */
  background-color: transparent !important;
  transition: all 0.2s ease;
}

/* Effet au survol : fond bleu avec texte blanc pour un meilleur contraste */
.admin-shell .btn:hover {
  background-color: var(--brand-primary) !important;
  color: #ffffff !important;
}


/* Crystal Cards (Light Blue Glassmorphism) */
.crystal-card {
  background: rgba(59, 130, 246, 0.1); /* Bleu clair transparent */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.15);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease, background 0.4s ease;
  overflow: hidden;
  position: relative;
  color: var(--brand-text);
}
.crystal-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, transparent 100%);
  pointer-events: none;
}
.crystal-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(59, 130, 246, 0.2);
  box-shadow: 0 15px 40px 0 rgba(59, 130, 246, 0.3), var(--brand-glow-primary);
  border-color: rgba(59, 130, 246, 0.5);
}

.service-quick-btn,
.service-line-card,
.service-mini-card,
.service-discovery-card,
.service-publication-card,
.service-advantage-card {
  will-change: transform;
}
.service-mini-card {
  min-height: 124px;
  border-radius: 16px;
}
.service-line-card:hover .service-line-icon,
.service-advantage-card:hover .service-line-icon {
  transform: rotate(-4deg) scale(1.08);
}
.service-line-icon,
.service-discovery-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  box-shadow: var(--brand-glow-primary);
  transition: transform 0.35s ease;
}
.service-discovery-media,
.service-publication-media {
  position: relative;
  height: 230px;
  overflow: hidden;
}
.service-publication-media {
  height: 250px;
}
.service-discovery-media img,
.service-publication-media img {
  transition: transform 0.55s ease;
}
.service-discovery-card:hover img,
.service-publication-card:hover img {
  transform: scale(1.06);
}
.service-discovery-icon {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
}
.service-hero::before {
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.84), rgba(2, 6, 23, 0.35), rgba(2, 6, 23, 0.08));
}
.service-gallery-grid:empty::before {
  content: "Chargement des publications...";
  display: block;
  width: 100%;
  color: var(--brand-text-muted);
  text-align: center;
  padding: 2rem;
}
.crystal-card h1, .crystal-card h2, .crystal-card h3, .crystal-card h4, .crystal-card h5, .crystal-card h6 {
  color: var(--brand-text) !important;
}
.crystal-card p, .crystal-card span {
  color: var(--brand-text-muted) !important;
}

/* Teal Banner */
.teal-banner {
  background-color: var(--brand-secondary);
  border-radius: 30px;
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(39, 121, 119, 0.3);
}
.teal-banner h2, .teal-banner p {
  color: #ffffff !important;
}
.teal-banner .highlight {
  color: var(--brand-primary);
}

/* Dark Footer / Section */
.dark-section {
  background-color: var(--brand-dark);
  color: #ffffff;
}
.dark-section h2, .dark-section p {
  color: #ffffff !important;
}
.dark-section .card-surface {
  background: #ffffff;
  color: var(--brand-text) !important;
}

/* Forms */
.form-control, .form-select {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: var(--brand-text) !important;
  border-radius: 50px;
  padding: 0.8rem 1.5rem;
  transition: all 0.3s ease;
}
.form-control:focus, .form-select:focus {
  background: rgba(15, 23, 42, 1) !important;
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25) !important;
  color: #ffffff !important;
}
.form-control::placeholder {
  color: var(--brand-text-muted);
}
textarea.form-control {
  border-radius: 16px;
}

/* Legacy overrides for stability */
.bg-white { background-color: var(--brand-surface) !important; }
.bg-mist { background-color: var(--brand-bg) !important; }
.bg-ink { background-color: var(--brand-dark) !important; color: #fff !important; }
.text-white { color: #ffffff !important; }
.text-white-50 { color: rgba(255,255,255,0.5) !important; }

/* Social Icons */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}
.social-icon:hover {
  transform: translateY(-3px) scale(1.1);
}

.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}
.whatsapp-float:hover {
  transform: scale(1.1) translateY(-5px);
}

/* Page Hero Inner */
.page-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 0;
  margin-top: 70px;
  padding: 40px 0;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, transparent 100%);
  z-index: 0;
}
.page-hero .container {
  position: relative;
  z-index: 2;
}
.page-hero h1 {
  color: #ffffff !important;
  font-size: 3rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.pt-hero { padding-top: 100px; }

/* Dark Footer / Section Fixes */
.bg-ink a, .dark-section a {
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none;
  transition: color 0.3s ease;
}
.bg-ink a:hover, .dark-section a:hover {
  color: #ffffff !important;
}
.bg-ink .btn-pill-outline, .dark-section .btn-pill-outline {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}
.bg-ink .btn-pill-outline:hover, .dark-section .btn-pill-outline:hover {
  background: #ffffff !important;
  color: var(--brand-dark) !important;
  border-color: #ffffff !important;
}

/* Slider Scrollbar */
.home-slider::-webkit-scrollbar {
  display: none;
}
.home-slider {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

@media (max-width: 991px) {
  .navbar > .container-fluid {
    flex-wrap: nowrap;
  }
  .navbar-brand {
    min-width: 0;
  }
  .brand-logo {
    height: 38px !important;
  }
  .navbar-collapse {
    background: var(--brand-glass);
    padding: 1.5rem;
    box-shadow: var(--brand-shadow);
    border-radius: 18px;
    margin-top: 0.75rem;
  }
  .navbar-nav {
    gap: 0.25rem;
  }
}

/* Ajustements globaux pour Smartphone (Responsive) */
@media (max-width: 768px) {
  /* Réduction proportionnelle des tailles basées sur 'rem' */
  html {
    font-size: 14px;
  }

  /* Titres et textes */
  .hero-title, .display-5 {
    font-size: 2.2rem !important;
  }
  .display-6, h1, h2 {
    font-size: 1.8rem !important;
  }
  .lead {
    font-size: 1rem !important;
  }
  h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    font-size: 1.2rem !important;
  }

  /* Espacements réduits */
  .py-5, .my-5, .mt-5, .mb-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }
  .card-surface, .p-4, .p-5 {
    padding: 1.2rem !important;
  }
  
  .page-hero {
    min-height: auto;
    padding-top: 6rem !important;
    padding-bottom: 3rem !important;
  }

  /* Cartes Boutique et Slider */
  .product-discovery-card {
    width: 260px !important;
  }
  .product-discovery-card img {
    height: 250px !important;
  }

  /* Boutons */
  .btn-pill-primary, .btn-pill-outline, .btn-pill-orange {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
  }
  .nav-mobile-service-link {
    max-width: 42vw;
    padding-inline: 0.65rem;
    font-size: 0.72rem;
  }
  .service-discovery-media,
  .service-publication-media {
    height: 210px;
  }
  .service-cta-band .btn {
    width: 100%;
    margin: 0 0 0.75rem 0 !important;
  }
  .formation-news-head {
    grid-template-columns: 68px 1fr;
    gap: 0.8rem;
  }
  .formation-news-image {
    width: 68px;
    height: 68px;
  }
  .formation-news-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .formation-news-footer .btn {
    width: 100%;
  }
}

@keyframes passingGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); }
  50% { box-shadow: 0 0 40px rgba(59, 130, 246, 0.7), inset 0 0 10px rgba(255, 255, 255, 0.1); }
}

.glow-on-pass {
  animation: passingGlow 4s infinite alternate ease-in-out;
}

/* --- CORRECTIF GLOBAL DE SUPERPOSITION --- */
/* Empêche les éléments .h-100 (qui forcent height: 100%) de déborder et de se superposer 
   sur les sections suivantes lorsque leur contenu s'enroule (wrap) sur mobile ou petits écrans. */
.h-100 {
  height: auto !important;
  min-height: 100% !important;
}

.row.h-100 {
  height: auto !important;
  min-height: 100% !important;
}

/* S'assure que les cartes gardent un espacement correct et ne débordent pas de leur conteneur */
.card-surface, .crystal-card, .service-mini-card, .service-discovery-card, .service-publication-card, .product-discovery-card {
  height: auto !important;
  min-height: 100%;
  position: relative;
  margin-bottom: 1.5rem !important; /* Ajout d'espace supplémentaire entre les cartes */
}

/* Assure le flex-wrap sur toutes les rows pour éviter les écrasements horizontaux */
.row {
  flex-wrap: wrap !important;
}
