/* Mobile Optimizations for Extravio Website */

/* Global Background Fix - Highest Priority */
html, body {
  background-color: #000000 !important;
  background: #000000 !important;
  color: #ffffff !important;
}

/* Override any framework background classes */
.bg-gray-100, .bg-gray-200, .bg-gray-300, .bg-gray-400, .bg-gray-500,
.bg-white, .bg-light, .bg-secondary, .bg-primary {
  background-color: #000000 !important;
  background: #000000 !important;
}

/* Ensure Three.js canvas is visible */
#bg-canvas {
  background-color: #000000 !important;
  z-index: -10 !important;
}

/* Ensure main content areas are transparent */
main, .main-content, .container {
  background: transparent !important;
}

/* Mobile Menu - Use extravio-header.css for all mobile menu styling */
/* Removed duplicate mobile menu rules to prevent conflicts */

/* Base Mobile Styles */
@media (max-width: 768px) {
  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden !important;
    background-color: #000000 !important;
    background: #000000 !important;
  }
  
  /* Ensure HTML background is also black */
  html {
    background-color: #000000 !important;
    background: #000000 !important;
  }
  
  /* Optimize viewport for mobile */
  html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }
  
  /* Touch-friendly interactions */
  * {
    -webkit-tap-highlight-color: rgba(255, 165, 0, 0.3);
  }
  
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }
  
  /* Mobile typography */
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  
  /* Headings optimization */
  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  h2 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 0.875rem;
  }
  
  h3 {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
  }
  
  /* Paragraph spacing */
  p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
  }
  
  /* Button optimizations */
  .btn, button, input[type="submit"], input[type="button"] {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  /* Link optimizations */
  a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.3s ease;
  }
  
  /* Form optimizations */
  input, textarea, select {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 165, 0, 0.3);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 100%;
    box-sizing: border-box;
  }
  
  input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
  }
  
  /* Container optimizations */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100%;
  }
  
  /* Card optimizations */
  .feature-card, .card {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
  }
  
  /* Grid optimizations */
  .grid, .card-grid, .forum-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Flexbox optimizations */
  .flex-wrap {
    flex-wrap: wrap;
  }
  
  /* Hide desktop-only elements */
  .desktop-only {
    display: none !important;
  }
  
  /* Show mobile-only elements */
  .mobile-only {
    display: block !important;
  }
    /* General mobile navigation improvements - non-conflicting */
  
  /* Image optimizations */
  img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
  }
  
  /* Video optimizations */
  video {
    max-width: 100%;
    height: auto;
  }
  
  /* Table optimizations */
  table {
    width: 100%;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }
  
  /* Footer optimizations */
  footer {
    padding: 2rem 1rem;
  }
  
  footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  footer nav a {
    margin: 0.25rem;
    font-size: 0.9rem;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  /* Further typography adjustments */
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  /* Tighter container padding */
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Smaller card padding */
  .feature-card, .card {
    padding: 1rem;
  }
  
  /* Smaller button padding */
  .btn, button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Reduce grid gaps */
  .grid, .card-grid, .forum-grid {
    gap: 1rem;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  /* Reduce header height in landscape */
  .extravio-header {
    height: 50px;
  }
  
  /* Adjust hero section padding */
  .hero-section {
    padding-top: 70px;
  }
  
  /* Reduce font sizes slightly */
  h1 {
    font-size: 2.25rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Ensure crisp rendering on retina displays */
  * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  /* Already dark, but ensure consistency */
  body {
    background-color: #000000;
    color: #ffffff;
  }
}

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

/* Print styles */
@media print {
  .nav-links,
  .three-bg,
  #bg-canvas,
  #particles {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .feature-card {
    background: white !important;
    border: 1px solid #ccc !important;
  }
}
