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

/* Custom styles for enhanced functionality */
.services-dropdown:hover .services-menu {
  display: block;
}

/* Image comparison slider styles */
#image-comparison-slider {
  user-select: none;
}

#image-comparison-slider:active {
  cursor: ew-resize;
}

/* Project slider transition */
.project-slide {
  transition: background-image 0.5s ease-in-out;
}

/* Form validation styles */
.form-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-success {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Loading animation */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Custom animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Mobile menu animations */
.mobile-menu-enter {
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

.mobile-menu-enter-active {
  transform: translateX(0);
}

.mobile-menu-exit {
  transform: translateX(0);
  transition: transform 0.3s ease-in-out;
}

.mobile-menu-exit-active {
  transform: translateX(-100%);
}

/* Hover effects for service cards */
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #B71C1C;
}

/* Focus styles for accessibility */

/* Mobile menu nav background */
#mobile-menu nav {
  background-color: white !important;
}

/* Mobile menu animations */
#mobile-menu {
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

#mobile-menu:not(.hidden) {
  transform: translateX(0);
}

/* Mobile services menu animation */
#mobile-services-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
}

#mobile-services-menu:not(.hidden) {
  max-height: 300px;
  opacity: 1;
}

/* Services button arrow rotation */
#mobile-services-button svg {
  transition: transform 0.3s ease-in-out;
}

#mobile-services-menu:not(.hidden) + #mobile-services-button svg,
#mobile-services-button:hover svg {
  transform: rotate(180deg);
}

/* Gallery styles */
.gallery-item {
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.gallery-category-btn {
  transition: all 0.3s ease;
}

.gallery-category-btn.active {
  background-color: #D32F2F !important;
  color: white !important;
}

.gallery-category-btn:hover {
  transform: translateY(-2px);
}

/* Gallery modal styles */
#gallery-modal {
  backdrop-filter: blur(5px);
}

#gallery-modal img {
  transition: opacity 0.3s ease;
}

/* Mobile responsive gallery */
@media (max-width: 640px) {
  .gallery-category-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
  
  #gallery-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .gallery-item img {
    height: 12rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  #gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  #gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  #gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Mobile menu blur effect */
body.mobile-menu-open {
  overflow: hidden;
}

body.mobile-menu-open main {
  filter: blur(5px);
  transition: filter 0.3s ease;
}

/* Print styles */
@media print {
  .fixed {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
}
