/* ============================================
   IYE SERVICES - STYLES PROFESSIONNELS
   Version PRO avec animations modernes
   ============================================ */

/* ========== VARIABLES CSS ========== */
:root {
  --color-primary: #2c3e50;
  --color-accent: #f1c40f;
  --color-accent-dark: #d4a017;
  --color-light: #ffffff;
  --color-background: #f8f9fa;
  --color-dark-background: #ecf0f1;
  --color-text: #34495e;
  --color-text-light: #5a6c7d;
  --font-primary: 'Poppins', sans-serif;
  --font-secondary: 'Roboto', sans-serif;
  --border-radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.12);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========== ANIMATIONS KEYFRAMES ========== */

/* Scroll reveal animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Hero gradient animation */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Particules flottantes */
@keyframes particleFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-100px); }
}

/* Icônes animations */
@keyframes wrenchRotate {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}

@keyframes keyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px) rotate(-5deg); }
  75% { transform: translateX(5px) rotate(5deg); }
}

@keyframes phoneRing {
  0%, 100% { transform: rotate(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
  20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

/* Bandeau urgence */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Badge flottant */
@keyframes slideInBadge {
  to { left: 0; }
}

/* Bouton pulse */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(241, 196, 15, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(241, 196, 15, 0.6);
  }
}

/* Liste slide in */
@keyframes slideInList {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== CLASSES SCROLL REVEAL ========== */
.scroll-reveal {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.scroll-reveal-left {
  opacity: 0;
  animation: fadeInLeft 0.8s ease-out forwards;
}

.scroll-reveal-right {
  opacity: 0;
  animation: fadeInRight 0.8s ease-out forwards;
}

/* Délais cascade */
.scroll-reveal:nth-child(1) { animation-delay: 0.1s; }
.scroll-reveal:nth-child(2) { animation-delay: 0.2s; }
.scroll-reveal:nth-child(3) { animation-delay: 0.3s; }
.scroll-reveal:nth-child(4) { animation-delay: 0.4s; }

/* ========== ACCESSIBILITÉ ========== */

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: var(--color-primary);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-weight: 700;
  z-index: 10000;
  transition: top 0.3s ease;
  border-radius: 0 0 var(--border-radius) 0;
}

.skip-link:focus {
  top: 0;
}

/* Focus visible amélioré */
*:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* ========== BARRE PROGRESSION SCROLL ========== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), #e67e22);
  z-index: 10000;
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 2px 10px rgba(241, 196, 15, 0.5);
}

/* ========== BANDEAU URGENCE ========== */
.urgent-banner {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  color: white;
  padding: 0.75rem 0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.5s ease-out;
}

.urgent-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.urgent-call-btn {
  background: white;
  color: #e74c3c;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition-base);
  animation: shake 3s infinite;
}

.urgent-call-btn:hover {
  background: var(--color-accent);
  color: var(--color-primary);
  transform: scale(1.05);
  animation: none;
}

/* ========== HERO AMÉLIORÉ ========== */
.hero {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  position: relative;
  overflow: hidden;
}

/* Particules dans hero */
.hero::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, rgba(241, 196, 15, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: particleFloat 20s linear infinite;
  pointer-events: none;
}

/* ========== BOUTONS AMÉLIORÉS ========== */
.btn-hero, .btn-quote, .btn-form {
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  transition: var(--transition-base);
}

.btn-hero::before, .btn-quote::before, .btn-form::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-hero:hover::before, .btn-quote:hover::before, .btn-form:hover::before {
  width: 300px;
  height: 300px;
}

.btn-hero:hover, .btn-quote:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(241, 196, 15, 0.4);
}

.btn-hero:active, .btn-quote:active {
  transform: translateY(-1px);
}

/* Animations icônes boutons */
.btn-hero:hover .fa-wrench {
  animation: wrenchRotate 0.6s ease-in-out;
}

.btn-hero:hover .fa-key {
  animation: keyShake 0.6s ease-in-out;
}

.phone-number:hover .fa-phone-volume {
  animation: phoneRing 0.5s ease-in-out;
}

