/* ==========================================================
   Dear Health Trust — Custom Enhancements (Tailwind + CSS)
   - Typography (Inter + Poppins)
   - Page transitions (fade-in)
   - Glassmorphism surfaces
   - Subtle background patterns
   - Hover lift + micro-animations
   - Form focus glow
   ========================================================== */

:root {
  --brand-50: #ecfeff;
  --brand-100: #cffafe;
  --brand-200: #a5f3fc;
  --brand-300: #67e8f9;
  --brand-400: #22d3ee;
  --brand-500: #06b6d4;
  --brand-600: #0891b2;
  --brand-700: #0e7490;
  --brand-800: #155e75;
  --brand-900: #164e63;

  --ink: #0f172a; /* slate-900 */
  --muted: #475569; /* slate-600 */

  /* Button Colors */
  --btn-primary-from: #2563eb; /* blue-600 */
  --btn-primary-to: #06b6d4; /* cyan-500 */
  --btn-primary-hover-from: #1d4ed8; /* blue-700 */
  --btn-primary-hover-to: #0891b2; /* cyan-600 */

  --btn-secondary-bg: #ffffff;
  --btn-secondary-text: #0f172a; /* slate-900 */
  --btn-secondary-border: #e2e8f0; /* slate-200 */
  --btn-secondary-hover-bg: #f8fafc; /* slate-50 */
  --btn-secondary-hover-border: #bfdbfe; /* blue-200 */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prefer Poppins for headings for a more premium feel */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Poppins", "Inter", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, Helvetica, Arial;
  letter-spacing: -0.015em;
}

::selection {
  background: rgba(34, 211, 238, 0.25);
}

/* Overall site background (subtle, medical-premium) */
.site-bg {
  background: radial-gradient(
      900px circle at 10% -10%,
      rgba(34, 211, 238, 0.12),
      transparent 55%
    ),
    radial-gradient(
      900px circle at 90% 0%,
      rgba(56, 189, 248, 0.1),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      rgba(236, 254, 255, 0.35),
      rgba(248, 250, 252, 1) 260px
    );
}

/* Page transition */
.page-fade {
  animation: dhtPageFade 520ms ease-out both;
}
@keyframes dhtPageFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .page-fade {
    animation: none;
  }
  * {
    scroll-behavior: auto !important;
  }
  a,
  button {
    transition: none !important;
  }
}

/* ----------------------------------------------------------
   Modern hero / subtle patterns
   ---------------------------------------------------------- */

.hero-pattern,
.page-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate; /* keep patterns behind content */
}

.hero-pattern > *,
.page-hero > * {
  position: relative;
  z-index: 1;
}

.hero-pattern::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
      circle at 20% 10%,
      rgba(34, 211, 238, 0.18),
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(14, 116, 144, 0.14),
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 85%,
      rgba(56, 189, 248, 0.12),
      transparent 45%
    ),
    radial-gradient(rgba(148, 163, 184, 0.22) 1px, transparent 1px);
  background-size: auto, auto, auto, 22px 22px;
  opacity: 0.55;
  filter: blur(0px);
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(236, 254, 255, 0.55),
    rgba(255, 255, 255, 0) 55%
  );
  opacity: 0.9;
}

/* ----------------------------------------------------------
   Glass surfaces + elevated shadows
   ---------------------------------------------------------- */

.glass {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.shadow-soft {
  box-shadow: 0 16px 40px -28px rgba(2, 132, 199, 0.35) !important;
}

.shadow-sm {
  box-shadow: 0 12px 26px -22px rgba(15, 23, 42, 0.3);
}

/* Card lift / micro-interactions */
[data-product-card],
.shadow-sm,
.shadow-soft {
  transition: transform 220ms ease, box-shadow 220ms ease,
    border-color 220ms ease;
  will-change: transform;
}
[data-product-card]:hover,
.shadow-sm:hover,
.shadow-soft:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 22px 48px -30px rgba(2, 132, 199, 0.35);
}

/* ----------------------------------------------------------
   Buttons / links
   ---------------------------------------------------------- */

a,
button {
  transition: transform 180ms ease, box-shadow 180ms ease,
    background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

a:active,
button:active {
  transform: translateY(1px);
}

/* Nav underline animation */
header nav a,
#mobileMenu a {
  position: relative;
}
header nav a::after,
#mobileMenu a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease, opacity 220ms ease;
}
header nav a:hover::after,
header nav a:focus-visible::after,
#mobileMenu a:hover::after,
#mobileMenu a:focus-visible::after {
  opacity: 0.35;
  transform: scaleX(1);
}
header nav a[class*="text-brand-800"]::after {
  opacity: 0.5;
  transform: scaleX(1);
}

/* ----------------------------------------------------------
   Forms (focus glow + refined feel)
   ---------------------------------------------------------- */

input,
select,
textarea {
  background-clip: padding-box;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(100, 116, 139, 0.55) !important; /* slate-500-ish */
}

input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: rgba(8, 145, 178, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.22),
    0 18px 40px -28px rgba(2, 132, 199, 0.45) !important;
}

/* Slightly rounder controls without breaking Tailwind sizes */
input,
select,
textarea {
  border-radius: 0.75rem !important;
}

/* ----------------------------------------------------------
   Nice scrollbars (optional, modern)
   ---------------------------------------------------------- */
@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
    border: 2px solid rgba(248, 250, 252, 1);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
  }
  ::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 1);
  }
}

/* ----------------------------------------------------------
   Semantic Button Classes (refactored)
   ---------------------------------------------------------- */

.btn-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 0.875rem; /* text-sm */
  font-weight: 600; /* font-semibold */
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.btn-primary {
  color: white;
  background-image: linear-gradient(
    to right,
    var(--btn-primary-from),
    var(--btn-primary-to)
  );
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
}

.btn-primary:hover {
  background-image: linear-gradient(
    to right,
    var(--btn-primary-hover-from),
    var(--btn-primary-hover-to)
  );
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04); /* shadow-xl */
  transform: translateY(-2px);
}

.btn-primary:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--brand-100); /* ring-blue-300 equivalent roughly */
}

.btn-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--btn-secondary-border);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
}

.btn-secondary:hover {
  background-color: var(--btn-secondary-hover-bg);
  border-color: var(--btn-secondary-hover-border);
  /* hover:text-blue-600 */
  color: var(--brand-600);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
}

.btn-secondary:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--brand-100);
}
