/* MediCare Free - Global Design System & Custom CSS (Pro Polished & Secure) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --primary: #0F766E;
  --primary-dark: #115E59;
  --primary-light: #14B8A6;
  --secondary: #E0F2FE;
  --secondary-dark: #BAE6FD;
  --accent: #F59E0B;
  --accent-hover: #D97706;
  --background: #F8FAFC;
  --surface: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --success: #10B981;
  --error: #EF4444;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px -5px rgba(15, 118, 110, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 25px -3px rgba(20, 184, 166, 0.35);
  --radius-card: 24px;
  --radius-btn: 14px;
  --radius-input: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.22;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Accessibility Focus Visible Ring */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px !important;
}

/* Glassmorphism Styles with Multi-Layer Borders */
.glass-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.05);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.glass-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--radius-card);
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(20, 184, 166, 0.4);
}

/* Ambient Button Glow */
.btn-glow {
  position: relative;
  transition: var(--transition);
}

.btn-glow:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px) scale(1.02);
}

.btn-glow:active {
  transform: scale(0.98);
}

/* Interactive Navigation Links Underline Animation */
.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2.5px;
  bottom: 0;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 9999px;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Button Micro-interactions */
.btn-hover {
  transition: var(--transition);
}

.btn-hover:hover {
  transform: translateY(-1px) scale(1.02);
}

.btn-hover:active {
  transform: scale(0.98);
}

/* Shimmer Highlight Effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer-text {
  background: linear-gradient(90deg, #0F766E 0%, #14B8A6 50%, #0F766E 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s infinite ease-in-out;
}

/* Animated Gradient Blobs & Heartbeat */
@keyframes blob-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(35px, -45px) scale(1.09);
  }
  66% {
    transform: translate(-25px, 25px) scale(0.94);
  }
}

.animate-blob {
  animation: blob-float 14s infinite ease-in-out;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

@keyframes pulse-heart {
  0%, 100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.15);
  }
  30% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.08);
  }
  60% {
    transform: scale(1);
  }
}

.animate-heartbeat {
  animation: pulse-heart 2s infinite ease-in-out;
}

@keyframes pulse-line {
  0% {
    stroke-dashoffset: 1000;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.pulse-line-anim {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: pulse-line 4s linear infinite;
}

/* Scroll Reveal Elements */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

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

/* Stagger animation utilities */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* Custom Thin Modern Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Floating Badges & Back to Top */
.floating-badge {
  box-shadow: 0 10px 25px -5px rgba(15, 118, 110, 0.3);
}

.back-to-top-btn {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
}

.back-to-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  width: calc(100% - 48px);
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.15);
}

.toast-item.toast-show {
  transform: translateX(0);
  opacity: 1;
}

/* Section Wave Divider */
.section-divider {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.section-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 48px;
}

/* Respect Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Print Styles for Health Guides */
@media print {
  header, footer, .no-print, #toast-container, .floating-badge, .back-to-top-btn, .mobile-bottom-bar, #emergency-banner {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .print-header {
    display: block !important;
    margin-bottom: 2rem;
    border-bottom: 2px solid #0F766E;
    padding-bottom: 1rem;
  }
}
