/* ===========================
   ErrandDelivery Custom Styles
   Supplements Tailwind CSS
   =========================== */

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

/* ===========================
   Floating WhatsApp Button
   =========================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 50;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float:active {
  transform: scale(0.95);
}

/* Pulse animation for WhatsApp button */
.whatsapp-float::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #25D366;
  z-index: -1;
  animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ===========================
   Fade-In on Scroll Animation
   =========================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay for grid items */
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }

/* ===========================
   Form Focus Styles
   =========================== */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input,
textarea,
select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ===========================
   Mobile Hamburger Menu
   =========================== */
#menu-toggle .hamburger-line {
  transition: all 0.3s ease;
}

#menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

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

#menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

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

#mobile-menu.open {
  max-height: 300px;
}

/* ===========================
   Sticky Navbar Enhanced
   =========================== */
#navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ===========================
   Scroll-to-Top Button
   =========================== */
#scroll-top.show {
  opacity: 1;
  visibility: visible;
}

/* ===========================
   Link & Button Hover Effects
   =========================== */
a {
  transition: color 0.2s ease;
}

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

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

::-webkit-scrollbar-thumb {
  background: #2563EB;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1d4ed8;
}

/* ===========================
   Print Styles
   =========================== */
@media print {
  /* Hide non-essential elements */
  nav,
  #navbar,
  #mobile-menu,
  .whatsapp-float,
  #scroll-top,
  #whatsapp-btn,
  footer,
  .no-print {
    display: none !important;
  }

  /* Reset backgrounds and colors for printing */
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
  }

  /* Ensure links show their URLs */
  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
  }

  /* Prevent page breaks inside cards */
  article {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Remove shadows and gradients */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
    background-image: none !important;
  }

  /* Ensure content fills the page */
  .max-w-7xl {
    max-width: 100% !important;
    padding: 0 !important;
  }
}