/* ============================================================
   SunuCV - Responsive Design pour les différentes tailles d'écran (desktop, tablette, mobile)
   ============================================================ */

/* ----- Large Desktop ( > 1400px ) ----- */
@media (min-width: 1400px) {
  .container { max-width: 1320px; }
  .hero h1 { font-size: 4.25rem; }
  .section-title { font-size: 3rem; }
}

/* ----- Desktop / Laptop ( 1025px - 1399px ) ----- */
@media (max-width: 1399px) {
  .hero h1 { font-size: 3.25rem; }
  .hero-float-1 { right: -5%; }
  .hero-float-3 { right: -8%; }
}

/* ----- Tablet Landscape / Small Laptop ( 993px - 1024px ) ----- */
@media (max-width: 1024px) {
  .hero h1 { font-size: 2.75rem; }
  .section-title { font-size: 2.25rem; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .templates-showcase { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-visual-inner { max-width: 420px; }
  .hero-float { display: none; }
}

/* ----- Tablet Portrait ( 769px - 992px ) ----- */
@media (max-width: 992px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content { padding-top: 80px; }
  .hero p { margin: 0 auto 36px; }
  .hero-buttons { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { display: none; }

  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .templates-showcase { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }

  /* Builder */
  .builder-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 300;
    transform: translateX(-100%);
    width: 320px;
    min-width: 320px;
  }
  .builder-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .builder-sidebar.collapsed {
    width: 320px;
    min-width: 320px;
    transform: translateX(-100%);
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 299;
    display: none;
  }
  .sidebar-overlay.active { display: block; }

  .preview-canvas { width: 100%; }
  .cv-page { padding: 15mm 10mm; }

  .customization-panel {
    width: 320px;
    right: -320px;
  }
}

/* ----- Mobile ( 577px - 768px ) ----- */
@media (max-width: 768px) {
  .navbar-links { display: none; }
  .navbar-toggle { display: flex; }
  .navbar-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    gap: 16px;
  }

  .hero { min-height: auto; padding: 120px 0 80px; }
  .hero h1 { font-size: 2.25rem; }
  .hero p { font-size: 1rem; }
  .hero-stats { gap: 24px; }
  .hero-stat h3 { font-size: 1.5rem; }

  .section-padding { padding: 60px 0; }
  .section-title { font-size: 1.875rem; }
  .features-grid { grid-template-columns: 1fr; }
  .templates-showcase { grid-template-columns: repeat(2, 1fr); }
  .template-card-visual { height: 200px; }

  .cta-content h2 { font-size: 2rem; }
  .cta-content { padding: 60px 0; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  /* Builder mobile */
  .builder-topbar { padding: 8px 12px; }
  .topbar-left .topbar-title { font-size: 0.85rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-btn { padding: 6px 12px; font-size: 0.8rem; }
  .topbar-btn span { display: none; }
  .preview-container { padding: 16px 8px; }
  .preview-toolbar { padding: 6px 12px; flex-wrap: wrap; gap: 8px; }
  .preview-toolbar-left .preview-label { display: none; }
  .template-selector button { padding: 4px 10px; font-size: 0.75rem; }
  .color-swatches { grid-template-columns: repeat(5, 1fr); }
  .builder-sidebar { width: 100%; min-width: 100%; }
  .builder-sidebar.open { width: 100%; }

  .customization-panel { width: 100%; right: -100%; }
  .customization-panel.open { width: 100%; }
}

/* ----- Small Mobile ( < 576px ) ----- */
@media (max-width: 576px) {
  .hero h1 { font-size: 1.75rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .hero-stats { flex-direction: column; gap: 16px; align-items: center; }
  .section-title { font-size: 1.5rem; }
  .templates-showcase { grid-template-columns: 1fr; }
  .template-card-visual { height: 240px; }
  .testimonial-card { padding: 24px 20px; }
  .navbar-logo { font-size: 1.25rem; }
  .preview-container { padding: 8px 4px; }
  .template-selector { flex-wrap: wrap; }
  .cv-page { padding: 12mm 8mm; }

  .topbar-left .auto-save-indicator { display: none; }
}
