/* ==========================================================================
   AiNoted Responsive Breakpoints — responsive.css
   Mobile-first media queries. All values reference variables.css tokens.

   Breakpoints:
     - max  479px  — Phones (small)
     - 480–767px   — Phones (large)
     - 768–1023px  — Tablets
     - 1024px+     — Desktop
     - 1280px+     — Large desktop
   ========================================================================== */


/* ==========================================================================
   PHONES (max-width: 479px)
   Single-column everything, compact spacing, mobile nav.
   ========================================================================== */

@media (max-width: 479px) {

  /* --------------------------------------------------------------------------
     Layout
     -------------------------------------------------------------------------- */
  .container,
  .container-marketing,
  .container-narrow {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .app-content {
    padding: var(--space-4);
  }

  /* --------------------------------------------------------------------------
     Typography
     -------------------------------------------------------------------------- */
  h1, .h1 { font-size: var(--text-3xl); }
  h2, .h2 { font-size: var(--text-2xl); }
  h3, .h3 { font-size: var(--text-xl); }
  h4, .h4 { font-size: var(--text-lg); }

  /* --------------------------------------------------------------------------
     Grids collapse to single column
     -------------------------------------------------------------------------- */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* --------------------------------------------------------------------------
     Navigation — Mobile
     -------------------------------------------------------------------------- */
  .nav-links {
    display: none;
  }

  .nav-actions {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-mobile-menu {
    display: block;
  }

  /* --------------------------------------------------------------------------
     Hero — Smaller text, tighter spacing
     -------------------------------------------------------------------------- */
  .hero {
    min-height: auto;
    padding: var(--space-20) var(--space-4) var(--space-12);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

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

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .hero-badge {
    font-size: var(--text-xs);
  }

  .hero-image {
    margin-top: var(--space-10);
    border-radius: var(--radius-xl);
  }

  .hero-glow::before {
    width: 300px;
    height: 300px;
  }

  .hero-glow::after {
    width: 250px;
    height: 250px;
  }

  /* --------------------------------------------------------------------------
     Features — Single column
     -------------------------------------------------------------------------- */
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .feature-card {
    padding: var(--space-6);
  }

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

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

  /* --------------------------------------------------------------------------
     Pricing — Stack vertically
     -------------------------------------------------------------------------- */
  .pricing-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .pricing-card {
    max-width: 100%;
  }

  .pricing-price {
    font-size: var(--text-3xl);
  }

  /* --------------------------------------------------------------------------
     Stats — Vertical stack
     -------------------------------------------------------------------------- */
  .stats-row {
    flex-direction: column;
    gap: var(--space-6);
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  /* --------------------------------------------------------------------------
     Testimonials — Horizontal scroll
     -------------------------------------------------------------------------- */
  .testimonials-grid {
    display: none;
  }

  .testimonials-scroll {
    display: flex;
  }

  /* --------------------------------------------------------------------------
     CTA Section
     -------------------------------------------------------------------------- */
  .cta-section {
    padding: var(--space-10) var(--space-6);
    border-radius: var(--radius-xl);
    margin-left: var(--space-4);
    margin-right: var(--space-4);
  }

  .cta-title {
    font-size: var(--text-2xl);
  }

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

  .cta-actions {
    flex-direction: column;
    width: 100%;
  }

  .cta-actions .btn {
    width: 100%;
  }

  /* --------------------------------------------------------------------------
     Footer — Single column
     -------------------------------------------------------------------------- */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

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

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

  /* --------------------------------------------------------------------------
     Sections — Reduced padding
     -------------------------------------------------------------------------- */
  .section,
  .features-section,
  .pricing-section,
  .testimonials-section {
    padding: var(--space-12) var(--space-4);
  }

  .section-header {
    margin-bottom: var(--space-10);
  }

  /* --------------------------------------------------------------------------
     Buttons — Full width on small screens
     -------------------------------------------------------------------------- */
  .btn-full-mobile {
    width: 100%;
  }

  /* --------------------------------------------------------------------------
     Modals — Full width
     -------------------------------------------------------------------------- */
  .modal-backdrop {
    padding: var(--space-4);
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  .modal-header,
  .modal-body {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .modal-footer {
    padding: var(--space-4);
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }

  /* --------------------------------------------------------------------------
     Toasts
     -------------------------------------------------------------------------- */
  .toast-container {
    top: var(--space-4);
    right: var(--space-4);
    left: var(--space-4);
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  /* --------------------------------------------------------------------------
     Tables — Scroll horizontally
     -------------------------------------------------------------------------- */
  .table-wrapper {
    border-radius: var(--radius-lg);
  }

  /* --------------------------------------------------------------------------
     Logos
     -------------------------------------------------------------------------- */
  .logos-row {
    gap: var(--space-6);
  }

  .logos-row img {
    height: 20px;
  }
}


/* ==========================================================================
   LARGE PHONES (480px–767px)
   Two-column grids where appropriate, still mobile nav.
   ========================================================================== */

@media (min-width: 480px) and (max-width: 767px) {

  /* --------------------------------------------------------------------------
     Navigation — Still mobile
     -------------------------------------------------------------------------- */
  .nav-links {
    display: none;
  }

  .nav-actions {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-mobile-menu {
    display: block;
  }

  /* --------------------------------------------------------------------------
     Grids — 2 columns
     -------------------------------------------------------------------------- */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  /* --------------------------------------------------------------------------
     Hero
     -------------------------------------------------------------------------- */
  .hero {
    min-height: auto;
    padding: var(--space-20) var(--space-6) var(--space-12);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  /* --------------------------------------------------------------------------
     Features — 2 column grid
     -------------------------------------------------------------------------- */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  /* --------------------------------------------------------------------------
     Pricing — Stack
     -------------------------------------------------------------------------- */
  .pricing-grid {
    flex-direction: column;
    align-items: center;
  }

  .pricing-card {
    max-width: 420px;
  }

  /* --------------------------------------------------------------------------
     Testimonials — Scroll on mobile
     -------------------------------------------------------------------------- */
  .testimonials-grid {
    display: none;
  }

  .testimonials-scroll {
    display: flex;
  }

  /* --------------------------------------------------------------------------
     Stats — Row but wrapped
     -------------------------------------------------------------------------- */
  .stats-row {
    flex-wrap: wrap;
    gap: var(--space-8);
  }

  /* --------------------------------------------------------------------------
     Footer — 2 columns
     -------------------------------------------------------------------------- */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  /* --------------------------------------------------------------------------
     Sections
     -------------------------------------------------------------------------- */
  .section,
  .features-section,
  .pricing-section,
  .testimonials-section {
    padding: var(--space-16) var(--space-6);
  }
}


/* ==========================================================================
   TABLETS (768px–1023px)
   Collapsed sidebar, two-column features, pricing side-by-side.
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {

  /* --------------------------------------------------------------------------
     App Layout — Collapsed sidebar (icons only)
     -------------------------------------------------------------------------- */
  .app-sidebar {
    width: var(--sidebar-collapsed);
  }

  .app-topbar {
    left: var(--sidebar-collapsed);
  }

  .app-main {
    margin-left: var(--sidebar-collapsed);
  }

  /* --------------------------------------------------------------------------
     Navigation — Show links, hide mobile menu
     -------------------------------------------------------------------------- */
  .nav-links {
    display: flex;
  }

  .nav-actions {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .nav-mobile-menu {
    display: none !important;
  }

  /* --------------------------------------------------------------------------
     Grids — 2 columns
     -------------------------------------------------------------------------- */
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  /* --------------------------------------------------------------------------
     Hero
     -------------------------------------------------------------------------- */
  .hero-title {
    font-size: var(--text-5xl);
  }

  /* --------------------------------------------------------------------------
     Features — 2 column
     -------------------------------------------------------------------------- */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* --------------------------------------------------------------------------
     Pricing — Side by side (may wrap)
     -------------------------------------------------------------------------- */
  .pricing-grid {
    flex-wrap: wrap;
  }

  .pricing-card {
    max-width: 340px;
    flex: 1 1 280px;
  }

  /* --------------------------------------------------------------------------
     Testimonials — Grid on tablet
     -------------------------------------------------------------------------- */
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials-scroll {
    display: none;
  }

  /* --------------------------------------------------------------------------
     Footer — 4 columns
     -------------------------------------------------------------------------- */
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}


/* ==========================================================================
   DESKTOP (1024px+)
   Full sidebar, 3-col features, full pricing grid.
   ========================================================================== */

@media (min-width: 1024px) {

  /* --------------------------------------------------------------------------
     App Layout — Full sidebar
     -------------------------------------------------------------------------- */
  .app-sidebar {
    width: var(--sidebar-width);
  }

  .app-topbar {
    left: var(--sidebar-width);
  }

  .app-main {
    margin-left: var(--sidebar-width);
  }

  /* --------------------------------------------------------------------------
     Navigation — Full desktop nav
     -------------------------------------------------------------------------- */
  .nav-links {
    display: flex;
  }

  .nav-actions {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .nav-mobile-menu {
    display: none !important;
  }

  /* --------------------------------------------------------------------------
     Grids — Full columns
     -------------------------------------------------------------------------- */
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

  /* --------------------------------------------------------------------------
     Features — 3 columns
     -------------------------------------------------------------------------- */
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* --------------------------------------------------------------------------
     Pricing — 3-4 column flex
     -------------------------------------------------------------------------- */
  .pricing-grid {
    flex-wrap: nowrap;
  }

  /* --------------------------------------------------------------------------
     Testimonials — Grid
     -------------------------------------------------------------------------- */
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .testimonials-scroll {
    display: none;
  }

  /* --------------------------------------------------------------------------
     Hero — Full size
     -------------------------------------------------------------------------- */
  .hero {
    min-height: 90vh;
  }

  .hero-title {
    font-size: var(--text-6xl);
  }

  .hero-subtitle {
    font-size: var(--text-xl);
  }
}


/* ==========================================================================
   LARGE DESKTOP (1280px+)
   Generous spacing, centered content with max-width.
   ========================================================================== */

@media (min-width: 1280px) {

  /* --------------------------------------------------------------------------
     Containers — More breathing room
     -------------------------------------------------------------------------- */
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }

  .container-marketing {
    padding-left: var(--space-10);
    padding-right: var(--space-10);
  }

  .app-content {
    padding: var(--space-10);
  }

  /* --------------------------------------------------------------------------
     Sections — More vertical space
     -------------------------------------------------------------------------- */
  .section,
  .features-section,
  .pricing-section,
  .testimonials-section {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }

  .section-header {
    margin-bottom: var(--space-20);
  }

  /* --------------------------------------------------------------------------
     Grids — Wider gaps
     -------------------------------------------------------------------------- */
  .features-grid {
    gap: var(--space-10);
  }

  .pricing-grid {
    gap: var(--space-10);
  }

  .testimonials-grid {
    gap: var(--space-8);
  }

  /* --------------------------------------------------------------------------
     Stats — More space between items
     -------------------------------------------------------------------------- */
  .stats-row {
    gap: var(--space-20);
  }

  /* --------------------------------------------------------------------------
     Footer
     -------------------------------------------------------------------------- */
  .footer-grid {
    gap: var(--space-16);
  }

  /* --------------------------------------------------------------------------
     Hero — Extra large title
     -------------------------------------------------------------------------- */
  .hero-title {
    font-size: var(--text-6xl);
  }

  .hero-content {
    max-width: 900px;
  }

  .hero-image {
    max-width: 1100px;
  }
}


/* ==========================================================================
   ULTRA-WIDE (1536px+)
   Cap content width to prevent overly long reading lines.
   ========================================================================== */

@media (min-width: 1536px) {
  .container {
    max-width: var(--max-content);
  }

  .container-marketing {
    max-width: var(--max-marketing);
  }
}


/* ==========================================================================
   HEIGHT-BASED ADJUSTMENTS
   For short viewports (landscape phones, etc.)
   ========================================================================== */

@media (max-height: 600px) {
  .hero {
    min-height: auto;
    padding-top: var(--space-16);
    padding-bottom: var(--space-12);
  }
}


/* ==========================================================================
   HOVER MEDIA QUERY
   Only apply hover effects on devices that support hover (non-touch).
   ========================================================================== */

@media (hover: none) {
  .feature-card:hover {
    transform: none;
    border-color: var(--border-subtle);
    box-shadow: none;
  }

  .btn-primary:hover {
    transform: none;
  }

  .btn-secondary:hover {
    transform: none;
  }

  .btn-danger:hover {
    transform: none;
  }

  .card:hover {
    background-color: var(--bg-surface);
    box-shadow: none;
  }
}


/* ==========================================================================
   PRINT STYLES
   Minimal print-friendly overrides.
   ========================================================================== */

@media print {
  .marketing-nav,
  .app-sidebar,
  .app-topbar,
  .toast-container,
  .modal-backdrop,
  .nav-toggle,
  .hero-glow {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .hero {
    min-height: auto;
    background: none;
  }

  .app-main {
    margin-left: 0;
    padding-top: 0;
  }
}
