/**
 * Responsive Styles
 * Mobile-first approach
 */

/* ===== Mobile Base Styles (320px+) ===== */
/* Base styles are in main.css */

/* ===== Small Tablets (640px+) ===== */
@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-6);
  }

  .hero-title {
    font-size: var(--text-5xl);
  }

  .hero-subtitle {
    font-size: var(--text-xl);
  }
}

/* ===== Tablets (768px+) ===== */
@media (min-width: 768px) {
  /* Typography */
  h1 {
    font-size: var(--text-6xl);
  }

  h2 {
    font-size: var(--text-5xl);
  }

  h3 {
    font-size: var(--text-4xl);
  }

  /* Grid */
  .grid-md-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-md-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Hero */
  .hero {
    min-height: 500px;
  }

  .hero-title {
    font-size: var(--text-6xl);
  }

  .hero-subtitle {
    font-size: var(--text-2xl);
  }

  /* Navigation - show desktop nav */
  .nav-list {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }
}

/* ===== Large Tablets / Small Desktops (1024px+) ===== */
@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-8);
  }

  /* Grid */
  .grid-lg-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-lg-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-lg-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Hero */
  .hero {
    min-height: 600px;
  }

  .hero-title {
    font-size: var(--text-7xl);
  }

  /* Sections */
  .section {
    padding: var(--space-20) 0;
  }

  .section-lg {
    padding: var(--space-32) 0;
  }
}

/* ===== Desktops (1280px+) ===== */
@media (min-width: 1280px) {
  .hero-title {
    font-size: calc(var(--text-7xl) * 1.1);
  }
}

/* ===== Mobile Navigation ===== */
@media (max-width: 767px) {
  /* Show mobile menu toggle */
  .menu-toggle {
    display: flex;
  }

  /* Hide desktop navigation */
  .nav-list {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-bg-primary);
    flex-direction: column;
    padding: var(--space-4);
    box-shadow: var(--shadow-lg);
  }

  .nav-list.active {
    display: flex;
  }

  .nav-link {
    padding: var(--space-3) var(--space-4);
    width: 100%;
  }

  /* Mobile hero adjustments */
  .hero {
    min-height: 400px;
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  /* Mobile grid - single column */
  .grid {
    grid-template-columns: 1fr;
  }

  /* Mobile sections */
  .section {
    padding: var(--space-12) 0;
  }

  .section-lg {
    padding: var(--space-16) 0;
  }

  /* Mobile cards */
  .card {
    padding: var(--space-4);
  }

  /* Mobile buttons */
  .btn {
    width: 100%;
    text-align: center;
  }

  .btn-group .btn {
    margin-bottom: var(--space-2);
  }

  /* Mobile forms */
  .form-group {
    margin-bottom: var(--space-4);
  }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets */
  .btn,
  .nav-link,
  .form-input,
  .form-select,
  .form-textarea {
    min-height: 44px;
  }

  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }
}

/* ===== Print Styles ===== */
@media print {
  /* Hide navigation and footer */
  .header,
  .footer,
  .menu-toggle,
  .btn {
    display: none;
  }

  /* Adjust colors for print */
  body {
    color: #000;
    background: #fff;
  }

  /* Remove shadows */
  .card,
  .hero {
    box-shadow: none;
  }

  /* Page breaks */
  .section {
    page-break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  /* Show links */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
  }
}

/* ===== 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;
  }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
  :root {
    --color-text-primary: #000;
    --color-bg-primary: #fff;
    --color-border: #000;
  }

  .btn {
    border: 2px solid currentColor;
  }
}
