/* Common Styles for PPO Serve TVCT Website */

/* Font Family Base */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Lato', 'Open Sans', system-ui, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Montserrat', system-ui, sans-serif;
}

/* CTA Button Styles */
.cta-button {
  background: linear-gradient(135deg, #276FBF 0%, #1e5aa8 100%);
  transition: all 0.3s ease;
  font-family: 'Poppins', 'Montserrat', system-ui, sans-serif;
}

.cta-button:hover {
  background: linear-gradient(135deg, #1e5aa8 0%, #276FBF 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 32px 0 rgba(39, 111, 191, 0.25);
}

/* Call Centre Ribbon */
.call-centre-ribbon {
  background: linear-gradient(135deg, #276FBF 0%, #1e5aa8 100%);
  animation: subtle-pulse 3s infinite;
  font-family: 'Poppins', 'Montserrat', system-ui, sans-serif;
  box-shadow: 0 1px 4px rgba(39, 111, 191, 0.15);
  padding: 6px 16px;
  position: relative;
  overflow: hidden;
}

.call-centre-ribbon::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.call-centre-ribbon span,
.call-centre-ribbon a {
  font-weight: 600;
  font-size: 0.9rem;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  color: #ffffff;
  position: relative;
  z-index: 1;
}

.call-centre-ribbon a:hover {
  color: #F4A024;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

.call-centre-ribbon svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
  position: relative;
  z-index: 1;
  color: #F4A024;
}

.call-centre-ribbon .separator {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Alternative color scheme - uncomment to use */
/*
.call-centre-ribbon {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}
*/

@keyframes subtle-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .call-centre-ribbon { animation: none !important; }
  .cta-button { transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Focus Ring */
.focus-ring:focus-visible {
  outline: 3px solid #276FBF;
  outline-offset: 2px;
}

/* Rule Card Hover Effects */
.rule-card {
  transition: all 0.3s ease;
}

.rule-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

/* Brand Blue Background */
.bg-brand-blue {
  background-color: #276FBF;
}

/* NoScript Styles */
.no-js-hidden {
  display: none !important;
}

/* NoScript Banner */
.noscript-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #276FBF;
  color: #fff;
  padding: 8px 12px;
  text-align: center;
  z-index: 9999;
  font-family: 'Lato', 'Open Sans', system-ui, sans-serif;
}

/* Prevent horizontal overflow */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Ensure proper layout for header and footer */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation Styles */
.nav-link {
  font-family: 'Poppins', 'Montserrat', system-ui, sans-serif;
  font-weight: 500;
}

.mobile-nav-link {
  font-family: 'Poppins', 'Montserrat', system-ui, sans-serif;
  font-weight: 500;
}

/* Testimonial and Accent Text */
.testimonial, .accent-text, blockquote {
  font-family: 'Merriweather Sans', system-ui, sans-serif;
}

/* Mobile Menu Container */
#mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  /* Do not force a background color here so Tailwind classes on the element can control theme-specific colors */
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 50;
  min-height: 200px;
  /* Add smooth transitions */
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

#mobile-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dark #mobile-menu { border-top-color: #374151; }

/* Mobile menu link layout */
.mobile-nav-link {
  display: block;
  padding: 0.75rem 0.5rem;
  line-height: 1.4;
}

/* Mobile Menu Overlay */
#mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 45;
  /* Add smooth transitions */
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Menu Button */
#mobile-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  #mobile-menu-btn {
    display: block;
  }
  
  /* Ensure mobile menu is properly positioned */
  #mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
  }
  
  /* Ensure overlay covers the entire screen */
  #mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
  }
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
  /* Left-align the hero paragraph in the footer on mobile */
  footer .text-center > p.text-body-lg {
    text-align: left;
  }
}

/* Enhanced Logo Styles */
.header-logo {
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.header-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Enhanced Header Styles */
header {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header .max-w-7xl {
  min-height: 6rem; /* 96px - matches h-24 */
}

/* Ensure header stays above hero imagery and floating elements */
.sticky-site-header {
  z-index: 1000;
}

/* Logo Container Enhancement */
header .flex.items-center:first-child {
  padding: 0.5rem 0;
}

/* Preloader Styles */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #1e3a8a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  text-align: center;
  color: white;
}

.preloader-logo {
  margin-bottom: 2rem;
  animation: logoFloat 3s ease-in-out infinite;
}

.preloader-logo-img {
  height: 80px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.preloader-spinner {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
}

.spinner-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid #f97316;
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top-color: #3b82f6;
  animation-duration: 1.2s;
  animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  border-top-color: #10b981;
  animation-duration: 0.9s;
}


@keyframes logoFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* Dark mode preloader */
@media (prefers-color-scheme: dark) {
  .preloader {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  }
}

/* Reduced motion support for preloader */
@media (prefers-reduced-motion: reduce) {
  .preloader-logo,
  .spinner-ring {
    animation: none;
  }
  
  .preloader-logo {
    transform: none;
  }
  
  .spinner-ring {
    animation: spin 2s linear infinite;
  }
}
