/* ── CSS variables ── */
:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface2: #ede9e2;
  --border: #d4cfc7;
  --text: #1a1714;
  --text-muted: #6b6560;
  --accent: #2d6a4f;
  --accent-light: #d8f3dc;
  --accent2: #b7791f;
  --tag-bg: #e8f5e9;
  --tag-text: #1b5e20;
  --danger: #c0392b;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --radius: 10px;
  --mono: 'DM Mono', monospace;
  --head: 'Syne', sans-serif;
}
body.dark {
  --bg: #1A252F;
  --surface: #22303c;
  --surface2: #2E4053;
  --border: #3C566B;
  --text: #ECF0F1;
  --text-muted: #8ca5b8;
  --accent: #52b788;
  --accent-light: #1b3a2a;
  --accent2: #f6ad55;
  --tag-bg: #1e3a2a;
  --tag-text: #74c69d;
  --shadow: 0 2px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.35);
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ── Top nav ── */
.top-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 60px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.3s, border-color 0.3s;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: center;
}
.top-menu a {
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--head);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  white-space: nowrap;
}
.top-menu a:hover { color: var(--accent); }

/* Toggle pinned to top-right of nav */
#toggleButton {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
#toggleButton:hover { border-color: var(--accent); color: var(--accent); }

/* Mobile nav */
@media (max-width: 480px) {
  .top-menu {
    height: auto;
    flex-direction: column;
    justify-content: center;
    padding: 10px 16px 8px;
    gap: 8px;
  }
  .nav-links {
    flex-wrap: wrap;
    gap: 10px 16px;
  }
  #toggleButton {
    position: static;
    transform: none;
    margin-bottom: 2px;
  }
}

/* ── Page layout ── */
.page-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}

/* ── Header ── */
.page-header {
  margin-bottom: 32px;
}
.page-header h1 {
  font-family: var(--head);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.page-header h1 span { color: var(--accent); }
.page-header p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Add peptide card ── */
.add-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  transition: background 0.3s, border-color 0.3s;
}
.add-card h2 {
  font-family: var(--head);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Search + dropdown */
.search-row {
  position: relative;
  margin-bottom: 14px;
}
.search-row input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, background 0.3s;
}
.search-row input:focus { border-color: var(--accent); }
.search-row input::placeholder { color: var(--text-muted); }

.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.dropdown.open { display: block; }
.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dropdown-item:hover { background: var(--accent-light); color: var(--accent); }
.dropdown-item .category-tag {
  font-size: 0.72rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 8px;
  border-radius: 20px;
}
.dropdown-empty {
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Dosage row */
.dosage-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.dosage-row input[type="number"] {
  width: 110px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, background 0.3s;
}
.dosage-row input[type="number"]:focus { border-color: var(--accent); }
.dosage-row select {
  padding: 10px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.3s;
}
.dosage-row select:focus { border-color: var(--accent); }
.dosage-row button {
  margin-left: auto;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.dosage-row button:hover { opacity: 0.88; transform: translateY(-1px); }
.dosage-row button:active { transform: translateY(0); }

/* Selected peptide pill */
#selectedPeptide {
  display: none;
  margin-bottom: 14px;
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  align-items: center;
  gap: 8px;
  width: fit-content;
}
#selectedPeptide.visible { display: flex; }
#selectedPeptide button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

/* ── Log section ── */
.log-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.log-header h2 {
  font-family: var(--head);
  font-size: 1.1rem;
  font-weight: 800;
}
.log-header button {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.log-header button:hover { opacity: 1; }

/* Log entries */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.log-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
  transition: background 0.3s, border-color 0.3s;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.log-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.log-name {
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.98rem;
  flex: 1;
}
.log-dose {
  font-size: 0.88rem;
  color: var(--accent2);
  font-weight: 500;
  white-space: nowrap;
}
.log-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.log-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s;
  padding: 0 2px;
}
.log-delete:hover { color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state .icon { font-size: 2rem; margin-bottom: 8px; }

/* scrollbar */
.dropdown::-webkit-scrollbar { width: 6px; }
.dropdown::-webkit-scrollbar-track { background: transparent; }
.dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── General styles (from original styles.css) ── */
body {
  text-align: center;
  margin: 20px;
}

/* ── Auth card ── */
.auth-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.3s, border-color 0.3s;
}
.auth-greeting {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--mono);
}
.auth-greeting strong {
  color: var(--text);
}
#authButton {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#authButton:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Auth modal ── */
.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.auth-modal-overlay.open {
  display: flex;
}
.auth-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 380px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.25s ease;
}
.auth-modal h2 {
  font-family: var(--head);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text);
}
.auth-modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.auth-modal-close:hover { color: var(--text); }

/* Google button */
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.auth-google-btn:hover { border-color: var(--accent); background: var(--accent-light); }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Email row */
.auth-email-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-email-row input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.auth-email-row input:focus { border-color: var(--accent); }
.auth-email-row input::placeholder { color: var(--text-muted); }
.auth-email-row button {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.auth-email-row button:hover { opacity: 0.88; }
.auth-email-row button:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-modal-status {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--accent);
  min-height: 1.2em;
  text-align: center;
}

/* Additional styling for resource page content */
#content {
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

/* ── Footer ── */
.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 20px;
  transition: background 0.3s, border-color 0.3s;
}
.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
}
.footer-copy a {
  color: var(--accent);
  text-decoration: none;
}
.footer-copy a:hover { text-decoration: underline; }
.footer-socials {
  display: flex;
  gap: 10px;
  align-items: center;
}
.footer-social-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}
.footer-social-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-light);
}
.footer-social-btn svg { flex-shrink: 0; }
.footer-donate-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.footer-donate-btn:hover {
  background: var(--accent);
  color: #fff;
}
@media (max-width: 480px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  .footer-socials { flex-wrap: wrap; justify-content: center; }
}
