/**
 * Responsive Design
 * Media queries for different screen sizes
 */

/* ========== TABLET (768px and up) ========== */
@media (min-width: 768px) {
  .header-nav {
    display: flex;
    align-items: center;
  }

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

  /* Grid layouts */
  .grid-md-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-md-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  /* Column spans */
  .col-span-md-1 {
    grid-column: span 1 / span 1;
  }

  .col-span-md-2 {
    grid-column: span 2 / span 2;
  }

  /* Flex */
  .flex-md-row {
    flex-direction: row;
  }

  /* Text alignment */
  .text-md-left {
    text-align: left;
  }

  /* Patient info grid */
  .patient-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Normal values grid */
  .normal-values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* How It Works */
  .step-card {
    text-align: center;
  }

  .step-icon {
    margin-left: auto;
    margin-right: auto;
  }

  /* CTA Section */
  .cta-content {
    gap: var(--spacing-2xl);
  }

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

  /* Footer */
  .footer-main {
    gap: var(--spacing-xl);
  }
}

/* ========== DESKTOP (1024px and up) ========== */
@media (min-width: 1024px) {
  /* Container padding */
  .container {
    padding-left: var(--spacing-2xl);
    padding-right: var(--spacing-2xl);
  }

  /* Grid layouts */
  .grid-lg-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-lg-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  /* Column spans */
  .col-span-lg-1 {
    grid-column: span 1 / span 1;
  }

  .col-span-lg-2 {
    grid-column: span 2 / span 2;
  }

  .col-span-lg-3 {
    grid-column: span 3 / span 3;
  }

  /* Hero */
  .hero {
    padding: 128px 0;
  }

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

  /* How it works - 4 columns */
  .steps-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Analyzer layout - 2/3 + 1/3 */
  .analyzer-grid {
    grid-template-columns: 2fr 1fr;
  }

  /* Results layout - 2/3 + 1/3 */
  .results-grid {
    grid-template-columns: 2fr 1fr;
  }

  /* Review layout - 1/3 + 2/3 */
  .review-grid {
    grid-template-columns: 1fr 2fr;
  }

  /* Footer */
  .footer-main {
    gap: var(--spacing-2xl);
    padding: var(--spacing-xl) 0;
  }
}

/* ========== MOBILE ONLY (below 768px) ========== */
@media (max-width: 767px) {
  /* Typography */
  .hero-title {
    font-size: var(--text-3xl);
  }

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

  /* Hero CTA */
  .hero-cta {
    flex-direction: column;
  }

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

  /* Grid to single column */
  .grid {
    grid-template-columns: 1fr;
  }

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

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

  /* Patient info grid - single column */
  .patient-info-grid {
    grid-template-columns: 1fr;
  }

  /* Normal values grid - single column */
  .normal-values-grid {
    grid-template-columns: 1fr;
  }

  /* How It Works */
  .how-it-works-subtitle {
    font-size: var(--text-sm);
  }

  .step-card {
    text-align: center;
  }

  .step-icon {
    margin-left: auto;
    margin-right: auto;
  }

  /* CTA Section */
  .cta-section {
    padding: var(--spacing-4xl) 0;
  }

  .cta-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  .cta-text {
    max-width: 100%;
  }

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

  .cta-description {
    font-size: var(--text-sm);
  }

  .cta-button {
    width: 100%;
    justify-content: center;
  }

  .cta-contact-card {
    min-width: auto;
    width: 100%;
  }

  /* Footer */
  .footer-main {
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) 0;
    align-items: center;
    text-align: center;
  }

  .footer-nav {
    flex-direction: column;
    gap: var(--spacing-base);
  }

  .footer-bottom {
    padding: var(--spacing-base) 0 var(--spacing-lg) 0;
  }

  /* Modal on mobile */
  .modal {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }

  /* Table scroll on mobile */
  .table-container {
    overflow-x: auto;
  }

  /* Sticky sidebars not sticky on mobile */
  .sticky {
    position: static;
  }

  /* Reduce padding on mobile */
  .py-20 {
    padding-top: var(--spacing-4xl);
    padding-bottom: var(--spacing-4xl);
  }

  .py-16 {
    padding-top: var(--spacing-3xl);
    padding-bottom: var(--spacing-3xl);
  }

  /* Card padding on mobile */
  .card-content {
    padding: var(--spacing-base);
  }

  .card-header,
  .card-footer {
    padding: var(--spacing-base);
  }

  /* Toast on mobile */
  .toast-container {
    left: var(--spacing-base);
    right: var(--spacing-base);
    max-width: none;
  }
}

/* ========== TABLET ONLY (768px to 1023px) ========== */
@media (min-width: 768px) and (max-width: 1023px) {
  /* How It Works - 2 columns on tablet */
  .steps-grid {
    gap: var(--spacing-xl);
  }

  /* CTA layout - single column on tablet */
  .cta-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  /* Analyzer layout - single column on tablet */
  .analyzer-grid {
    grid-template-columns: 1fr;
  }

  /* Results layout - single column on tablet */
  .results-grid {
    grid-template-columns: 1fr;
  }

  /* Review layout - single column on tablet */
  .review-grid {
    grid-template-columns: 1fr;
  }

  /* Sidebars not sticky on tablet */
  .sticky {
    position: static;
  }
}

/* ========== LARGE DESKTOP (1280px and up) ========== */
@media (min-width: 1280px) {
  /* Larger spacing */
  .container {
    padding-left: var(--spacing-3xl);
    padding-right: var(--spacing-3xl);
  }

  /* Larger text */
  .hero-title {
    font-size: 72px;
  }
}

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

/* Show/hide utilities */
@media (min-width: 768px) {
  .show-mobile {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }
}

/* Print styles */
@media print {
  .header,
  .footer,
  .btn,
  .hide-print {
    display: none !important;
  }

  .card {
    break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }
}

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