/* ═══════════════════════════════════════════════════════════════
   ULTRA MODERN LIGHT THEME — Neonatology App
   Bright · Premium · Interactive · 2025
   ═══════════════════════════════════════════════════════════════ */

/* ── FONT IMPORT ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS CUSTOM PROPERTIES ──────────────────────────────────── */
:root {
  --bg: #f0f9ff;
  --bg-surface: #ffffff;
  --bg-alt: #f8fafc;
  --border: rgba(13, 148, 136, 0.12);
  --border-md: rgba(13, 148, 136, 0.2);
  --accent-v: #0369a1;
  --accent-i: #0d9488;
  --accent-c: #0284c7;
  --accent-e: #10b981;
  --text-1: #0f172a;
  --text-2: #334155;
  --text-3: #475569;
  --text-4: #64748b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(13, 148, 136, 0.07);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(13, 148, 136, 0.12);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.08), 0 24px 48px rgba(13, 148, 136, 0.18);
  --radius: 16px;
  --radius-lg: 22px;
  --radius-full: 99px;
  --header-h: 68px;
}

/* ── RESET & BASE ────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 70% 45% at 5% 0%, rgba(99, 102, 241, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 100%, rgba(8, 145, 178, 0.07) 0%, transparent 55%);
}

/* ── SKIP LINK (accessibility) ───────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--accent-i);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* ════════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════════ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 20px rgba(99, 102, 241, 0.06);
  z-index: 500;
  transition: box-shadow 0.2s;
}

.header.scrolled {
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.9), 0 8px 32px rgba(99, 102, 241, 0.12);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  color: var(--accent-v);
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.25));
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent-i), var(--accent-v), var(--accent-c));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.logo-developer {
  font-size: 0.68rem;
  color: var(--text-3);
  line-height: 1;
}

.logo-developer a {
  color: inherit;
  text-decoration: none;
}

.logo-developer strong {
  font-weight: 600;
  color: var(--accent-i);
}

/* Desktop Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-i);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--accent-i), var(--accent-v));
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-md);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-3);
  transition: all 0.18s ease;
}

.theme-toggle:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent-i);
  color: var(--accent-i);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  place-items: center;
  cursor: pointer;
  color: var(--text-2);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

/* ════════════════════════════════════════════════════════════════
   HERO SECTION
   ════════════════════════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  padding-bottom: 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: transparent;
}

/* Animated background blobs */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 55% at 15% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 75%, rgba(8, 145, 178, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 70% 10%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  pointer-events: none;
  animation: blob-drift 12s ease-in-out infinite alternate;
}

@keyframes blob-drift {
  from {
    transform: scale(1) translate(0, 0);
  }

  to {
    transform: scale(1.03) translate(8px, -8px);
  }
}

.hero .container {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-i);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.5s ease both;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
  }
}

/* Hero Title */
.hero-title {
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-1);
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.5s 0.1s ease both;
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent-i) 0%, var(--accent-v) 55%, var(--accent-c) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
  }
}

/* Hero Subtitle */
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-3);
  max-width: 540px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  animation: fadeInUp 0.5s 0.2s ease both;
}

/* Hero CTA buttons */
.hero-actions {
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
  animation: fadeInUp 0.5s 0.3s ease both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: -0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-i), var(--accent-v));
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 28px rgba(79, 70, 229, 0.42), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background: #fff;
  color: var(--accent-i);
  border: 1.5px solid rgba(99, 102, 241, 0.25);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--accent-i);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.25rem 2.5rem;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  animation: fadeInUp 0.5s 0.4s ease both;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0 2rem;
  border-right: 1px solid var(--border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent-i), var(--accent-v));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════
   TOOLS SECTION
   ════════════════════════════════════════════════════════════════ */
.tools-section {
  padding: 5rem 0;
  background: var(--bg-surface);
  position: relative;
}

.tools-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.2), transparent);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-1);
  margin-bottom: 0.6rem;
}

.section-title span {
  background: linear-gradient(135deg, var(--accent-i), var(--accent-v));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-description {
  font-size: 1rem;
  color: var(--text-3);
  max-width: 480px;
  margin: 0 auto;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 560px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* Tool Card */
.tool-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s ease,
    border-color 0.22s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

/* Top gradient bar */
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-i), var(--accent-v), var(--accent-c));
  opacity: 0;
  transition: opacity 0.2s;
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.25);
}

