/* ==========================================
   IVANOVA SOLUTIONS - RESPONSIVE CSS
   Media queries et adaptations responsive
   ========================================== */

/* ==========================================
   BREAKPOINTS RÉFÉRENCE
   - Desktop : 1440px et plus
   - Laptop : 1025px - 1439px (menu horizontal)
   - Tablette + Mobile : jusqu'à 1024px (menu hamburger)

   Note: Le menu hamburger est activé jusqu'à 1024px pour une
   expérience cohérente sur tablette et mobile.
   ========================================== */

/* ==========================================
   1. LAPTOP (1025px - 1439px)
   ========================================== */

@media screen and (max-width: 1439px) and (min-width: 1025px) {
  :root {
    --text-5xl: 3rem;        /* 48px */
    --text-4xl: 2.5rem;      /* 40px */
    --text-3xl: 2rem;        /* 32px */
    --spacing-3xl: 5rem;     /* 80px */
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  /* Hero section */
  .hero h1 {
    font-size: 2.75rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--spacing-lg);
  }

  .footer-content .footer-section:last-child {
    grid-column: span 3;
    margin-top: var(--spacing-lg);
  }
}


/* ==========================================
   3. MOBILE & TABLETTE - MENU HAMBURGER (jusqu'à 1024px)
   ========================================== */

@media screen and (max-width: 1024px) {
  :root {
    --text-5xl: 2rem;        /* 32px */
    --text-4xl: 1.75rem;     /* 28px */
    --text-3xl: 1.5rem;      /* 24px */
    --text-2xl: 1.25rem;     /* 20px */
    --text-xl: 1.125rem;     /* 18px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 2.5rem;   /* 40px */
    --spacing-3xl: 3rem;     /* 48px */
  }

  html {
    font-size: 14px;
  }

  /* Container - marges latérales tablette */
  .container {
    padding: 0 40px;
  }

  /* ==========================================
     TYPOGRAPHIE
     ========================================== */

  h1 {
    font-size: 2rem;
    line-height: 1.3;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  h4 {
    font-size: 1.25rem;
  }

  p {
    font-size: var(--text-sm);
  }

  /* ==========================================
     HEADER & NAVIGATION RESPONSIVE
     ========================================== */

  /* Hide desktop nav, show mobile toggle */
  .header-nav {
    display: none;
  }

  .header-cta {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Adjust header padding */
  .header-container {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  /* Logo responsive */
  .logo-icon {
    width: 35px;
    height: 35px;
  }

  .logo-text {
    font-size: 1.3rem;
  }

  /* Mobile menu full width on small screens */
  .mobile-menu {
    max-width: 100%;
  }

  /* Back to top button smaller */
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }

  /* ==========================================
     HERO SECTION
     ========================================== */

  .hero {
    min-height: 100vh;
    padding-top: 60px;
    text-align: center;
  }

  .hero h1 {
    font-size: 1.875rem;
    margin-bottom: var(--spacing-sm);
  }

  .hero p {
    font-size: var(--text-base);
    margin-bottom: var(--spacing-lg);
  }

  .hero-buttons {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-dots {
    bottom: var(--spacing-lg);
  }

  /* ==========================================
     GRILLES
     ========================================== */

  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .service-card {
    padding: var(--spacing-lg);
  }

  /* Team */
  .team-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    max-width: 400px;
    margin: 0 auto;
  }

  /* ==========================================
     CARTES
     ========================================== */

  .service-card {
    padding: var(--spacing-md);
  }

  .service-icon {
    width: 56px;
    height: 56px;
    font-size: var(--text-xl);
  }

  /* ==========================================
     FORMULAIRE
     ========================================== */

  .contact-form {
    padding: var(--spacing-lg);
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-input,
  .form-select,
  .form-textarea {
    padding: var(--spacing-sm);
    font-size: var(--text-sm);
  }

  .form-textarea {
    min-height: 120px;
  }

  /* ==========================================
     BOUTONS
     ========================================== */

  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-sm);
    width: 100%;
    justify-content: center;
  }

  .btn-large {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .btn-small {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--text-xs);
    width: auto;
  }

  /* ==========================================
     CTA SECTION MOBILE
     ========================================== */

  .cta-section {
    padding: var(--spacing-xl) 0;
  }

  .cta-content {
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    text-align: center;
  }

  .cta-text {
    width: 100%;
  }

  .cta-title {
    font-size: var(--text-xl);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
  }

  .cta-description {
    font-size: var(--text-sm);
    line-height: 1.6;
    opacity: 0.85;
  }

  .cta-actions {
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-sm);
  }

  .cta-actions .btn {
    width: 100%;
    min-height: 48px;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-sm);
    justify-content: center;
    display: flex;
    align-items: center;
  }

  .cta-actions .btn-large {
    padding: 14px var(--spacing-md);
    min-height: 50px;
  }

  .btn-icon {
    font-size: var(--text-base);
    margin-right: var(--spacing-xs);
  }

  /* ==========================================
     FOOTER RESPONSIVE
     ========================================== */

  .footer-container {
    padding: var(--spacing-2xl) var(--spacing-md) 0;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-2xl);
  }

  .footer-column {
    text-align: center;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-links {
    text-align: center;
  }

  .footer-contact-list {
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-sm);
  }

  .footer-legal {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* ==========================================
     SECTIONS
     ========================================== */

  .section {
    padding: var(--spacing-xl) 0;
  }

  .section-header {
    margin-bottom: var(--spacing-lg);
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .section-subtitle {
    font-size: var(--text-base);
  }

  /* ==========================================
     UTILITIES RESPONSIVE
     ========================================== */

  /* Hide on mobile */
  .hide-mobile {
    display: none !important;
  }

  /* Show only on mobile */
  .show-mobile {
    display: block !important;
  }

  /* Full width on mobile */
  .mobile-full {
    width: 100%;
  }

  /* Text align center on mobile */
  .mobile-center {
    text-align: center;
  }

  /* Stack on mobile */
  .mobile-stack {
    flex-direction: column;
  }

  /* ==========================================
     ANIMATIONS RÉDUITES SUR MOBILE
     ========================================== */

  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale {
    transform: none;
  }

  /* Réduire les translations pour les animations */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
  }

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

  @keyframes fadeInRight {
    from {
      opacity: 0;
      transform: translateX(20px);
    }
  }
}

