/* ============================================
   FIMI Taxonomy — Shared styles for standalone pages
   (explorer.html, labeler.html, login.html)
   Matches the Quarto-rendered site aesthetic.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=IBM+Plex+Mono:wght@400;500&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  /* InfoEpi.org brand colors — single source of truth */
  --mulberry: #551638;
  --mulberry-light: #7B2D5F;
  --terrain-green: #27ae60;
  --channel-purple: #8e44ad;

  /* Interface palette */
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-tertiary: #6a6a6a;
  --border-color: #e0e0e0;
  --border-dark: #c0c0c0;

  /* Annotation highlight colors */
  --highlight-function: rgba(85, 22, 56, 0.15);
  --highlight-mechanism: rgba(123, 45, 95, 0.15);
  --highlight-terrain: rgba(39, 174, 96, 0.15);
  --highlight-channel: rgba(142, 68, 173, 0.15);

  /* Typography — match Quarto's Bootstrap stack */
  --font-display: 'Crimson Pro', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout */
  --card-radius: 10px;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ── Header — matches Quarto dark navbar ── */
header {
  background: #343a40;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 3.5rem;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-left a {
  display: flex;
  align-items: center;
}
.header-left img {
  height: 30px;
  width: auto;
}
.header-left h1,
header h1 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.01em;
  margin: 0;
}

/* ── Navigation — matches Quarto navbar links ── */
nav {
  display: flex;
  align-items: center;
  gap: 0;
}
nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  padding: 0.5rem 0.5rem;
  transition: color 0.15s ease-in-out;
}
nav a:hover {
  color: rgba(255, 255, 255, 0.75);
  background: none;
}
nav a.active {
  color: rgba(255, 255, 255, 0.9);
  background: none;
  font-weight: 400;
}

/* ── Common Buttons ── */
.btn {
  padding: 0.4rem 1rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.btn-primary,
.btn-run {
  background: var(--mulberry);
  color: #fff;
  border-color: var(--mulberry);
  box-shadow: 0 2px 4px rgba(85, 22, 56, 0.2);
}
.btn-primary:hover,
.btn-run:hover {
  background: var(--mulberry-light);
  border-color: var(--mulberry-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(85, 22, 56, 0.3);
}
.btn-primary:active,
.btn-run:active {
  transform: translateY(0);
}
.btn-secondary,
.btn-export {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover,
.btn-export:hover {
  border-color: var(--mulberry);
  color: var(--mulberry);
}

/* ── Common Form Elements ── */
input[type="text"],
input[type="password"],
textarea,
select {
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--mulberry);
  box-shadow: 0 0 0 3px rgba(85, 22, 56, 0.1);
}
input::placeholder,
textarea::placeholder {
  color: #aaa;
}

/* ── Panels / Cards ── */
.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}
.panel-title,
.section-title {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.section-title {
  font-size: 1.3rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-tertiary);
}

/* ── Utility ── */
.hidden { display: none !important; }
.empty-state,
.empty-msg {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 0.9rem;
}
.error-msg {
  color: #c0392b;
  padding: 1.5rem;
  font-size: 0.9rem;
}

/* ── Loading Spinner ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--mulberry);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Taxonomy link (back-to-site) ── */
.taxonomy-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: all 0.2s ease;
}
.taxonomy-link:hover {
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ── Responsive: hide nav on mobile ── */
@media (max-width: 768px) {
  nav { display: none; }
  .header-left h1, header h1 { font-size: 1rem; }
}