/* ========== CARDS AVEC EFFETS 3D ========== */
.commitment-card, .service-category-card, .why-us-card {
  transition: var(--transition-base);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.commitment-card:hover, .service-category-card:hover, .why-us-card:hover {
  transform: translateY(-10px) rotateX(5deg);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 0 2px var(--color-accent);
}

/* Effet parallax sur icônes */
.commitment-card:hover .icon,
.service-category-card:hover h4 i,
.why-us-card:hover .icon {
  transform: translateY(-5px) scale(1.1);
  transition: var(--transition-base);
}

/* Animation liste au hover */
.service-category-card ul li {
  opacity: 0;
  animation: slideInList 0.5s ease-out forwards;
}

.service-category-card:hover ul li:nth-child(1) { animation-delay: 0.1s; }
.service-category-card:hover ul li:nth-child(2) { animation-delay: 0.2s; }
.service-category-card:hover ul li:nth-child(3) { animation-delay: 0.3s; }
.service-category-card:hover ul li:nth-child(4) { animation-delay: 0.4s; }
.service-category-card:hover ul li:nth-child(5) { animation-delay: 0.5s; }

/* ========== STATISTIQUES ANIMÉES ========== */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  background: linear-gradient(135deg, var(--color-primary), #34495e);
  padding: 3rem 2rem;
  margin: 4rem 0;
  border-radius: var(--border-radius);
  color: white;
  text-align: center;
}

.stat-item {
  padding: 1rem;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--color-accent);
  font-family: var(--font-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  opacity: 0.9;
  margin-top: 0.5rem;
}

/* ========== BADGES DE CONFIANCE ========== */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 3rem 0;
  padding: 2rem;
  background: rgba(241, 196, 15, 0.1);
  border-radius: var(--border-radius);
}

.trust-badge {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: var(--transition-base);
  min-width: 120px;
}

.trust-badge:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.trust-badge i {
  font-size: 2.5rem;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
  display: block;
}

.trust-badge span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.3;
  display: block;
}

/* ========== BOUTON APPEL FLOTTANT MOBILE ========== */
.floating-call-btn {
  display: none;
}

@media (max-width: 768px) {
  .floating-call-btn {
    display: flex;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-accent);
    color: var(--color-primary);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(241, 196, 15, 0.4);
    z-index: 1000;
    animation: pulse 2s infinite;
    text-decoration: none;
  }

  .floating-call-btn:hover {
    animation: none;
    transform: scale(1.1);
  }
}

/* ========== BADGE "DEVIS GRATUIT" FLOTTANT ========== */
.floating-badge {
  position: fixed;
  top: 150px;
  left: -70px;
  background: var(--color-accent);
  color: var(--color-primary);
  padding: 1rem 1.5rem;
  border-radius: 0 10px 10px 0;
  font-weight: 700;
  text-align: center;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 900;
  cursor: pointer;
  transition: var(--transition-base);
  line-height: 1.3;
  animation: slideInBadge 1s ease-out 2s forwards;
}

.floating-badge:hover {
  left: 0;
  box-shadow: 4px 4px 20px rgba(241, 196, 15, 0.4);
}

.floating-badge i {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* ========== RESPONSIVE MOBILE-FIRST ========== */
@media (max-width: 768px) {
  /* Boutons touch-friendly */
  .btn-hero, .btn-quote, .btn-form {
    min-height: 48px;
    font-size: 1.1rem;
    padding: 1rem 2rem;
  }

  /* Espacements augmentés */
  .commitments-grid,
  .service-categories-grid,
  .why-us-grid {
    gap: 1.5rem;
  }

  /* Textes lisibles */
  body {
    font-size: 17px; /* iOS optimal */
  }

  h1 {
    font-size: 2.2rem;
    line-height: 1.3;
  }

  h2 {
    font-size: 1.8rem;
  }

  /* Hero mobile */
  .hero {
    padding: 4rem 1rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn-hero {
    width: 100%;
    justify-content: center;
  }

  /* Stats responsive */
  .stat-number {
    font-size: 2.5rem;
  }

  /* Trust badges responsive */
  .trust-badges {
    gap: 1rem;
  }

  /* Floating badge mobile */
  .floating-badge {
    top: auto;
    bottom: 90px;
    left: -70px;
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
  }

  .floating-badge i {
    font-size: 1.2rem;
  }
}

/* ========== OPTIMISATIONS PERFORMANCE ========== */

/* Réduire motion pour utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (bonus) */
@media (prefers-color-scheme: dark) {
  /* Pour une future implémentation dark mode */
}

/* ========== PRINT STYLES ========== */
@media print {
  .skip-link,
  .scroll-progress,
  .urgent-banner,
  .floating-call-btn,
  .floating-badge {
    display: none !important;
  }
}
