/**
 * Responsive Design - Mobile-first responsive utilities
 * Contains breakpoint-specific styles and utilities
 */

/* Breakpoint Variables */
:root {
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* Base Mobile Styles (< 640px) */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Small screens and up (640px+) */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding: 0 1.5rem;
  }

  /* SM: Display */
  .sm\:block { display: block; }
  .sm\:flex { display: flex; }
  .sm\:hidden { display: none; }
  .sm\:inline-block { display: inline-block; }
  
  /* SM: Flexbox */
  .sm\:flex-col { flex-direction: column; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:justify-center { justify-content: center; }
  .sm\:justify-between { justify-content: space-between; }
  
  /* SM: Grid */
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  
  /* SM: Spacing */
  .sm\:gap-4 { gap: 1rem; }
  .sm\:gap-6 { gap: 1.5rem; }
  .sm\:p-0 { padding: 0; }
  .sm\:p-6 { padding: 1.5rem; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:py-8 { padding-top: 2rem; padding-bottom: 2rem; }
  .sm\:my-8 { margin-top: 2rem; margin-bottom: 2rem; }
  .sm\:mt-0 { margin-top: 0; }
  
  /* SM: Sizing */
  .sm\:w-full { width: 100%; }
  .sm\:max-w-sm { max-width: 24rem; }
  .sm\:max-w-md { max-width: 28rem; }
  .sm\:max-w-lg { max-width: 32rem; }
  .sm\:max-w-xl { max-width: 36rem; }
  .sm\:max-w-2xl { max-width: 42rem; }
  .sm\:max-w-3xl { max-width: 48rem; }
  .sm\:max-w-4xl { max-width: 56rem; }
  
  /* SM: Text */
  .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
  .sm\:text-base { font-size: 1rem; line-height: 1.5rem; }
  .sm\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
  .sm\:text-center { text-align: center; }
  
  /* SM: Layout */
  .sm\:align-middle { vertical-align: middle; }
}

/* Medium screens and up (768px+) */
@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }

  /* MD: Display */
  .md\:block { display: block; }
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:grid { display: grid; }
  
  /* MD: Flexbox */
  .md\:flex-row { flex-direction: row; }
  .md\:flex-col { flex-direction: column; }
  .md\:items-start { align-items: flex-start; }
  .md\:items-center { align-items: center; }
  .md\:justify-start { justify-content: flex-start; }
  .md\:justify-center { justify-content: center; }
  .md\:justify-between { justify-content: space-between; }
  
  /* MD: Grid */
  .md\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  
  /* MD: Spacing */
  .md\:gap-6 { gap: 1.5rem; }
  .md\:gap-8 { gap: 2rem; }
  .md\:space-x-4 > * + * { margin-left: 1rem; }
  .md\:space-x-6 > * + * { margin-left: 1.5rem; }
  .md\:space-y-0 > * + * { margin-top: 0; }
  .md\:p-8 { padding: 2rem; }
  .md\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .md\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
  .md\:mt-0 { margin-top: 0; }
  .md\:mb-0 { margin-bottom: 0; }
  
  /* MD: Sizing */
  .md\:w-auto { width: auto; }
  .md\:w-1\/2 { width: 50%; }
  .md\:w-1\/3 { width: 33.333333%; }
  .md\:w-2\/3 { width: 66.666667%; }
  .md\:max-w-md { max-width: 28rem; }
  .md\:max-w-lg { max-width: 32rem; }
  .md\:max-w-2xl { max-width: 42rem; }
  .md\:max-w-4xl { max-width: 56rem; }
  .md\:max-w-none { max-width: none; }
  
  /* MD: Text */
  .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
  .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
  .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .md\:text-left { text-align: left; }
  
  /* MD: Position */
  .md\:relative { position: relative; }
  .md\:absolute { position: absolute; }
}

