/* ============================================================
   MedCare — style.css
   ICT171 Assignment 3 — Allan Kibiwott
   Hosted at allankibiwott.net
   ============================================================ */

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

:root {
  --primary:    #0c6fba;
  --primary-dk: #094f88;
  --accent:     #1a9e68;
  --bg:         #f7f9fc;
  --surface:    #ffffff;
  --text:       #1a1f36;
  --muted:      #6b7280;
  --border:     #e5e7eb;
  --hero-grad:  linear-gradient(135deg, #0c6fba 0%, #094f88 60%, #062d55 100%);
  --radius:     12px;
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.14);
  --font:       'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; }

/* ── UTILITIES ── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.section-header p  { color: var(--muted); font-size: 1.05rem; }

/* ── NAVBAR ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { font-size: 1.35rem; font-weight: 700; color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.logo-icon { color: #e63946; }
.nav-links { display: flex; list-style: none; gap: 8px; }
.nav-links a { padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 500; font-size: 0.95rem; transition: background 0.2s, color 0.2s; }
.nav-links a:hover, .nav-links a.active { background: var(--primary); color: #fff; }
.hamburger { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text); }

/* ── HERO ── */
.hero {
  background: var(--hero-grad);
  color: white;
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-content { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; position: relative; z-index: 1; }
.badge { display: inline-block; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35); padding: 6px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 1.2rem; }
.hero-text h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 800; line-height: 1.15; margin-bottom: 1.2rem; }
.hero-text p  { font-size: 1.1rem; opacity: 0.88; max-width: 520px; margin-bottom: 2rem; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; flex-direction: column; gap: 12px; }
.stat-card { background: rgba(255,255,255,0.14); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.25); border-radius: var(--radius); padding: 20px 28px; text-align: center; min-width: 120px; }
.stat-number { display: block; font-size: 1.8rem; font-weight: 800; }
.stat-label  { display: block; font-size: 0.8rem; opacity: 0.8; margin-top: 2px; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { border-color: rgba(255,255,255,0.6); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.btn-outline-white { border-color: rgba(255,255,255,0.6); color: #fff; background: transparent; }
.btn-outline-white:hover { background: rgba(255,255,255,0.15); }
.btn-full { width: 100%; justify-content: center; }

/* ── CARDS ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 1rem; }
.card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; }
.card p  { color: var(--muted); font-size: 0.9rem; line-height: 1.55; margin-bottom: 1rem; }
.card-link { color: var(--primary); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.card-link:hover { text-decoration: underline; }

/* ── TIP SECTION ── */
.tip-section { background: var(--hero-grad); color: white; }
.tip-box { max-width: 700px; margin: 0 auto; text-align: center; }
.tip-label { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; margin-bottom: 1rem; }
.tip-box p { font-size: 1.2rem; line-height: 1.7; opacity: 0.95; margin-bottom: 2rem; min-height: 80px; }

/* ── ABOUT ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.about-text h2 { font-size: 1.9rem; font-weight: 700; margin-bottom: 1rem; }
.about-text p  { color: var(--muted); margin-bottom: 1rem; }
.tech-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-top: 1.5rem; }
.tech-tag { background: var(--primary); color: white; padding: 5px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; }
.server-card { background: #0f172a; border-radius: var(--radius); padding: 28px; color: white; font-family: 'Courier New', monospace; font-size: 0.88rem; box-shadow: var(--shadow-lg); }
.server-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.server-row:last-child { border-bottom: none; }
.status-dot { width: 9px; height: 9px; background: #22c55e; border-radius: 50%; animation: pulse 2s infinite; display: inline-block; margin-right: 6px; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }
.status-green { color: #22c55e; font-weight: 600; }

/* ── PAGE HERO (inner pages) ── */
.page-hero { background: var(--hero-grad); color: white; padding: 60px 0; text-align: center; }
.page-hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 0.5rem; }
.page-hero p  { opacity: 0.85; font-size: 1.05rem; }

/* ── SERVICES ── */
.services-grid { display: grid; gap: 2rem; }
.service-item { display: grid; grid-template-columns: 80px 1fr; gap: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; align-items: start; transition: box-shadow 0.2s; }
.service-item:hover { box-shadow: var(--shadow-md); }
.service-icon { font-size: 2.4rem; text-align: center; }
.service-text h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.6rem; }
.service-text p  { color: var(--muted); margin-bottom: 1rem; }
.service-text ul { padding-left: 1.2rem; color: var(--muted); font-size: 0.9rem; }
.service-text ul li { margin-bottom: 4px; }

/* ── BMI CALCULATOR ── */
.bmi-card { background: rgba(255,255,255,0.12); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.25); border-radius: var(--radius); padding: 32px; max-width: 600px; margin: 0 auto; }
.bmi-inputs { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.input-group { flex: 1; min-width: 140px; }
.input-group label { display: block; color: rgba(255,255,255,0.85); font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.input-group input { width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.15); color: white; font-size: 1rem; }
.input-group input::placeholder { color: rgba(255,255,255,0.5); }
.bmi-result { margin-top: 1.5rem; padding: 1.2rem; border-radius: 8px; text-align: center; font-weight: 600; font-size: 1.05rem; }

/* ── HEALTH TIPS ── */
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 40px; }
.tab-btn { padding: 9px 20px; border-radius: 20px; border: 2px solid var(--border); background: white; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; color: var(--text); }
.tab-btn:hover, .tab-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.tip-article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: transform 0.2s, box-shadow 0.2s; }
.tip-article:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tip-cat-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.8rem; }
.tip-cat-badge.nutrition { background: #fef3c7; color: #92400e; }
.tip-cat-badge.fitness   { background: #dcfce7; color: #166534; }
.tip-cat-badge.mental    { background: #ede9fe; color: #4c1d95; }
.tip-cat-badge.sleep     { background: #dbeafe; color: #1e3a8a; }
.tip-article h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.tip-article p  { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.tip-meta { margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }
.tip-article.hidden { display: none; }

/* ── CONTACT ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-info h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 1rem; }
.contact-info > p { color: var(--muted); margin-bottom: 2rem; }
.info-items { display: flex; flex-direction: column; gap: 16px; margin-bottom: 2rem; }
.info-item { display: flex; align-items: center; gap: 14px; }
.info-icon { font-size: 1.4rem; width: 40px; text-align: center; }
.info-item div { display: flex; flex-direction: column; }
.info-item strong { font-weight: 700; font-size: 0.9rem; }
.info-item span { color: var(--muted); font-size: 0.9rem; }
.emergency-box { background: #fff1f2; border: 2px solid #fda4af; border-radius: 10px; padding: 16px 20px; font-size: 0.9rem; }
.emergency-box strong { color: #be123c; display: block; margin-bottom: 4px; }
.emergency-box p { color: #9f1239; }
.contact-form-wrapper { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--text); }
.required { color: #e63946; }
.form-group input,
.form-group select,
.form-group textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: var(--font); color: var(--text); background: var(--bg); transition: border-color 0.2s; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); background: white; }
.form-group textarea { resize: vertical; }
.form-note { margin-top: 12px; font-size: 0.8rem; color: var(--muted); text-align: center; }

/* ── FOOTER ── */
.footer { background: #0f172a; color: rgba(255,255,255,0.7); padding: 48px 0; font-size: 0.9rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2rem; align-items: center; }
.footer .logo { color: white; font-size: 1.2rem; display: block; margin-bottom: 6px; }
.footer p { font-size: 0.85rem; margin-top: 4px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: rgba(255,255,255,0.65); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.footer-links a:hover { color: white; }
.footer-inner > div:last-child { text-align: right; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: white; padding: 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .hero-content  { grid-template-columns: 1fr; }
  .hero-stats    { flex-direction: row; }
  .stat-card     { flex: 1; }
  .about-grid    { grid-template-columns: 1fr; }
  .contact-grid  { grid-template-columns: 1fr; }
  .footer-inner  { grid-template-columns: 1fr; text-align: center; }
  .footer-inner > div:last-child { text-align: center; }
  .service-item  { grid-template-columns: 1fr; }
  .bmi-inputs    { flex-direction: column; }
}
