/* Mobile-First Responsive Design for Gamescopia */

/* Touch-friendly interactions */
@media (max-width: 768px) {
  /* Ensure minimum touch target size (44px) */
  .btn, button, .touch-target {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
  }
  
  /* Improve form inputs for mobile */
  input[type="text"], 
  input[type="email"], 
  input[type="password"], 
  input[type="search"],
  textarea, 
  select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s;
  }
  
  input:focus, textarea:focus, select:focus {
    border-color: #7C4585;
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 69, 133, 0.1);
  }
  
  /* Better card layouts */
  .game-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  .game-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }
  
  /* Improved typography scale */
  .mobile-h1 { font-size: 1.875rem; line-height: 1.2; }
  .mobile-h2 { font-size: 1.5rem; line-height: 1.3; }
  .mobile-h3 { font-size: 1.25rem; line-height: 1.4; }
  .mobile-body { font-size: 0.875rem; line-height: 1.5; }
  .mobile-small { font-size: 0.75rem; line-height: 1.4; }
  
  /* Better spacing */
  .mobile-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .mobile-section {
    margin-bottom: 2rem;
  }
  
  /* Improved navigation */
  .mobile-nav-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .mobile-nav-item:active {
    background-color: rgba(124, 69, 133, 0.1);
  }
  
  /* Better search bar */
  .mobile-search {
    width: 100%;
    font-size: 16px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
  }
  
  .mobile-search:focus {
    border-color: #7C4585;
    box-shadow: 0 0 0 3px rgba(124, 69, 133, 0.1);
  }
  
  /* Loading states */
  .loading {
    opacity: 0.6;
    pointer-events: none;
  }
  
  /* Better error states */
  .error-message {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
    margin-bottom: 1rem;
  }
  
  .success-message {
    background-color: #f0fdf4;
    color: #16a34a;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #16a34a;
    margin-bottom: 1rem;
  }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
  .tablet-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .tablet-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Landscape phone optimizations */
@media (max-width: 768px) and (orientation: landscape) {
  .landscape-nav {
    padding: 0.5rem 1rem;
  }
  
  .landscape-content {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .game-cover img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .auto-dark {
    background-color: #1f2937;
    color: #f9fafb;
  }
  
  .auto-dark .game-card {
    background-color: #374151;
    border-color: #4b5563;
  }
}

/* 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 {
  .no-print {
    display: none !important;
  }
  
  .print-friendly {
    background: white !important;
    color: black !important;
  }
}
