/* Custom CSS for RCM Edilizia Website */

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

/* Prevent horizontal overflow */
body {
  overflow-x: hidden;
}

/* Animate on scroll - Initial state */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Animate on scroll - Animated state */
.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Input error state */
.input-error {
  border-color: #ef4444 !important;
}

.error-msg {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Back to top button */
#back-to-top {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top:hover {
  transform: translateY(-3px);
}

/* Custom scrollbar (optional) */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: rgb(48, 46, 47);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(235, 231, 4);
}

/* Focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgb(235, 231, 4);
  outline-offset: 2px;
}

/* Mobile menu animation */
#mobile-menu {
  transition: transform 0.3s ease-in-out;
}

/* Header shadow transition */
#header {
  transition: box-shadow 0.3s ease;
}

/* Portfolio hover effects (desktop only) */
@media (min-width: 1024px) {
  .group:hover img {
    transform: scale(1.05);
  }
}

/* Print styles */
@media print {
  header,
  footer,
  #back-to-top,
  #mobile-menu {
    display: none;
  }
}

/* Utility: Prevent text selection on buttons */
button,
.btn {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Custom radio button styling */
input[type="radio"]:checked {
  accent-color: rgb(235, 231, 4);
}

/* Custom checkbox styling */
input[type="checkbox"]:checked {
  accent-color: rgb(235, 231, 4);
}

/* Loader animation (optional for future use) */
.loader {
  border: 3px solid #f3f3f3;
  border-top: 3px solid rgb(235, 231, 4);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Fix for iOS button styling */
input[type="submit"],
input[type="button"],
button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Smooth transitions for links */
a {
  transition: color 0.2s ease, background-color 0.2s ease;
}

/* Hero Slider Styles */
.hero-slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease-in-out, visibility 0s linear 1s;
  pointer-events: none;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease-in-out, visibility 0s linear 0s;
  pointer-events: auto;
  z-index: 2;
}

.hero-slide img {
  transition: transform 10s ease-out;
  will-change: transform;
}

.hero-slide.active img {
  transform: scale(1.1);
}

/* Slider indicators */
.slider-indicator {
  transition: all 0.3s ease;
  cursor: pointer;
}

.slider-indicator.active {
  background-color: rgb(235, 231, 4);
  transform: scale(1.3);
}

.slider-indicator:hover {
  transform: scale(1.2);
}
