/* Custom styles for R & R Awning Co */

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

/* Prevent FOUC */
html {
  opacity: 1;
}

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

::-webkit-scrollbar-track {
  background: #f0eeeb;
}

::-webkit-scrollbar-thumb {
  background: #1a5f5f;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #154d4d;
}

/* Scroll indicator animation */
@keyframes scrollIndicator {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(200%);
    opacity: 0;
  }
}

.animate-scroll-indicator {
  animation: scrollIndicator 1.5s ease-in-out infinite;
}

/* Hero content animation */
.hero-content {
  animation: heroFadeIn 1s ease-out forwards;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Nav transition */
.nav-logo-text {
  transition: color 0.3s ease;
}

.nav-logo-sub {
  transition: color 0.3s ease;
}

/* Service card hover */
.service-card {
  transform: translateY(0);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.service-card:hover {
  transform: translateY(-4px);
}

/* Neighborhood card hover */
.neighborhood-card {
  transform: translateY(0);
  transition: transform 0.4s ease;
}

.neighborhood-card:hover {
  transform: translateY(-4px);
}

/* Testimonial card hover */
.testimonial-card {
  transform: translateY(0);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(26, 95, 95, 0.1) !important;
}

/* Mobile menu animations */
.mobile-nav-link {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.menu-open .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
}

body.menu-open .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
body.menu-open .mobile-nav-link:nth-child(2) { transition-delay: 0.15s; }
body.menu-open .mobile-nav-link:nth-child(3) { transition-delay: 0.2s; }
body.menu-open .mobile-nav-link:nth-child(4) { transition-delay: 0.25s; }
body.menu-open .mobile-nav-link:nth-child(5) { transition-delay: 0.3s; }

/* Mobile menu open state */
#mobile-menu.menu-open {
  opacity: 1;
  pointer-events: all;
}

/* Hamburger animation */
body.menu-open .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

body.menu-open .menu-line:nth-child(2) {
  opacity: 0;
}

body.menu-open .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
  width: 1.25rem;
}

/* Scroll reveal animations (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
  }
}

/* Stats animation */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-item {
  animation: countUp 0.6s ease-out forwards;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; }

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #1a5f5f;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection color */
::selection {
  background-color: #1a5f5f;
  color: white;
}

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