/* Mobile-First Responsive Design Enhancements */

/* Touch-Friendly Button Improvements */
@media (max-width: 768px) {
  .touch-friendly-btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 16px;
  }
  
  /* Improve touch targets for navigation links */
  nav a, .mobile-nav a {
    padding: 12px 8px;
    margin: 4px 0;
  }
  
  /* Better spacing for mobile cards */
  .feature-card {
    padding: 20px 16px;
    margin-bottom: 16px;
  }
  
  /* Optimized text sizes for mobile readability */
  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 1.75rem;
    line-height: 1.3;
  }
  
  h3 {
    font-size: 1.5rem;
    line-height: 1.4;
  }
  
  p {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  /* Better spacing for content sections */
  .content-section {
    padding: 24px 16px;
  }
  
  /* Improved grid layouts for mobile */
  .mobile-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  /* Better image scaling */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Responsive tables */
  .responsive-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Better form controls */
  input, textarea, select {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Optimized modal/overlay for mobile */
  .mobile-modal {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    width: 100vw;
  }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
  .tablet-optimized {
    padding: 32px 24px;
  }
  
  .tablet-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .high-dpi-optimized {
    font-weight: 400;
    text-rendering: optimizeLegibility;
  }
}

/* Landscape phone optimizations */
@media (max-width: 768px) and (orientation: landscape) {
  .landscape-optimized {
    padding: 16px;
  }
  
  .landscape-header {
    height: 60px;
  }
}

/* Focus and accessibility improvements */
@media (max-width: 768px) {
  *:focus {
    outline: 2px solid #ef4298;
    outline-offset: 2px;
  }
  
  /* Better contrast for accessibility */
  .high-contrast {
    color: #1b0d14;
    background: #ffffff;
  }
  
  /* Improved visibility for interactive elements */
  button:hover, a:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    transition: all 0.2s ease;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .dark-mode-text {
    color: #f8f9fa;
  }
  
  .dark-mode-bg {
    background-color: #1a1a1a;
  }
}

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

/* Print styles */
@media print {
  .no-print {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
}

/* Custom scrollbar for mobile webkit */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb {
    background: #ef4298;
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: #d63384;
  }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  .ios-fix {
    -webkit-overflow-scrolling: touch;
  }
  
  input {
    border-radius: 0;
    -webkit-appearance: none;
  }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .android-fix {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }
}

/* Safe area padding for devices with notches */
@supports (padding: max(0px)) {
  .safe-area-padding {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better typography for mobile */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Responsive utility classes */
.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

@media (min-width: 1024px) {
  .mobile-only {
    display: none;
  }
  
  .desktop-only {
    display: block;
  }
}

/* Performance optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-load.loaded {
  opacity: 1;
} 