/* Calculate RPE - Mobile-First Responsive Design */

/* ===== GLOBAL MOBILE OPTIMIZATIONS ===== */
* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}


/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 767px) {
  
  /* Enhanced touch targets and prevent zoom */
  * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
  }
  
  /* Prevent zoom on input focus (iOS) */
  input[type="number"], input[type="text"], select {
    font-size: 16px;
  }

  /* Mobile header optimization */
  .modern-header {
    padding: 8px 16px;
    min-height: 48px;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  
  .modern-header-container {
    padding: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .logo-title {
    font-size: 1.25rem;
  }
  
  .logo-subtitle {
    font-size: 0.75rem;
  }

  /* Mobile header navigation */
  .modern-header-nav {
    gap: 8px;
  }

  .units-toggle {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  

  /* Mobile calculator container */
  .modern-calculator-container {
    padding: 12px;
    margin: 0;
  }

  /* Mobile step indicator */
  .step-indicator {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }

  .step-item {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: 8px;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .step-label {
    font-size: 0.9rem;
  }

  /* Mobile input groups */
  .modern-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modern-input-group {
    margin-bottom: 16px;
  }

  .modern-label {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .input-hint {
    font-size: 0.8rem;
  }

  /* Mobile stepper buttons */
  .modern-stepper {
    min-width: 36px;
    min-height: 36px;
  }

  /* Mobile RPE slider */
  .rpe-input-modern {
    padding: 12px 0;
  }

  .rpe-slider-container {
    margin-bottom: 12px;
  }

  .rpe-labels {
    font-size: 0.8rem;
  }

  /* Mobile action buttons */
  .primary-btn, .secondary-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .calculate-btn {
    width: 100%;
    margin-top: 16px;
  }

  /* Mobile results section */
  .step-content {
    padding: 16px;
  }

  .modern-card {
    margin: 0;
    border-radius: 12px;
  }

  .card-header {
    padding: 16px 16px 12px;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .card-subtitle {
    font-size: 0.85rem;
  }

  /* Mobile action buttons grid */
  .action-buttons-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .action-btn {
    padding: 16px;
    text-align: left;
  }

  .action-title {
    font-size: 1rem;
  }

  .action-subtitle {
    font-size: 0.8rem;
  }

  /* Mobile landing sections */
  .landing-section {
    padding: 24px 0 !important;
  }

  .section-content {
    padding: 0 12px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .section-header {
    margin-bottom: 20px !important;
  }

  .section-header h2 {
    font-size: 1.4rem !important;
    margin-bottom: 8px !important;
    line-height: 1.2 !important;
    word-wrap: break-word;
    hyphens: auto;
  }

  .section-header p {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }

  /* Mobile feature grids */
  .features-grid, .use-cases-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .feature-card, .use-case-card {
    padding: 16px !important;
  }

  .feature-card h3, .use-case-card h3 {
    font-size: 1rem !important;
  }

  .feature-card p, .use-case-card p {
    font-size: 0.85rem !important;
  }

  /* Mobile steps */
  .steps-container {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .step-card {
    padding: 16px;
  }

  .step-number {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.1rem !important;
  }

  .step-card h3 {
    font-size: 0.95rem !important;
  }

  .step-card p {
    font-size: 0.85rem !important;
  }

  /* Mobile comparison table */
  .comparison-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .comparison-table table {
    min-width: 500px;
    font-size: 0.85rem;
  }

  /* Mobile RPE table */
  .rpe-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .rpe-table {
    min-width: 400px;
    font-size: 0.8rem;
  }

  /* Mobile chart controls */
  .chart-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .chart-toggle-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  /* Mobile FAQ */
  .modern-cards-grid {
    gap: 8px !important;
  }

  .modern-card {
    padding: 12px !important;
  }

  .model-name {
    font-size: 0.9rem !important;
  }

  .model-description {
    font-size: 0.85rem !important;
  }

  /* Mobile footer */
  .modern-footer {
    padding: 24px 0;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .footer-link {
    font-size: 0.85rem;
  }

  /* Mobile modals */
  .modern-modal-content {
    margin: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  /* Mobile CTA buttons */
  .cta-button {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .card-body {
    flex-direction: column;
    gap: 8px;
  }

  .primary-btn, .secondary-btn {
    width: 100%;
  }
}

/* ===== TABLET OPTIMIZATIONS ===== */
@media (min-width: 768px) and (max-width: 1023px) {
  .modern-calculator-container {
    padding: 20px;
  }

  .modern-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .features-grid, .use-cases-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .steps-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }

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

/* Accessibility and print styles */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-primary: #000000;
    --text-secondary: #000000;
    --bg-primary: #ffffff;
    --bg-secondary: #f0f0f0;
  }
}

@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;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
}
