/* Pro Safety - Custom CSS */
/* Animations, overrides, and utilities that extend Tailwind */

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

/* ==========================================
   Fade-in animations (hero)
   ========================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

.animate-fade-in-up:nth-child(2) {
  animation-delay: 0.15s;
}

.animate-fade-in-up:nth-child(3) {
  animation-delay: 0.3s;
}

/* ==========================================
   Hero entrance animations (staggered)
   ========================================== */
@keyframes heroFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-animate {
  opacity: 0;
  animation: heroFadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--hero-delay, 0s);
}

/* ==========================================
   Hero background Ken Burns effect
   ========================================== */
@keyframes kenBurns {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.08) translate(-1%, -1%);
  }
  100% {
    transform: scale(1) translate(0, 0);
  }
}

.hero-ken-burns {
  animation: kenBurns 25s ease-in-out infinite;
  will-change: transform;
}

/* ==========================================
   Hero CTA subtle glow pulse
   ========================================== */
@keyframes ctaGlow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
  }
  50% {
    box-shadow: 0 4px 25px rgba(13, 110, 253, 0.5);
  }
}

.hero-cta-glow {
  animation: ctaGlow 3s ease-in-out infinite;
  animation-delay: 2s;
}

/* ==========================================
   Scroll-down indicator bounce
   ========================================== */
@keyframes scrollBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(6px);
  }
  60% {
    transform: translateY(3px);
  }
}

.scroll-bounce {
  animation: scrollBounce 2s ease-in-out infinite;
  animation-delay: 2s;
}

/* ==========================================
   Nav link subtle highlight cycle
   ========================================== */
@keyframes navHighlight {
  0%, 100% {
    color: inherit;
  }
  50% {
    color: #0D6EFD;
  }
}

.nav-link-highlight {
  animation: navHighlight 1.5s ease-in-out;
}

/* ==========================================
   Scroll-triggered animations
   ========================================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   FAQ accordion chevron rotation
   ========================================== */
.faq-icon.rotate-180 {
  transform: rotate(180deg);
}

/* ==========================================
   Navigation dropdown hover fix
   ========================================== */
.group:hover .group-hover\:opacity-100 {
  transition-delay: 0s;
}

/* Ensure dropdown stays visible when moving mouse to it */
nav .group > div {
  padding-top: 0.5rem;
  margin-top: -0.5rem;
}

/* ==========================================
   Mobile dropdown chevron rotation
   ========================================== */
.mobile-dropdown-btn svg.rotate-180 {
  transform: rotate(180deg);
}

/* ==========================================
   Selection colour
   ========================================== */
::selection {
  background-color: #0D6EFD;
  color: white;
}

/* ==========================================
   Focus visible styles
   ========================================== */
:focus-visible {
  outline: 2px solid #0D6EFD;
  outline-offset: 2px;
}

/* ==========================================
   Skip to content (sr-only override)
   ========================================== */
a[href="#main-content"]:focus {
  clip: auto;
  clip-path: none;
  height: auto;
  width: auto;
  overflow: visible;
  white-space: nowrap;
}

/* ==========================================
   Form input focus ring
   ========================================== */
input:focus,
select:focus,
textarea:focus {
  border-color: #0D6EFD;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* ==========================================
   Responsive images
   ========================================== */
img {
  max-width: 100%;
  height: auto;
}

/* ==========================================
   Reduced motion accessibility
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  .hero-ken-burns,
  .hero-animate,
  .hero-cta-glow,
  .scroll-bounce,
  .nav-link-highlight,
  .animate-fade-in,
  .animate-fade-in-up,
  .animate-on-scroll {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================
   Print styles
   ========================================== */
@media print {
  header,
  footer,
  .bg-primary,
  nav {
    display: none !important;
  }
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
}
