/* MedivoTech Custom Styles - Modern HealthTech Theme */

/* Local Self-hosted Plus Jakarta Sans (Variable Font 300..800) - Eliminates Network Waterfall & FOUT */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Zero-CLS Icon Placeholder: Guarantees dimension reservation before Lucide converts to SVG */
i[data-lucide] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
}

:root {
  --primary-color: #0284c7;
  --primary-dark: #0369a1;
  --secondary-color: #0d9488;
  --accent-cyan: #06b6d4;
  --dark-bg: #0b1528;
  --dark-surface: #111f38;
}

/* 1. Root & Viewport Scrolling - Chuẩn Fitts's Law bám sát mép viền, chống co lệch thanh cuộn trên Mobile/iPhone */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* 88px offset cho sticky navbar */
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 5rem;
  }
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
  position: relative;
}

/* 2. Vietnamese Typography Optimization */
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/* Hero Slogan Spacing & Vietnamese Diacritic Preservation */
.hero-slogan-line1 {
  display: block;
}

.hero-slogan-line2 {
  display: inline-block;
  margin-top: 0.65rem;
  padding-bottom: 0.25em;
  margin-bottom: -0.25em;
  padding-right: 0.08em;
}

@media (min-width: 640px) {
  .hero-slogan-line2 {
    margin-top: 1.1rem;
    padding-bottom: 0.25em;
    margin-bottom: -0.25em;
  }
}

p, li {
  text-wrap: pretty;
  hyphens: none;
}

.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

/* 3. Glassmorphism */
.glass-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(241, 245, 249, 1);
}

.glass-dark {
  background: rgba(17, 31, 56, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 4. Gradients */
.gradient-text {
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 50%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding-bottom: 0.25em;
  margin-bottom: -0.25em;
  padding-right: 0.08em;
}

.gradient-hero-bg {
  background: radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.12) 0%, transparent 40%),
              radial-gradient(circle at 20% 80%, rgba(13, 148, 136, 0.08) 0%, transparent 50%),
              #ffffff;
}

.gradient-cta {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #0f172a 100%);
}

/* 5. Animations */
@keyframes pulseSlow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.pulse-slow {
  animation: pulseSlow 4s infinite ease-in-out;
}

@keyframes floatElement {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.float-slow {
  animation: floatElement 5s infinite ease-in-out;
}

/* 6. Glow Badges */
.glow-primary {
  box-shadow: 0 0 25px -5px rgba(2, 132, 199, 0.4);
}

.glow-teal {
  box-shadow: 0 0 25px -5px rgba(13, 148, 136, 0.4);
}

/* 7. FAQ & Interactive Widgets */
.rotate-180 {
  transform: rotate(180deg) !important;
}

.faq-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item:hover {
  border-color: rgba(2, 132, 199, 0.45);
}

.faq-item.active {
  border-color: #0284c7 !important;
  box-shadow: 0 12px 28px -6px rgba(2, 132, 199, 0.12), 0 8px 10px -6px rgba(2, 132, 199, 0.06);
}

.faq-item.active .faq-toggle {
  background: rgba(2, 132, 199, 0.025);
}

.faq-item.active .faq-icon-box {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

/* 8. Floating Quick Actions & Back to Top */
.floating-actions-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.25rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.625rem;
  pointer-events: auto !important;
}

@media (min-width: 640px) {
  .floating-actions-container {
    right: 1.5rem;
  }
}

#backToTopBtn {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  cursor: pointer;
  pointer-events: none;
}

#backToTopBtn:hover {
  color: #0284c7;
  border-color: #0284c7;
  transform: translateY(0) scale(1.08);
  box-shadow: 0 14px 28px -5px rgba(2, 132, 199, 0.35);
}

