/* Base styles */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  background-image: url('background_final.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  width: 100%;
  height: 100%;
}

body {
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: transparent;
  width: 100%;
  height: 100%;
}

/* Speed comparison animation */
.speed-bar {
  will-change: transform;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  background-color: #ef4444; /* Tailwind red-500 */
  height: 100%;
  width: 100%;
  position: absolute;
  left: 0;
  top: 0;
}

.speed-track {
  background-color: #f3f4f6; /* Tailwind gray-100 */
  height: 16px;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .container {
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .py-20 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  button {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }

  /* Mobile typography */
  h2 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }

  p {
    font-size: 1.125rem !important;
    line-height: 1.5 !important;
  }

  /* Mobile speed comparison */
  .speed-comparison-mobile {
    padding: 1rem !important;
    margin: 0.5rem 0 !important;
  }

  .speed-track {
    height: 20px !important;
    margin: 0.5rem 0 !important;
  }

  /* Mobile card adjustments */
  .max-w-4xl {
    margin: 1rem !important;
    padding: 1.5rem !important;
  }

  /* Mobile header adjustments */
  nav {
    padding: 1rem !important;
  }

  .text-2xl {
    font-size: 1.5rem !important;
  }

  /* Mobile menu improvements */
  #mobile-menu {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  /* Mobile background adjustments */
  html {
    background-attachment: scroll !important;
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
    height: 100% !important;
  }

  body {
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
    height: 100% !important;
  }

  /* Force full viewport coverage */
  .min-h-screen {
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
    height: 100% !important;
  }

  /* Ensure section covers full height */
  #velocidade {
    min-height: calc(100vh - 6rem) !important;
    min-height: calc(-webkit-fill-available - 6rem) !important;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .hover\:scale-105:hover {
    transform: none;
  }
  
  .hover\:shadow-xl:hover {
    box-shadow: none;
  }
  
  button:active {
    opacity: 0.8;
  }
}

/* Performance optimizations */
* {
  -webkit-overflow-scrolling: touch;
}

/* Prevent pull-to-refresh but allow overscroll glow */
body {
  overscroll-behavior-y: contain;
}

/* Reduce motion if requested */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Fix mobile layout issues */
.min-h-screen {
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* Prevent text selection on interactive elements */
button {
  -webkit-user-select: none;
  user-select: none;
}

/* Mobile menu button */
#mobile-menu-button {
  cursor: pointer;
  padding: 0.5rem;
}

/* Mobile menu transition */
#mobile-menu {
  will-change: transform;
}

/* Additional mobile improvements */
@media (max-width: 768px) {
  /* Improve touch targets */
  a, button {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile navigation improvements */
  .mobile-nav-link {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Mobile speed comparison spacing */
  #speedComparison {
    gap: 1rem;
  }

  /* Mobile card shadow adjustments */
  .shadow-xl {
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }

  /* Mobile text improvements */
  .drop-shadow-lg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  }

  /* Fix mobile viewport issues */
  html, body {
    position: relative;
    overflow-x: hidden;
    width: 100%;
  }
}

/* Landscape mobile optimizations */
@media (max-width: 896px) and (orientation: landscape) {
  .py-20 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  h2 {
    font-size: 1.75rem !important;
  }

  .pt-24 {
    padding-top: 4rem !important;
  }
}

/* Very small screens */
@media (max-width: 375px) {
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .max-w-4xl {
    margin: 0.5rem !important;
    padding: 1rem !important;
  }

  h2 {
    font-size: 1.5rem !important;
  }

  p {
    font-size: 1rem !important;
  }
}

