/*
 * Responsive Design
 * Mobile-first breakpoints
 */

/* Tablet breakpoint: 768px */
@media (max-width: 768px) {
  :root {
    --spacing-xl: 2.5rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
  }

  body {
    font-size: 15px;
  }

  .container {
    padding: var(--spacing-md);
  }

  /* Hide mobile-specific elements on desktop */
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }
}

/* Mobile breakpoint: 480px */
@media (max-width: 480px) {
  :root {
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
    --spacing-3xl: 3rem;
  }

  body {
    font-size: 14px;
  }

  .container {
    padding: var(--spacing-sm);
  }

  h1 {
    font-size: var(--font-4xl);
  }

  h2 {
    font-size: var(--font-3xl);
  }

  h3 {
    font-size: var(--font-2xl);
  }

  h4 {
    font-size: var(--font-xl);
  }

  h5 {
    font-size: var(--font-lg);
  }

  h6 {
    font-size: var(--font-base);
  }

  /* Touch-friendly targets */
  button,
  a,
  .cursor-pointer {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Landscape mobile */
@media (max-width: 896px) and (orientation: landscape) {
  .hero {
    padding: var(--spacing-lg);
  }

  .hero-logo {
    width: 60px;
    height: 60px;
  }

  .hero-title {
    font-size: var(--font-3xl);
  }
}

/* Large desktop breakpoint: 1440px+ */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
}

/* Extra large desktop breakpoint: 1920px+ */
@media (min-width: 1920px) {
  :root {
    --font-base: 1.125rem;
    --font-lg: 1.25rem;
    --font-xl: 1.5rem;
    --font-2xl: 1.75rem;
    --font-3xl: 2rem;
    --font-4xl: 2.5rem;
    --font-5xl: 3.5rem;
  }

  .container {
    max-width: 1600px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body {
    animation: none;
  }

  .glass-card,
  .glass-button,
  .glass-input,
  .video-item,
  .category-card,
  .subcategory-card {
    transition: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-bg-hover: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-primary: rgba(255, 255, 255, 1);
    --text-secondary: rgba(255, 255, 255, 0.9);
  }

  .glass-card,
  .glass-button,
  .glass-input {
    border-width: 2px;
  }
}

/* Dark mode (system preference) */
@media (prefers-color-scheme: dark) {
  /* Already using dark theme by default */
}

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

  .glass-nav,
  .nav-links,
  .admin-nav,
  .glass-button,
  button {
    display: none !important;
  }

  .glass-card,
  .glass-modal,
  .admin-panel {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .video-embed-container {
    border: 1px solid #ccc;
  }

  a {
    color: #0066cc;
    text-decoration: underline;
  }

  .video-reference-content {
    max-height: none;
    overflow: visible;
  }
}

/* Utility classes for responsive display */
.hide-on-mobile {
  display: block;
}

.show-on-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }

  .show-on-mobile {
    display: block !important;
  }
}

.hide-on-tablet {
  display: block;
}

.show-on-tablet {
  display: none;
}

@media (min-width: 481px) and (max-width: 1024px) {
  .hide-on-tablet {
    display: none !important;
  }

  .show-on-tablet {
    display: block !important;
  }
}

.hide-on-desktop {
  display: none;
}

.show-on-desktop {
  display: block;
}

@media (min-width: 1025px) {
  .hide-on-desktop {
    display: none !important;
  }

  .show-on-desktop {
    display: block !important;
  }
}

/* Responsive text alignment */
@media (max-width: 768px) {
  .text-center-mobile {
    text-align: center;
  }

  .text-left-mobile {
    text-align: left;
  }
}

/* Responsive flex direction */
@media (max-width: 768px) {
  .flex-col-mobile {
    flex-direction: column;
  }

  .flex-row-mobile {
    flex-direction: row;
  }
}

/* Responsive spacing */
@media (max-width: 768px) {
  .gap-sm-mobile {
    gap: var(--spacing-sm);
  }

  .gap-md-mobile {
    gap: var(--spacing-md);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .glass-button,
  .admin-action-button,
  .nav-link {
    min-height: 44px;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  /* Remove hover effects on touch devices */
  .glass-card:hover,
  .glass-button:hover,
  .video-item:hover,
  .category-card:hover,
  .subcategory-card:hover {
    transform: none;
  }

  /* Increase spacing for touch comfort */
  .admin-list-item-actions {
    gap: var(--spacing-sm);
  }
}

/* Landscape tablets */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .container {
    max-width: 100%;
    padding: var(--spacing-lg) var(--spacing-xl);
  }

  .hero {
    padding: var(--spacing-xl) var(--spacing-lg);
  }
}

/* Small screens (watches, small phones) */
@media (max-width: 360px) {
  :root {
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.5rem;
  }

  .hero-title {
    font-size: var(--font-2xl);
  }

  .category-title {
    font-size: var(--font-base);
  }

  .glass-button,
  .admin-action-button {
    font-size: var(--font-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
  }
}
