/**
 * Responsive design styles for SIA Radio Training Simulator
 */

/* Base responsive adjustments */
@media (max-width: 1024px) {
  .content-container {
    max-width: 95%;
    /* Increased width utilization */
    padding: 1rem;
    /* Reduced padding */
    margin: 1rem auto;
  }
}

@media (max-width: 768px) {
  .content-container {
    max-width: 95%;
    padding: 1.25rem;
    margin: 0.75rem auto;
  }

  h1 {
    font-size: 1.75rem !important;
  }

  h2 {
    font-size: 1.5rem !important;
  }

  .nav-tabs {
    flex-wrap: wrap;
  }

  .tab-button {
    flex: 1 1 calc(50% - 0.5rem);
    margin-bottom: 0.5rem;
    min-width: 120px;
  }
}

@media (max-width: 640px) {
  .content-container {
    max-width: 100%;
    width: 100%;
    /* Force full width */
    padding: 0.75rem;
    /* Reduce padding significantly */
    margin: 0;
    /* Remove auto margin causing centering issues */
    border-radius: 0;
    /* Remove border radius on mobile for full bleed if desired, or keep small */
    min-height: 100vh;
    /* Ensure full height */
    box-sizing: border-box;
    /* Ensure padding is included in width */
  }

  h1 {
    font-size: 1.5rem !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }

  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
    scrollbar-width: none;
    /* Hide scrollbar for cleaner look */
  }

  /* Hide scrollbar for Chrome/Safari */
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    flex: 0 0 auto;
    /* Don't grow, don't shrink, auto basis */
    width: auto;
    margin-right: 0;
    margin-bottom: 0;
    white-space: nowrap;
  }

  /* Adjust header layout */
  header {
    padding-right: 2.5rem;
    /* Make room for keyboard help button */
  }

  /* Adjust flashcards */
  .flashcard {
    height: 200px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  /* Adjust quiz options */
  .quiz-option {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
  }

  /* Adjust call structure components */
  .call-component {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem;
  }

  .drop-zone {
    min-height: 3rem;
    margin-bottom: 0.5rem;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {

  /* Increase tap target sizes */
  button,
  .tab-button,
  .quiz-option,
  .response-option,
  .call-component {
    min-height: 44px;
    /* Apple's recommended minimum touch target size */
  }

  /* Add more space between interactive elements */
  .quiz-option,
  .response-option {
    margin-bottom: 0.75rem;
  }

  /* Make drag and drop more touch-friendly */
  .call-component {
    padding: 0.75rem 1rem;
  }

  .drop-zone {
    min-height: 3.5rem;
    margin-bottom: 0.75rem;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .content-container {
    padding: 0.75rem;
    margin: 0.5rem auto;
  }

  header {
    margin-bottom: 0.75rem !important;
  }

  h1 {
    font-size: 1.25rem !important;
    margin-bottom: 0.25rem !important;
  }

  .nav-tabs {
    margin-bottom: 0.75rem;
  }

  /* Adjust flashcards */
  .flashcard-container {
    height: 180px;
    /* Adjusted height */
    width: 280px;
    margin: 1.5rem auto;
  }

  /* Two-column layout for quiz options */
  #options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .quiz-option {
    flex: 1 1 calc(50% - 0.5rem);
    margin-bottom: 0;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  /* Already dark themed, but could add specific dark mode adjustments here */
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  #three-bg {
    display: none;
  }

  .content-container {
    background: white;
    box-shadow: none;
    margin: 0;
    padding: 1cm;
  }

  .nav-tabs,
  button:not(.print-button) {
    display: none;
  }
}