/* ==========================================
   4. PETITS MOBILES (jusqu'à 480px)
   ========================================== */

@media screen and (max-width: 480px) {
  :root {
    --text-5xl: 1.75rem;     /* 28px */
    --text-4xl: 1.5rem;      /* 24px */
    --text-3xl: 1.25rem;     /* 20px */
    --spacing-sm: 0.75rem;   /* 12px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.25rem;   /* 20px */
    --spacing-xl: 1.5rem;    /* 24px */
    --spacing-2xl: 2rem;     /* 32px */
    --spacing-3xl: 2.5rem;   /* 40px */
  }

  .container {
    padding: 0 15px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .section {
    padding: var(--spacing-2xl) 0;
  }

  .contact-form {
    padding: var(--spacing-md);
  }

  .service-card,
  .team-member {
    padding: var(--spacing-md);
  }

  .btn {
    padding: var(--spacing-xs) var(--spacing-md);
  }

  /* ==========================================
     CTA SECTION PETITS MOBILES
     ========================================== */

  .cta-section {
    padding: var(--spacing-lg) 0;
  }

  .cta-content {
    padding: var(--spacing-md);
    gap: var(--spacing-md);
  }

  .cta-title {
    font-size: var(--text-lg);
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
  }

  .cta-description {
    font-size: var(--text-sm);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
  }

  .cta-actions {
    gap: var(--spacing-xs);
  }

  .cta-actions .btn {
    padding: 12px var(--spacing-md);
    min-height: 44px;
    font-size: var(--text-sm);
  }

  .cta-actions .btn-large {
    padding: 12px var(--spacing-md);
    min-height: 44px;
  }
}

/* ==========================================
   5. ORIENTATION PAYSAGE (LANDSCAPE)
   ========================================== */

@media screen and (max-height: 600px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--spacing-3xl) 0;
  }

  .section {
    padding: var(--spacing-xl) 0;
  }
}

/* ==========================================
   6. GRANDS ÉCRANS (1920px et plus)
   ========================================== */

@media screen and (min-width: 1920px) {
  :root {
    --text-5xl: 4rem;        /* 64px */
    --text-4xl: 3.5rem;      /* 56px */
    --spacing-3xl: 8rem;     /* 128px */
  }

  .container {
    max-width: 1600px;
  }

  .hero h1 {
    font-size: 4rem;
  }
}

/* ==========================================
   7. TABLETTES EN MODE PORTRAIT
   ========================================== */

@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================
   8. PRINT STYLES
   ========================================== */

@media print {
  /* Masquer les éléments non nécessaires à l'impression */
  .header,
  .nav,
  .menu-toggle,
  .hero-dots,
  .btn,
  .footer-social,
  .scroll-indicator {
    display: none !important;
  }

  /* Forcer les couleurs pour l'impression */
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }

  a {
    text-decoration: underline;
  }

  /* Éviter les coupures de page */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  .service-card,
  .team-member {
    page-break-inside: avoid;
  }

  /* Ajuster les marges pour l'impression */
  .section {
    padding: 1rem 0;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}

/* ==========================================
   9. MODE SOMBRE (Préférence système)
   ========================================== */

@media (prefers-color-scheme: dark) {
  /* Optionnel : adapter les couleurs si mode sombre système */
  /* À implémenter si nécessaire */
}

/* ==========================================
   10. HOVER DÉSACTIVÉ SUR TACTILE
   ========================================== */

@media (hover: none) {
  /* Désactiver certains effets hover sur écrans tactiles */
  .hover-lift:hover,
  .hover-glow:hover,
  .hover-tilt:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }

  .nav-link::after {
    display: none;
  }

  /* Les cartes restent interactives via tap */
  .service-card:active {
    transform: translateY(-4px);
  }
}

/* ==========================================
   11. ACCESSIBILITY - Préférence animations réduites
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Garder les éléments visibles */
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================
   12. CONTRASTE ÉLEVÉ
   ========================================== */

@media (prefers-contrast: high) {
  :root {
    --color-primary: #000033;
    --color-dark: #000000;
  }

  .btn {
    border: 2px solid currentColor;
  }

  a {
    text-decoration: underline;
  }
}
