/**
 * Comprehensive Responsive Styles
 * Covers all screen sizes: 320px to 2560px+
 */

/* ========================================
   EXTRA SMALL DEVICES (320px - 479px)
   ======================================== */
@media (max-width: 479px) {
  /* Base adjustments */
  body {
    font-size: 14px;
  }

  /* Container adjustments */
  .container {
    padding: 0 0.75rem;
  }

  /* Typography */
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.1rem; }
  h4 { font-size: 1rem; }

  /* Buttons - Touch-friendly sizing */
  button, .btn, a.btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  /* Forms */
  input, textarea, select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
    min-height: 44px;
  }

  /* Cards */
  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  /* Tables - Stack on mobile */
  table {
    font-size: 0.85rem;
  }

  table thead {
    display: none;
  }

  table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
  }

  table td {
    display: block;
    text-align: right;
    padding: 0.5rem 0;
    border: none;
  }

  table td:before {
    content: attr(data-label) ": ";
    font-weight: 700;
    margin-left: 0.5rem;
  }

  /* Images */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Spacing */
  .section {
    padding: 1.5rem 0;
  }
}

/* ========================================
   SMALL DEVICES (480px - 767px)
   ======================================== */
@media (min-width: 480px) and (max-width: 767px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 0 1rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  button, .btn {
    padding: 0.875rem 1.25rem;
  }

  .card {
    padding: 1.25rem;
  }
}

/* ========================================
   MEDIUM DEVICES (768px - 1023px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  body {
    font-size: 15px;
  }

  .container {
    max-width: 720px;
    padding: 0 1.5rem;
  }

  /* Grid adjustments */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   LARGE DEVICES (1024px - 1439px)
   ======================================== */
@media (min-width: 1024px) and (max-width: 1439px) {
  .container {
    max-width: 960px;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   EXTRA LARGE DEVICES (1440px - 1919px)
   ======================================== */
@media (min-width: 1440px) and (max-width: 1919px) {
  .container {
    max-width: 1200px;
  }
}

/* ========================================
   ULTRA WIDE SCREENS (1920px+)
   ======================================== */
@media (min-width: 1920px) {
  .container {
    max-width: 1400px;
  }

  body {
    font-size: 18px;
  }

  h1 { font-size: 3rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 2rem; }
}

/* ========================================
   LANDSCAPE ORIENTATION
   ======================================== */
@media (max-width: 767px) and (orientation: landscape) {
  /* Adjustments for landscape mobile */
  .hero {
    padding: 2rem 0;
  }

  .section {
    padding: 1rem 0;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }

  header, footer, nav, .sidebar, .btn, button {
    display: none !important;
  }

  .main-content {
    width: 100% !important;
    padding: 0 !important;
  }

  a {
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* ========================================
   HIGH DPI DISPLAYS
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper borders and shadows */
  .card, .btn {
    border-width: 0.5px;
  }
}

/* ========================================
   ACCESSIBILITY: REDUCED MOTION
   ======================================== */
@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;
  }
}

/* ========================================
   ACCESSIBILITY: DARK MODE SUPPORT
   ======================================== */
@media (prefers-color-scheme: dark) {
  /* Optional: Add dark mode styles here if needed */
}

/* ========================================
   UTILITY CLASSES FOR RESPONSIVE DESIGN
   ======================================== */

/* Hide on mobile */
.mobile-hide {
  display: block;
}

@media (max-width: 767px) {
  .mobile-hide {
    display: none !important;
  }
}

/* Show only on mobile */
.mobile-only {
  display: none;
}

@media (max-width: 767px) {
  .mobile-only {
    display: block !important;
  }
}

/* Hide on tablet and below */
.tablet-hide {
  display: block;
}

@media (max-width: 1023px) {
  .tablet-hide {
    display: none !important;
  }
}

/* Responsive text alignment */
.text-center-mobile {
  text-align: right;
}

@media (max-width: 767px) {
  .text-center-mobile {
    text-align: center;
  }
}

/* Responsive spacing */
.spacing-mobile {
  padding: 2rem;
}

@media (max-width: 767px) {
  .spacing-mobile {
    padding: 1rem;
  }
}

/* Full width on mobile */
.full-width-mobile {
  width: auto;
}

@media (max-width: 767px) {
  .full-width-mobile {
    width: 100% !important;
  }
}

/* Stack on mobile */
.stack-mobile {
  display: flex;
  flex-direction: row;
}

@media (max-width: 767px) {
  .stack-mobile {
    flex-direction: column;
  }
}

