/* ===== Custom Styles for Security Fence ===== */

/* Scroll behavior */
html {
  scroll-behavior: smooth;
}

/* ===== Hero Animations ===== */
.hero-eyebrow {
  animation: slideUp 0.8s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

.hero-headline {
  animation: slideUp 0.8s ease 0.15s forwards;
  opacity: 0;
  transform: translateY(20px);
}

.hero-subtitle {
  animation: slideUp 0.8s ease 0.3s forwards;
  opacity: 0;
  transform: translateY(20px);
}

.hero-ctas {
  animation: slideUp 0.8s ease 0.45s forwards;
  opacity: 0;
  transform: translateY(20px);
}

.hero-trust {
  animation: slideUp 0.8s ease 0.6s forwards;
  opacity: 0;
  transform: translateY(20px);
}

.hero-float-card {
  animation: floatIn 0.8s ease 0.7s forwards;
  opacity: 0;
  transform: translateX(-20px);
}

.hero-img-main {
  animation: fadeIn 1s ease 0.3s forwards;
  opacity: 0;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* ===== Section Animations (Intersection Observer) ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }
.animate-on-scroll.delay-6 { transition-delay: 0.6s; }

/* ===== Navbar ===== */
#navbar {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
  background: rgba(253, 248, 246, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

.nav-link {
  position: relative;
}

/* ===== Service Cards ===== */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: #7B2D3B;
  transition: height 0.4s ease;
}

.service-card:hover::before {
  height: 100%;
}

/* ===== Gallery ===== */
.gallery-item {
  position: relative;
  cursor: pointer;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(123, 45, 59, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* ===== Testimonial Cards ===== */
.testimonial-card {
  transition: transform 0.4s ease, background 0.4s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
}

/* ===== Buttons ===== */
.cta-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.cta-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}

.cta-primary:hover::before {
  left: 100%;
}

/* ===== Form ===== */
input:focus,
select:focus,
textarea:focus {
  border-color: #7B2D3B !important;
  box-shadow: 0 0 0 3px rgba(123, 45, 59, 0.1) !important;
}

/* ===== Mobile Menu ===== */
#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}

#mobileMenu.closed {
  opacity: 0;
  pointer-events: none;
}

.mobile-link {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobileMenu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* ===== Menu Lines Animation ===== */
.menu-line {
  transition: all 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

#menuBtn.active .menu-line:nth-child(2) {
  opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
  width: 6px;
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ===== Decorative Divider ===== */
.section-eyebrow {
  position: relative;
  display: inline-block;
}

.section-eyebrow::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 2px;
  background: #7B2D3B;
}

.section-title {
  position: relative;
}

/* ===== Custom Selection ===== */
::selection {
  background: rgba(123, 45, 59, 0.2);
  color: #1A1412;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
  .hero-float-card {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: 1rem;
    max-width: 100%;
  }

  .about-img-wrapper {
    margin-bottom: 4rem;
  }

  .about-img-wrapper + .absolute {
    position: relative;
    bottom: auto;
    right: auto;
    margin-top: -2rem;
    margin-left: 1rem;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
