/* ============================================
   MedCare Pharmacy — Stylesheet
   Aesthetic: Refined Medical / Editorial
   Fonts: Fraunces (display) + DM Sans (body)
   ============================================ */

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

:root {
  --cream: #F7F4EE;
  --ink: #1A1A18;
  --ink-light: #5A5A54;
  --green: #0F6E56;
  --green-light: #E1F5EE;
  --green-mid: #1D9E75;
  --border: rgba(26,26,24,0.12);
  --border-strong: rgba(26,26,24,0.25);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

/* ---- NAVBAR ---- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 3rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo {
  font-size: 22px;
  color: var(--green);
}

.nav-name {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-light);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}

.nav-link:hover { color: var(--ink); }

.nav-link.active {
  color: var(--ink);
  font-weight: 500;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--green);
  border-radius: 2px;
}

.voice-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 0.6rem 1.2rem;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.voice-btn:hover { background: var(--green-mid); }
.voice-btn:active { transform: scale(0.98); }

.voice-icon { font-size: 16px; }

/* ---- HERO ---- */
.page { padding: 4rem 3rem; max-width: 1100px; margin: 0 auto; }

.hero {
  padding: 5rem 0 4rem;
  max-width: 680px;
}

.hero-tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-tag::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1.5px;
  background: var(--green);
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}

.hero-title em {
  font-style: italic;
  color: var(--green);
}

.hero-sub {
  font-size: 17px;
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 100px;
  padding: 0.8rem 2rem;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn-primary:hover { background: var(--green); }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-strong);
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover { color: var(--green); border-color: var(--green); }

/* ---- FEATURES ---- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.feature-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 24px;
  color: var(--green);
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.feature-card p {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.6;
}

/* ---- PAGE HEADER ---- */
.page-header {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.page-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -1.5px;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.page-sub {
  font-size: 16px;
  color: var(--ink-light);
}

/* ---- SEARCH ---- */
.search-bar-wrap {
  display: flex;
  gap: 0;
  margin-bottom: 2.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  transition: border-color 0.2s;
}

.search-bar-wrap:focus-within { border-color: var(--green); }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}

.search-input::placeholder { color: var(--ink-light); }

.search-btn {
  background: var(--green);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.search-btn:hover { background: var(--green-mid); }

/* ---- SEARCH RESULTS ---- */
.results-placeholder {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--ink-light);
}

.placeholder-icon {
  font-size: 48px;
  color: var(--border-strong);
  margin-bottom: 1rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.med-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.med-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

.med-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.med-name {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.med-badge {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--green-light);
  color: var(--green);
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.med-generic {
  font-size: 12px;
  color: var(--ink-light);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.med-desc {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.med-meta {
  display: flex;
  gap: 1rem;
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.med-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.med-meta-label {
  color: var(--ink-light);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.med-meta-value {
  font-weight: 500;
  color: var(--ink);
}

.loading-state {
  text-align: center;
  padding: 3rem;
  color: var(--ink-light);
  font-style: italic;
}

.error-state {
  text-align: center;
  padding: 3rem;
  color: #A32D2D;
  background: #FCEBEB;
  border-radius: var(--radius);
  border: 1px solid #F7C1C1;
}

/* ---- ABOUT ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.about-story h2,
.about-values h2,
.about-contact h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  margin-bottom: 1.25rem;
}

.about-story p {
  font-size: 15px;
  color: var(--ink-light);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-content: start;
}

.stat-card {
  background: var(--green);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: white;
}

.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 13px;
  opacity: 0.85;
  font-weight: 400;
}

.about-values {
  grid-column: 1 / -1;
}

.values-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.value-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.value-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 6px;
  flex-shrink: 0;
}

.value-item strong {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.value-item p {
  font-size: 14px;
  color: var(--ink-light);
  margin: 0;
}

.about-contact {
  grid-column: 1 / -1;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
}

.contact-row {
  display: flex;
  gap: 2rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.contact-row:last-child { border-bottom: none; }

.contact-label {
  font-weight: 500;
  min-width: 80px;
  color: var(--ink);
}

/* ---- VOICE AGENT PANEL ---- */
.overlay {
  display: none; /* overlay disabled — page stays fully visible */
}

.overlay.active { display: none; }

.agent-panel {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 360px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(26,26,24,0.15);
  z-index: 200;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.agent-panel.active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.agent-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
}

.agent-name {
  font-weight: 500;
  font-size: 15px;
}

.agent-status {
  font-size: 12px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 5px;
}

.agent-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.agent-close {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--ink-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.agent-close:hover { background: var(--border); }

.agent-transcript {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 180px;
  max-height: 260px;
}

.transcript-msg {
  font-size: 14px;
  line-height: 1.5;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  max-width: 85%;
}

.agent-msg {
  background: var(--green-light);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.user-msg {
  background: var(--ink);
  color: var(--cream);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.agent-controls {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.agent-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 32px;
  flex: 1;
}

.agent-wave span {
  display: block;
  width: 3px;
  background: var(--border-strong);
  border-radius: 3px;
  height: 8px;
  transition: height 0.2s;
}

.agent-wave.speaking span { background: var(--green); }
.agent-wave.speaking span:nth-child(1) { animation: wave 0.8s ease-in-out infinite; }
.agent-wave.speaking span:nth-child(2) { animation: wave 0.8s ease-in-out 0.1s infinite; }
.agent-wave.speaking span:nth-child(3) { animation: wave 0.8s ease-in-out 0.2s infinite; }
.agent-wave.speaking span:nth-child(4) { animation: wave 0.8s ease-in-out 0.3s infinite; }
.agent-wave.speaking span:nth-child(5) { animation: wave 0.8s ease-in-out 0.4s infinite; }

@keyframes wave {
  0%, 100% { height: 8px; }
  50% { height: 28px; }
}

.mic-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.mic-btn:hover { background: var(--green-mid); }
.mic-btn:active { transform: scale(0.95); }
.mic-btn.listening { background: #D85A30; animation: pulse 1.5s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216,90,48,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(216,90,48,0); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .navbar { padding: 1rem 1.5rem; }
  .page { padding: 2rem 1.5rem; }
  .about-grid { grid-template-columns: 1fr; }
  .about-values { grid-column: auto; }
  .about-contact { grid-column: auto; }
  .hero-title { letter-spacing: -1px; }
  .agent-panel { width: calc(100vw - 2rem); right: 1rem; bottom: 1rem; }
}

/* ---- TEXT INPUT IN AGENT PANEL ---- */
.agent-text-form {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  background: white;
}

.agent-text-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.85rem 1rem;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  resize: none;
}

.agent-text-input::placeholder { color: var(--ink-light); }

.agent-send-btn {
  background: none;
  border: none;
  padding: 0.85rem 1rem;
  color: var(--green);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agent-send-btn:hover { color: var(--green-mid); transform: scale(1.1); }
.agent-send-btn:active { transform: scale(0.95); }
.agent-send-btn:disabled { color: var(--border-strong); cursor: default; transform: none; }

.agent-controls {
  border-top: none;
}
