/* =========================================================================
   VODANOVA SERVICES UK - Custom Design System & Micro-Animations
   Based on hydrology_premium/DESIGN.md & White-Label Service Model
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

:root {
  --color-primary: #00374e;
  --color-primary-container: #0b4f6c;
  --color-secondary: #01baef;
  --color-secondary-hover: #0198c3;
  --color-surface: #f9f9ff;
  --color-surface-low: #f0f3ff;
  --color-on-surface: #111c2c;
  --color-on-surface-variant: #41484d;
  --color-outline: #c0c7ce;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--color-on-surface);
  background-color: var(--color-surface);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Global Word Wrap and Fluid Text Utilities for Multi-language support */
h1, h2, h3, h4, h5, h6, p, a, span, .bento-card, .toast {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Prevent iOS Safari Auto-Zoom on form fields by ensuring 16px minimum on touch/mobile devices */
@media (max-width: 767px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Material Symbols configuration */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}
.material-symbols-outlined.fill {
  font-variation-settings: 'FILL' 1;
}

/* Custom CTA Button Styles */
.btn-primary {
  background-color: var(--color-secondary);
  color: #ffffff;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(1, 186, 239, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover {
  background-color: var(--color-secondary-hover);
  box-shadow: 0 6px 20px rgba(1, 186, 239, 0.45);
  transform: translateY(-2px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-outline:hover {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 55, 78, 0.25);
}

/* Glassmorphism Navigation & Header */
.docked-nav {
  background: rgba(249, 249, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Floating Pill CTA (Mobile Only) */
.mobile-sticky-cta {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  -webkit-transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 450px;
  z-index: 49;
  background: #ffffff;
  border-radius: 28px;
  padding: 10px 10px 10px 18px;
  box-shadow: 0 8px 32px rgba(0, 55, 78, 0.18), 0 2px 8px rgba(1, 186, 239, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(192, 199, 206, 0.35);
  transition: transform 0.3s ease, opacity 0.3s ease;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.mobile-sticky-cta .text-label {
  flex: 1;
  min-width: 0;
}
.mobile-sticky-cta .btn-primary {
  border-radius: 20px;
  flex-shrink: 0;
  padding: 11px 16px;
  font-size: 12px;
  letter-spacing: 0.03em;
  min-height: 44px;
  white-space: nowrap;
}


.floating-whatsapp {
  position: fixed;
  /* sits above CTA pill (64px height + 16px bottom + 8px gap = ~88px) */
  bottom: 90px;
  right: 20px;
  z-index: 48;
  background-color: #25D366;
  color: white;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 768px) {
  .floating-whatsapp {
    bottom: 28px;
    right: 20px;
    width: 56px;
    height: 56px;
  }
}
.floating-whatsapp:hover {
  background-color: #1ebd5a;
  transform: scale(1.08) rotate(-6deg);
  box-shadow: 0 8px 26px rgba(37, 211, 102, 0.6);
}

/* Custom Range Slider for Loyalty Program */
.loyalty-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: #e0e3e4;
  outline: none;
  transition: background 0.3s;
}
.loyalty-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #01baef;
  border: 4px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(1, 186, 239, 0.5);
  transition: transform 0.2s;
}
.loyalty-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 72px;
  right: 16px;
  left: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: #ffffff;
  border-left: 4px solid #01baef;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(17, 28, 44, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-width: unset;
  max-width: 100%;
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}
@media (min-width: 768px) {
  #toast-container {
    left: auto;
    right: 20px;
    width: 400px;
  }
  .toast {
    min-width: 320px;
  }
}
.toast.error {
  border-left-color: #ba1a1a;
}
@keyframes slideInRight {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Bento Grid Card hover effect */
.bento-card {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.bento-card:hover {
  border-color: var(--color-secondary);
  box-shadow: 0 12px 32px rgba(11, 79, 108, 0.08);
  transform: translateY(-4px);
}

/* =========================================================================
   AI CONSULTANT CHAT WIDGET STYLES
   ========================================================================= */

/* Floating Trigger Button */
.ai-widget-trigger {
  position: fixed;
  /* sits above CTA pill */
  bottom: 90px;
  left: 16px;
  /* ensure it doesn't push past WhatsApp on narrow screens */
  max-width: calc(100% - 100px);
  z-index: 46;
  background: linear-gradient(135deg, #00374e, #0b4f6c);
  color: white;
  border: 1.5px solid #01baef;
  padding: 12px 16px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 55, 78, 0.35);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  will-change: transform;
  /* min touch target 44px */
  min-height: 44px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 380px) {
  /* On very narrow screens (360px), hide text, show icon only */
  .ai-trigger-text {
    display: none;
  }
  .ai-widget-trigger {
    padding: 12px;
    max-width: 48px;
    justify-content: center;
  }
}
@media (min-width: 768px) {
  .ai-widget-trigger {
    bottom: 28px;
    right: 90px;
    left: auto;
    max-width: none;
    padding: 12px 22px;
    font-size: 14px;
  }
  .ai-trigger-text {
    display: inline;
  }
}
.ai-widget-trigger:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(1, 186, 239, 0.45);
  background: linear-gradient(135deg, #0b4f6c, #00374e);
}
.ai-pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #22c55e;
  border-radius: 50%;
  position: relative;
}
.ai-pulse-dot::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background-color: rgba(34, 197, 94, 0.4);
  border-radius: 50%;
  animation: pulseDot 2s infinite ease-out;
}
@keyframes pulseDot {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Hide and tuck away sticky elements when AI chat modal is open on mobile */
body.ai-chat-open .mobile-sticky-cta,
body.ai-chat-open .floating-whatsapp,
body.ai-chat-open .ai-widget-trigger {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(30px) !important;
  transition: opacity 0.25s ease, transform 0.25s ease !important;
}

/* AI Chat Modal Window */
.ai-chat-modal {
  position: fixed;
  bottom: 12px;
  right: 12px;
  left: 12px;
  z-index: 70;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(192, 199, 206, 0.4);
  box-shadow: 0 24px 60px rgba(0, 55, 78, 0.28);
  display: flex;
  flex-direction: column;
  /* Use svh (safe viewport height) for iOS Safari — avoids browser chrome overlap */
  height: calc(100svh - 32px);
  max-height: 580px;
  overflow: hidden;
  animation: scaleUpChat 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}
@media (min-width: 768px) {
  .ai-chat-modal {
    width: 400px;
    height: 580px;
    bottom: 96px;
    right: 20px;
    left: auto;
    max-height: none;
  }
}
.ai-chat-modal.hidden {
  display: none !important;
  animation: none !important;
}
#ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* Ensure scroll works on iOS */
  min-height: 0;
}
@keyframes scaleUpChat {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Chat Header */
.ai-chat-header {
  background: linear-gradient(135deg, #00374e, #0b4f6c);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Quick Questions Chips - increased touch target */
.ai-quick-chips {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background-color: #f0f3ff;
  border-bottom: 1px solid rgba(192, 199, 206, 0.3);
  flex-shrink: 0;
}
.ai-quick-chips::-webkit-scrollbar {
  display: none;
}
.ai-chip {
  background: white;
  color: #00374e;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(1, 186, 239, 0.3);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  min-height: 40px;
  display: flex;
  align-items: center;
}
.ai-chip:hover {
  background: #01baef;
  color: white;
  border-color: #01baef;
  transform: translateY(-1px);
}

/* Message Bubbles */
.ai-msg-bubble-ai {
  background: white;
  color: #111c2c;
  border: 1px solid rgba(192, 199, 206, 0.4);
  border-radius: 18px;
  border-top-left-radius: 4px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  line-height: 1.55;
  font-size: 13.5px;
}
.ai-msg-bubble-user {
  background: linear-gradient(135deg, #00374e, #0b4f6c);
  color: white;
  border-radius: 18px;
  border-top-right-radius: 4px;
  padding: 12px 16px;
  margin-left: auto;
  max-width: 82%;
  box-shadow: 0 2px 8px rgba(0, 55, 78, 0.15);
  line-height: 1.5;
  font-size: 13.5px;
}

/* Typing Indicator Dots */
.ai-typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: white;
  border: 1px solid rgba(192, 199, 206, 0.4);
  border-radius: 18px;
  border-top-left-radius: 4px;
  width: fit-content;
}
.ai-typing-dots span {
  width: 7px;
  height: 7px;
  background-color: #01baef;
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}
.ai-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* =========================================================================
   GSAP ANIMATION SUPPORT STYLES
   Floating Drops, Particles, Gradient Orbs, Cursor Glow, Wave Dividers,
   Scroll Indicator & FOUC Prevention
   ========================================================================= */

/* FOUC Prevention — body hidden until GSAP ready */
body {
  visibility: visible; /* fallback if GSAP doesn't load */
}

/* Floating Water Drops */
.floating-drops-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.floating-drop {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(1, 186, 239, 0.35), rgba(1, 186, 239, 0.08));
  box-shadow: inset 0 -2px 4px rgba(1, 186, 239, 0.15), 0 2px 8px rgba(1, 186, 239, 0.1);
  opacity: 0.3;
}

/* Section Particles */
.section-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(1, 186, 239, 0.25);
  box-shadow: 0 0 8px rgba(1, 186, 239, 0.15);
}

/* Gradient Orbs (21st.dev glassmorphism) */
.gradient-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
  -webkit-filter: blur(60px);
  will-change: transform;
}

/* Cursor Glow Trail (desktop) */
.cursor-glow {
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(1, 186, 239, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  will-change: left, top;
  mix-blend-mode: screen;
}

/* Animated Wave Section Dividers */
.wave-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 2;
  line-height: 0;
  overflow: hidden;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Scroll Indicator (hero bottom) */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 5;
  opacity: 0.7;
}

.scroll-indicator-mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
  opacity: 0.5;
}

.scroll-indicator-wheel {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--color-secondary);
}

.scroll-indicator-text {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-on-surface-variant);
  opacity: 0.5;
}

@media (max-width: 767px) {
  .scroll-indicator {
    bottom: 100px; /* above mobile sticky CTA */
  }
  .cursor-glow {
    display: none !important;
  }
}

/* Animated gradient border on badges */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(1, 186, 239, 0.2), 0 0 20px rgba(1, 186, 239, 0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(1, 186, 239, 0.4), 0 0 40px rgba(1, 186, 239, 0.2);
  }
}

/* Enhanced bento card entrance prep (GSAP will control visibility) */
section .bento-card,
section .bg-white.p-8,
.grid > div {
  will-change: transform, opacity;
}