/* Large screens and up (1024px+) */
@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
    padding: 0 2rem;
  }

  /* LG: Display */
  .lg\:block { display: block; }
  .lg\:flex { display: flex; }
  .lg\:grid { display: grid; }
  .lg\:hidden { display: none; }
  
  /* LG: Flexbox */
  .lg\:flex-row { flex-direction: row; }
  .lg\:items-start { align-items: flex-start; }
  .lg\:items-center { align-items: center; }
  .lg\:justify-start { justify-content: flex-start; }
  .lg\:justify-between { justify-content: space-between; }
  
  /* LG: Grid */
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  
  /* LG: Spacing */
  .lg\:gap-8 { gap: 2rem; }
  .lg\:space-x-8 > * + * { margin-left: 2rem; }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .lg\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
  
  /* LG: Sizing */
  .lg\:w-1\/2 { width: 50%; }
  .lg\:w-1\/3 { width: 33.333333%; }
  .lg\:w-2\/3 { width: 66.666667%; }
  .lg\:max-w-2xl { max-width: 42rem; }
  .lg\:max-w-4xl { max-width: 56rem; }
  .lg\:max-w-6xl { max-width: 72rem; }
  .lg\:max-w-7xl { max-width: 80rem; }
  
  /* LG: Text */
  .lg\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
  .lg\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .lg\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .lg\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
}

/* Extra large screens and up (1280px+) */
@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }

  /* XL: Grid */
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .xl\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .xl\:grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  
  /* XL: Spacing */
  .xl\:gap-8 { gap: 2rem; }
  .xl\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  
  /* XL: Text */
  .xl\:text-5xl { font-size: 3rem; line-height: 1; }
  .xl\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

/* 2XL screens and up (1536px+) */
@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }

  /* 2XL: Grid */
  .\32xl\:grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .\32xl\:grid-cols-10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}

/* Component Responsive Adjustments */

/* Navigation Responsive */
@media (max-width: 767px) {
  .mobile-nav {
    display: block;
  }
  
  .desktop-nav {
    display: none;
  }
  
  .nav-menu {
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid rgb(229, 231, 235);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }
  
  .nav-menu.active {
    transform: translateY(0);
  }
  
  .dark .nav-menu {
    background: var(--dark-100);
    border-top-color: rgb(75, 85, 99);
  }
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none;
  }
  
  .desktop-nav {
    display: block;
  }
}

/* Card Grid Responsive */
.content-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .content-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1280px) {
  .content-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

/* Hero Section Responsive */
.hero-section {
  padding: 2rem 0;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 4rem 0;
  }
}

@media (min-width: 1024px) {
  .hero-section {
    padding: 6rem 0;
  }
}

/* Modal Responsive */
@media (max-width: 639px) {
  .modal-content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
  }
}

/* Form Responsive */
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Search Responsive */
.search-container {
  width: 100%;
  max-width: 20rem;
}

@media (min-width: 768px) {
  .search-container {
    max-width: 28rem;
  }
}

/* Typography Responsive */
.responsive-text {
  font-size: 1rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .responsive-text {
    font-size: 1.125rem;
    line-height: 1.6;
  }
}

@media (min-width: 1024px) {
  .responsive-text {
    font-size: 1.25rem;
    line-height: 1.7;
  }
}

/* Video Player Responsive */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.video-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Utility Classes for Responsive */
.show-on-mobile {
  display: block;
}

.hide-on-mobile {
  display: none;
}

@media (min-width: 768px) {
  .show-on-mobile {
    display: none;
  }
  
  .hide-on-mobile {
    display: block;
  }
}

/* Touch-friendly Sizing */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .nav-link,
  .dropdown-item {
    min-height: 44px;
    min-width: 44px;
  }
  
  .content-card-action {
    width: 44px;
    height: 44px;
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark Mode Responsive Adjustments */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --theme-preference: dark;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-left,
  .animate-float,
  .animate-glow,
  .animate-particle {
    animation: none !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }
  
  .card {
    border: 1px solid currentColor;
  }
  
  .form-input {
    border: 2px solid currentColor;
  }
}

/* Print Styles */
@media print {
  .no-print,
  .modal-backdrop,
  .modal-container,
  .floating-action,
  .sticky-nav {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    border: 1px solid black;
    box-shadow: none;
  }
}
