/* =====================================================
   Portivo — Responsive Styles
   ===================================================== */

/* ===== BREAKPOINTS ===== */
/* xs: < 576px (mobile) */
/* sm: 576-767px (large mobile) */
/* md: 768-991px (tablet) */
/* lg: 992-1199px (small desktop) */
/* xl: 1200-1399px (desktop) */
/* xxl: 1400px+ (large desktop) */

/* ===== XS: < 576px ===== */
@media (max-width: 575.98px) {
  /* Navbar */
  .navbar-actions { flex-wrap: wrap; gap: 0.5rem !important; }
  .pf-navbar .navbar-collapse {
    padding: 5rem 1.25rem 2rem;
    border-radius: 0;
    border: none;
    margin-top: 0;
  }

  /* Hero */
  .hero-headline { font-size: 2rem; letter-spacing: -1px; }
  .hero-subtext { font-size: 0.95rem; }
  .hero-cta-group { flex-direction: column; }
  .hero-cta-group .btn { width: 100%; justify-content: center; }
  .hero-mockup-container { padding: 0 0.5rem; }
  .hero-floating-card { display: none; }
  .card-1, .card-2, .card-3 { display: none; }
  .hero-social-proof { flex-wrap: wrap; gap: 0.75rem; }
  .mock-cards-row { grid-template-columns: 1fr 1fr; }

  /* Sections */
  .section-pad { padding: 3rem 0; }
  .section-title { font-size: 1.6rem; }

  /* How it Works */
  .how-steps { flex-direction: column; align-items: center; }
  .how-connector { display: none; }
  .how-step { width: 100%; max-width: 300px; padding: 1rem; }

  /* Pricing */
  .pricing-card-featured { transform: none; }
  .pricing-card-featured:hover { transform: translateY(-4px); }

  /* Builder */
  .builder-layout { flex-direction: column; }
  .builder-form-panel {
    width: 100% !important;
    min-width: unset !important;
    max-width: unset !important;
    height: 60vh;
    border-right: none;
    border-bottom: 1px solid var(--pf-border);
  }
  .builder-preview-panel { flex: 1; min-height: 40vh; }

  /* Form Grid */
  .form-grid { grid-template-columns: 1fr; }
  .form-group-pf.full-width { grid-column: auto; }

  /* Themes Grid */
  .themes-grid { grid-template-columns: repeat(2, 1fr); }

  /* Progress Steps - Hide Labels */
  .ps-label { display: none; }

  /* Wizard Nav */
  .wizard-nav { gap: 0.5rem; }

  /* Export */
  .export-header { flex-wrap: wrap; }
  .export-preview-section { overflow-x: auto; }

  /* Full Preview */
  .full-preview-bar { flex-wrap: wrap; gap: 0.5rem; }
  .preview-url-bar { order: 3; width: 100%; max-width: unset; }

  /* Footer */
  .footer-bottom { flex-direction: column; text-align: center; }

  /* CTA */
  .cta-box { padding: 2.5rem 1.25rem; }
  .cta-title { font-size: 1.6rem; }

  /* Back to top */
  .back-to-top { right: 1rem; bottom: 1rem; }
}

