/* Mobile-First Responsive Enhancements */

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .hero__container {
    gap: 2rem;
    padding: 2rem 0;
  }
  
  .hero__title {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .hero__subtitle {
    font-size: 1rem;
  }
  
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
  }
  
  .features__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .feature {
    padding: 1.25rem;
  }
  
  .feature__icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
  }
  
  .section {
    padding: 2.5rem 0;
  }
  
  .navbar__container {
    padding: 0.5rem 0;
  }
  
  .logo-text {
    font-size: 1.25rem;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero__container {
    gap: 2.5rem;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .hero__container {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .hero__container {
    grid-template-columns: 1fr 1fr;
  }
  
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
  
  .features__grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .hero__title {
    font-size: 3.5rem;
  }
}

/* Ultra-wide screens */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-dark: #f7fafc;
    --text-light: #a0aec0;
    --background-light: #1a202c;
    --white: #2d3748;
  }
  
  .navbar {
    background: rgba(26, 32, 44, 0.95);
  }
  
  .feature {
    background: var(--white);
    color: var(--text-dark);
  }
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .btn,
  .nav__toggle {
    display: none !important;
  }
  
  .hero {
    background: none !important;
    color: black !important;
  }
  
  .section {
    page-break-inside: avoid;
  }
  
  a {
    text-decoration: underline !important;
  }
}

/* Focus styles for accessibility */
.btn:focus,
.nav__link:focus,
.nav__toggle:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 2000;
}

.skip-link:focus {
  top: 6px;
}

/* Loading states */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Improved touch targets for mobile */
@media (max-width: 768px) {
  .nav__link,
  .btn,
  .nav__toggle {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .footer__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem;
  }
}

/* Smooth scrolling enhancement */
html {
  scroll-padding-top: 80px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-light);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Selection styles */
::selection {
  background: var(--primary-color);
  color: white;
}

::-moz-selection {
  background: var(--primary-color);
  color: white;
}
