/* ========================================
   GLOBAL STYLES - Driflect Professional
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700;800&display=swap');

/* ========== VARIABLES CSS ========== */
:root {
  /* Primaires */
  --primary-dark: #0a2e4a;
  --primary: #1e5a96;
  --primary-light: #2d7fbf;
  
  /* Accents */
  --accent: #00bfff;
  --accent-dark: #0099cc;
  
  /* Neutres */
  --dark: #0f172a;
  --gray-dark: #4b5563;
  --gray: #718096;
  --gray-light: #e2e8f0;
  --light: #f8fafc;
  --white: #ffffff;
  
  /* Statuts */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Dégradés */
  --gradient-primary: linear-gradient(135deg, #1e5a96 0%, #0a2e4a 100%);
  --gradient-accent: linear-gradient(135deg, #00bfff 0%, #0099cc 100%);
  --gradient-dark: linear-gradient(135deg, #0a2e4a 0%, #051e31 100%);
  
  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
  
  /* Transitions */
  --transition: all 0.3s ease;
}

/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Exo 2', sans-serif;
  color: var(--dark);
  line-height: 1.6;
  background: var(--light);
  overflow-x: hidden;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== TYPOGRAPHIE ========== */
h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

h2:hover::after {
  width: 100%;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

p {
  color: var(--gray);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-weight: 400;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

a:hover {
  color: var(--accent-dark);
}

/* ========== LAYOUT ========== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

section {
  padding: 6rem 0;
}

@media (max-width: 768px) {
  section {
    padding: 3rem 0;
  }
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
  animation: fadeInUp 0.6s ease;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--gray);
  margin-top: 1rem;
}

/* ========== BOUTONS ========== */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  font-family: 'Exo 2', sans-serif;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(30, 90, 150, 0.4);
}

.btn-accent {
  background: var(--gradient-accent);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.btn-accent:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 191, 255, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--white);
  transform: translateY(-3px);
}

.btn-sm {
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* ========== CARTES ========== */
.card {
  background: var(--white);
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--accent);
  border-radius: 1rem 0 0 1rem;
  transition: height 0.3s ease;
  z-index: 1;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.card:hover::before {
  height: 100%;
}

.card-icon {
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.1), rgba(30, 90, 150, 0.1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  color: var(--accent);
  transition: var(--transition);
}

.card:hover .card-icon {
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(30, 90, 150, 0.2));
  transform: scale(1.1) rotate(5deg);
}

/* ========== GRILLES ========== */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease;
}

.animate-fadeInDown {
  animation: fadeInDown 0.6s ease;
}

.animate-slideInLeft {
  animation: slideInLeft 0.6s ease;
}

.animate-slideInRight {
  animation: slideInRight 0.6s ease;
}

.animate-scaleIn {
  animation: scaleIn 0.6s ease;
}

/* ========== NAVIGATION ========== */
header {
  background: var(--white);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

header.scrolled {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

nav {
  position: relative;
}

nav a {
  color: var(--dark);
  font-weight: 500;
  position: relative;
  padding-bottom: 0.25rem;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

.dropdown-menu {
  display: none;
  position: absolute;
  background: var(--white);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  border-radius: 0.5rem;
  padding: 0.5rem 0;
  animation: fadeInDown 0.3s ease;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  padding: 0.75rem 1rem;
  transition: var(--transition);
  list-style: none;
}

.dropdown-menu li:hover {
  background: var(--light);
  padding-left: 1.25rem;
}

.dropdown-menu a {
  color: var(--dark);
  font-weight: 400;
}

.dropdown-menu a:hover {
  color: var(--accent);
}

/* ========== MOBILE MENU ========== */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.mobile-menu.active {
  max-height: 1000px;
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 1.5rem;
}

.mobile-submenu.active {
  max-height: 500px;
}

.mobile-submenu-btn .chevron {
  transition: transform 0.3s ease;
}

.mobile-submenu-btn.active .chevron {
  transform: rotate(180deg);
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background: var(--dark);
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ========== FOOTER ========== */
footer {
  background: var(--gradient-dark);
  color: var(--white);
  padding-top: 4rem;
  padding-bottom: 2rem;
  margin-top: 4rem;
}

footer h3 {
  color: var(--white);
  margin-bottom: 1.5rem;
}

footer p, footer a {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

footer a:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: var(--transition);
  color: var(--white);
}

.social-links a:hover {
  background: var(--accent);
  transform: translateY(-3px);
}

/* ========== FORMULAIRES ========== */
.form-group {
  margin-bottom: 1.75rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--gray-light);
  border-radius: 0.5rem;
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  color: var(--dark);
  transition: var(--transition);
  background: var(--white);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 191, 255, 0.1);
  background: rgba(0, 191, 255, 0.02);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-control::placeholder {
  color: var(--gray-light);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231e5a96' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
}

/* ========== TEXTES & UTILITAIRES ========== */
.text-center {
  text-align: center;
}

.text-white {
  color: var(--white);
}

.text-primary {
  color: var(--primary);
}

.text-accent {
  color: var(--accent);
}

.text-gray {
  color: var(--gray);
}

.bg-light {
  background: var(--light);
}

.bg-white {
  background: var(--white);
}

.bg-primary {
  background: var(--gradient-primary);
}

.bg-accent {
  background: var(--gradient-accent);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

.rounded {
  border-radius: 0.5rem;
}

.rounded-lg {
  border-radius: 1rem;
}

.rounded-full {
  border-radius: 9999px;
}

/* ========== SPACING ========== */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

/* ========== DISPLAY & FLEX ========== */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

/* ========== MAX-WIDTH ========== */
.max-w-sm {
  max-width: 24rem;
}

.max-w-md {
  max-width: 28rem;
}

.max-w-lg {
  max-width: 32rem;
}

.max-w-xl {
  max-width: 36rem;
}

.max-w-2xl {
  max-width: 42rem;
}

.max-w-3xl {
  max-width: 48rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .card {
    padding: 1.75rem;
  }
  
  section {
    padding: 2rem 0;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  .btn {
    width: 100%;
    padding: 0.75rem 1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
}

/* ========== BACK TO TOP ========== */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--gradient-accent);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 50;
}

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

#back-to-top.invisible {
  display: none;
}

/* ========== MISC ========== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Suppression du underline sur les images dans les liens */
a img {
  border: none;
}

/* Transitions fluides */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus visible pour l'accessibilité */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Smooth scroll pour tous */
@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}

/* Correction pour Safari */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Classe pour texte tronqué */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Classe pour listes */
ul, ol {
  list-style-position: inside;
}

li {
  margin-bottom: 0.5rem;
}