/* ===== SM: 576px - 767px ===== */
@media (min-width: 576px) and (max-width: 767.98px) {
  .hero-headline { font-size: 2.4rem; }
  .hero-cta-group { flex-direction: column; }
  .hero-cta-group .btn { width: 100%; }
  .hero-floating-card { display: none; }
  .how-steps { flex-direction: column; align-items: center; }
  .how-connector { display: none; }
  .how-step { width: 100%; max-width: 320px; }
  .builder-layout { flex-direction: column; }
  .builder-form-panel {
    width: 100% !important;
    min-width: unset !important;
    max-width: unset !important;
    height: 55vh;
    border-right: none;
    border-bottom: 1px solid var(--pf-border);
  }
  .builder-preview-panel { min-height: 45vh; }
  .themes-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

/* ===== MD: 768px - 991px ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-headline { font-size: 2.8rem; }
  .hero-visual { margin-top: 3rem; }
  .hero-floating-card { transform: scale(0.85); }

  .how-steps { gap: 0; }
  .how-connector { width: 50px; }

  /* Builder */
  .builder-form-panel { width: 420px; min-width: 360px; }

  /* Themes */
  .themes-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== LG: 992px+ ===== */
@media (min-width: 992px) {
  /* Full builder side-by-side */
  .builder-layout {
    flex-direction: row;
    height: 100vh;
  }

  .builder-form-panel {
    width: 460px;
    height: 100vh;
  }

  .builder-preview-panel {
    height: 100vh;
  }
}

/* ===== XL: 1200px+ ===== */
@media (min-width: 1200px) {
  .builder-form-panel { width: 480px; }
  .hero-headline { font-size: 3.5rem; }
}

/* ===== XXL: 1400px+ ===== */
@media (min-width: 1400px) {
  .builder-form-panel { width: 500px; }
  .hero-headline { font-size: 3.8rem; }
}

/* ===== 1920px+ ===== */
@media (min-width: 1920px) {
  .builder-form-panel { width: 540px; }
}

/* ===== MOBILE NAV ===== */
@media (max-width: 991.98px) {
  /* Keep brand and X button above the slide-in overlay */
  .pf-brand,
  .pf-toggler {
    position: relative;
    z-index: 1001;
  }

  .navbar-collapse {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: auto;
    max-height: 100vh;
    background: var(--pf-surface);
    border-bottom: 1px solid var(--pf-border);
    padding: 5rem 1.5rem 2rem;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .navbar-collapse.show {
    transform: translateX(0);
  }

  .navbar-nav .nav-link {
    font-size: 1.1rem !important;
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid var(--pf-border);
    border-radius: 0 !important;
  }

  .navbar-actions {
    flex-direction: column;
    align-items: stretch;
    padding-top: 1rem;
  }

  .navbar-actions .btn { width: 100%; text-align: center; }
  .btn-theme-toggle { align-self: flex-start; }

  /* Push hero section below the fixed navbar (~64px tall) */
  .hero-section {
    padding-top: 4.5rem;
  }
}

/* ===== PORTRAIT TABLET ===== */
@media (min-width: 768px) and (max-width: 991.98px) and (orientation: portrait) {
  .builder-layout { flex-direction: column; }
  .builder-form-panel {
    width: 100% !important;
    min-width: unset !important;
    max-width: unset !important;
    height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--pf-border);
  }
  .builder-preview-panel { flex: 1; }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 767.98px) and (orientation: landscape) {
  .hero-section { min-height: auto; padding: 5rem 0 3rem; }
  .min-vh-100 { min-height: auto !important; }
  .builder-layout { flex-direction: row; }
  .builder-form-panel { width: 360px !important; height: 100vh; }
  .builder-preview-panel { height: 100vh; }
}

/* ===== PRINT ===== */
@media print {
  #mainNavbar,
  #section-landing,
  #section-builder,
  #section-export,
  .back-to-top { display: none !important; }

  #section-preview {
    display: block !important;
  }

  .full-preview-bar { display: none !important; }
  .full-preview-iframe { height: 100vh; }
}

/* ===== HIGH DPI ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .pf-input, .pf-btn-primary, .pf-btn-outline {
    -webkit-font-smoothing: antialiased;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-orb, .hero-mockup-browser,
  .hero-floating-card,
  .logos-inner,
  .scroll-wheel,
  .badge-dot { animation: none !important; }
}

/* ===== CONTAINER WIDTH RESPONSIVE ===== */
@media (max-width: 575.98px) {
  .container-xl { padding-left: 1rem; padding-right: 1rem; }
}

/* ===== PREVIEW RESPONSIVE ===== */
@media (max-width: 767.98px) {
  .preview-frame-wrapper { padding: 0.75rem; }
  .preview-panel-header { padding: 0.6rem 0.75rem; }
  .preview-tab { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
  .preview-actions { gap: 0.3rem; }
}

/* ===== EXPORT RESPONSIVE ===== */
@media (max-width: 767.98px) {
  .export-content.container-xl { padding-left: 1rem; padding-right: 1rem; }
  .export-iframe { height: 350px; }
}

/* ===== WIZARD STEPS RESPONSIVE ===== */
@media (max-width: 400px) {
  .themes-grid { grid-template-columns: repeat(2, 1fr); }
  .exp-form-grid, .edu-form-grid { grid-template-columns: 1fr; }
  .skill-input-row { flex-direction: column; }
  .skill-input-row .pf-input { width: 100%; }
}

/* ===== LOGOS RESPONSIVE ===== */
@media (max-width: 767.98px) {
  .logos-inner { gap: 2.5rem; }
  .logo-item { font-size: 0.9rem; }
}

/* ===== HERO MOCKUP RESPONSIVE ===== */
@media (max-width: 767.98px) {
  .hero-mockup-browser { max-width: 100%; }
  .mock-cards-row { grid-template-columns: 1fr 1fr; }
  .mock-cards-row .mock-project-card:last-child { display: none; }
}

@media (max-width: 400px) {
  .mock-cards-row { grid-template-columns: 1fr; }
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 767.98px) {
  .pf-footer { padding: 3rem 0 1.5rem; }
}

/* ===== PRICING RESPONSIVE ===== */
@media (max-width: 767.98px) {
  .pricing-card-featured { transform: none; order: -1; }
}

/* ===== HOW IT WORKS RESPONSIVE ===== */
@media (max-width: 991.98px) {
  .how-steps { flex-direction: column; align-items: center; gap: 1rem; }
  .how-connector { display: none; }
  .how-step { max-width: 320px; width: 100%; }
}

/* ===== AUTOSAVE RESPONSIVE ===== */
@media (max-width: 400px) {
  .autosave-indicator { display: none; }
  .wizard-nav { justify-content: space-between; }
}
