/* Non-Critical CSS - Below the fold styles */

.animate-fade-up {
  animation: fade-up 1s ease forwards;
}

@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-up {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

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

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

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

/* Mobile menu animations */
.mobile-menu-enter {
  transform: translateX(-100%);
}

.mobile-menu-enter-active {
  transform: translateX(0);
  transition: transform 300ms ease-in-out;
}

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

.mobile-menu-exit-active {
  transform: translateX(-100%);
  transition: transform 300ms ease-in-out;
}

/* Ensure mobile elements stack properly */
@media (max-width: 1023px) {
  .mobile-menu-slide {
    transform: translateX(-100%);
    transition: transform 300ms ease-in-out;
  }

  .mobile-menu-slide.show {
    transform: translateX(0);
  }
}

/* Scroll to top button animations */
#scroll-to-top {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(37, 99, 235, 0.95);
}

#scroll-to-top:hover {
  transform: scale(1.05);
  background: rgba(29, 78, 216, 0.95);
}

#scroll-to-top:active {
  transform: scale(0.95);
  transition-duration: 150ms;
}

/* Better touch targets on mobile */
@media (max-width: 640px) {
  #scroll-to-top {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* Smooth entrance animation */
#scroll-to-top.visible {
  animation: slideUpFade 0.4s ease-out forwards;
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Enhanced form styling */
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px !important;
}

select:focus {
  outline: none;
  ring: 2px;
  ring-color: #3B82F6;
  border-color: #3B82F6;
}

/* Date input styling */
input[type="date"] {
  position: relative;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3e%3cline x1='16' y1='2' x2='16' y2='6'/%3e%3cline x1='8' y1='2' x2='8' y2='6'/%3e%3cline x1='3' y1='10' x2='21' y2='10'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  right: 12px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Checkbox styling */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #D1D5DB;
  border-radius: 4px;
  width: 16px;
  height: 16px;
  position: relative;
  background: white;
  transition: all 0.2s ease;
}

input[type="checkbox"]:checked {
  background-color: #3B82F6;
  border-color: #3B82F6;
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:focus {
  outline: none;
  ring: 2px;
  ring-color: #3B82F6;
  ring-opacity: 0.5;
}

/* Optimize font loading */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Optimize scrolling performance */
.hero-image, .background-image {
  transform: translateZ(0);
  will-change: transform;
}

/* Prevent inappropriate line breaks in link-heavy text */
/* Keep punctuation and short words together with preceding links */
a:after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
}

/* Prevent orphaned punctuation after links */
p, li {
  word-break: normal;
  overflow-wrap: break-word;
  line-break: normal;
}

/* Better text wrapping for link-heavy sentences */
.text-flow a {
  display: inline;
  word-break: keep-all;
}