/* Custom Styles for Caixa Afeto */

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

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

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

.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

.animate-fade-in-delay {
  animation: fadeInDelay 0.8s ease-out 0.3s both;
}

/* Header shadow on scroll */
#main-header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Active nav link */
.nav-link.active {
  color: #8ba26e;
  font-weight: 600;
}

/* Form focus states */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #8ba26e;
  box-shadow: 0 0 0 3px rgba(139, 162, 110, 0.1);
}

/* Button hover effects */
button,
a.button {
  transition: all 0.3s ease;
}

/* Scroll to top button animation */
#scroll-top.show {
  opacity: 1;
  pointer-events: auto;
}

/* Loading animation for images */
img {
  transition: opacity 0.3s ease;
}

img:not([src]) {
  opacity: 0;
}

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

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

::-webkit-scrollbar-thumb {
  background: #8ba26e;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7a9160;
}

/* Mobile menu transition */
#mobile-menu {
  transition: all 0.3s ease;
  max-height: 0;
  overflow: hidden;
}

#mobile-menu.active {
  max-height: 500px;
}

/* Selection color */
::selection {
  background-color: #8ba26e;
  color: white;
}

::-moz-selection {
  background-color: #8ba26e;
  color: white;
}

/* Responsive Typography */
@media (max-width: 640px) {
  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 2rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.5rem;
    line-height: 1.4;
  }
}

/* Form validation styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
  border-color: #10b981;
}

/* Accessibility improvements */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #8ba26e;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  header,
  footer,
  #scroll-top,
  #mobile-menu-btn {
    display: none !important;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Performance: Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