.tool-card:hover::before {
  opacity: 1;
}

/* Tool Icon */
.tool-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(124, 58, 237, 0.07));
  border: 1px solid rgba(99, 102, 241, 0.12);
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
  color: var(--accent-i);
  transition: all 0.2s;
}

.tool-card:hover .tool-icon {
  background: linear-gradient(135deg, var(--accent-i), var(--accent-v));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
  transform: scale(1.08) rotate(-3deg);
}

.tool-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  transition: stroke 0.2s;
}

.tool-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  transition: color 0.18s;
}

.tool-card:hover .tool-title {
  color: var(--accent-i);
}

.tool-description {
  font-size: 0.875rem;
  color: var(--text-3);
  line-height: 1.65;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-i);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.15);
  transition: all 0.18s ease;
  width: fit-content;
}

.tool-link svg {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 0.18s;
}

.tool-link:hover {
  background: linear-gradient(135deg, var(--accent-i), var(--accent-v));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.28);
  gap: 0.6rem;
}

.tool-link:hover svg {
  transform: translateX(3px);
}

/* ════════════════════════════════════════════════════════════════
   ABOUT SECTION
   ════════════════════════════════════════════════════════════════ */
.about-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, #f0f6ff 0%, #f5f3ff 50%, #ecfeff 100%);
  position: relative;
  overflow: hidden;
}

.about-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(124, 58, 237, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(8, 145, 178, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.about-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.about-content p {
  color: var(--text-2);
  font-size: 1.0625rem;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.about-features {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.feature {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-1);
  background: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}

.feature:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  width: 1rem;
  height: 1rem;
  color: var(--accent-e);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   BOTTOM TAB BAR (mobile)
   ════════════════════════════════════════════════════════════════ */
.bottom-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-top: 1px solid rgba(99, 102, 241, 0.12);
  box-shadow: 0 -4px 24px rgba(99, 102, 241, 0.08);
  padding: 0.5rem 0;
  padding-bottom: env(safe-area-inset-bottom, 0.5rem);
  z-index: 400;
  justify-content: space-around;
  align-items: center;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-4);
  font-size: 0.65rem;
  font-weight: 600;
  transition: all 0.18s ease;
  letter-spacing: 0.03em;
}

.tab-item svg {
  width: 1.4rem;
  height: 1.4rem;
  stroke-width: 1.8;
  transition: all 0.18s;
}

.tab-item:hover {
  color: var(--accent-i);
}

.tab-item.active {
  color: var(--accent-i);
  background: rgba(99, 102, 241, 0.08);
}

.tab-item.active svg {
  stroke-width: 2.2;
}

/* ════════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════════ */
.footer {
  background: var(--text-1);
  color: rgba(255, 255, 255, 0.6);
  padding: 3.5rem 0 0;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
}

.footer-content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: 1.5fr 1fr 1.5fr;
  }
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}

.footer-col p {
  font-size: 0.875rem;
  line-height: 1.7;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #a78bfa;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ════════════════════════════════════════════════════════════════
   SHARED ELEMENT STYLES
   ════════════════════════════════════════════════════════════════ */
/* input */
input,
select,
textarea {
  font-family: inherit;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: var(--text-1);
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  transition: all 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-v);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

/* scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 99px;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.25);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.45);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .nav {
    display: none;
  }

  .mobile-menu-btn {
    display: grid;
  }

  .nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
    z-index: 499;
    gap: 0.25rem;
    animation: slideDown 0.18s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }

    to {
      opacity: 1;
    }
  }

  .nav.open .nav-link {
    border-radius: 10px;
    padding: 0.7rem 1rem;
  }

  .bottom-tab-bar {
    display: flex;
  }

  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    padding: 1rem !important;
    width: 100%;
  }

  .stat-item {
    padding: 0.5rem;
    border-right: none;
    border-bottom: none;
  }

  .hero-actions .btn {
    flex: 1;
    min-width: 140px;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 2rem);
    padding-bottom: 4rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .tools-section,
  .about-section {
    padding: 3.5rem 0;
  }

  .tool-card {
    padding: 1.25rem;
  }

  .about-features {
    flex-direction: column;
    align-items: center;
  }
}

/* Base safe area padding for bottom bar overlay */
@media (max-width: 768px) {
  body {
    padding-bottom: env(safe-area-inset-bottom, 5.5rem);
  }
}