#backToTopBtn.visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* 9. Utility fallbacks for missing tailwind responsive classes */
@media (min-width: 640px) {
  .sm\:inline {
    display: inline !important;
  }
  .sm\:block {
    display: block !important;
  }
  .sm\:flex {
    display: flex !important;
  }
  .sm\:hidden {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .lg\:flex-row { flex-direction: row !important; }
  .lg\:flex-col { flex-direction: column !important; }
  .lg\:w-72 { width: 18rem !important; }
  .lg\:w-80 { width: 20rem !important; }
  .lg\:col-span-3 { grid-column: span 3 / span 3 !important; }
  .lg\:col-span-4 { grid-column: span 4 / span 4 !important; }
  .lg\:col-span-8 { grid-column: span 8 / span 8 !important; }
  .lg\:col-span-9 { grid-column: span 9 / span 9 !important; }
}

/* 10. Unified Equal Floating Action Buttons (Zalo & Hotline) */
.floating-action-pill {
  width: 156px;
  height: 44px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 6px;
  border-radius: 9999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto !important;
}

.floating-action-pill:hover {
  transform: translateY(-2px) scale(1.03);
}

.floating-pill-zalo {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e0f2fe;
  box-shadow: 0 8px 20px -4px rgba(0, 104, 255, 0.22), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.floating-pill-zalo:hover {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0068ff;
  box-shadow: 0 12px 24px -4px rgba(0, 104, 255, 0.35);
}

.floating-pill-hotline {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #0d9488 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px -4px rgba(2, 132, 199, 0.38), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

.floating-pill-hotline:hover {
  box-shadow: 0 12px 24px -4px rgba(2, 132, 199, 0.52);
  color: #ffffff;
}

.pill-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hotline-icon-box {
  background: rgba(255, 255, 255, 0.22);
}

/* Backward compatibility for any remaining legacy floating-zalo-btn */
.floating-zalo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #e0f2fe;
  box-shadow: 0 10px 25px -5px rgba(0, 104, 255, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  pointer-events: auto !important;
}

.floating-zalo-btn:hover {
  background: #f0f9ff;
  border-color: #bae6fd;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 14px 28px -5px rgba(0, 104, 255, 0.32);
}

/* =========================================================
   11. Elegant Micro-Interactions & Scroll Reveal Animations
   Designed for HealthTech B2B - Professional, Smooth & Zero Jitter
   ========================================================= */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Stagger Delays for Grouped Cards */
.stagger-1 { transition-delay: 100ms; }
.stagger-2 { transition-delay: 200ms; }
.stagger-3 { transition-delay: 300ms; }
.stagger-4 { transition-delay: 400ms; }

/* Interactive Hover Elevation */
.hover-lift {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease;
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 36px -8px rgba(2, 132, 199, 0.18), 0 10px 18px -6px rgba(15, 23, 42, 0.08);
}

/* =========================================================
   12. Hero Section Entrance Animations (Instant on First Load)
   ========================================================= */
@keyframes heroFadeUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeLeft {
  0% {
    opacity: 0;
    transform: translateX(36px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-hero-badge {
  animation: heroFadeDown 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-hero-title {
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.animate-hero-desc {
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.animate-hero-cta {
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.38s both;
}

.animate-hero-badges {
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.52s both;
}

.animate-hero-card {
  animation: heroFadeLeft 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* Subtle Shimmer for High-Priority Action Badges */
@keyframes subtleShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer-badge {
  background-size: 200% 100%;
  background-image: linear-gradient(90deg, rgba(2, 132, 199, 0.1) 0%, rgba(6, 182, 212, 0.25) 50%, rgba(2, 132, 199, 0.1) 100%);
  animation: subtleShimmer 4s infinite linear;
}

/* Accessibility: Honor User's Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hover-lift:hover {
    transform: none !important;
  }
  .pulse-slow, .float-slow, .shimmer-badge,
  .animate-hero-badge, .animate-hero-title, .animate-hero-desc,
  .animate-hero-cta, .animate-hero-badges, .animate-hero-card {
    animation: none !important;
  }
}
