/* BirdNET-Pi — app.css
   Generated from: tailwind -i src/input.css -o homepage/static/app.css --minify
   Hand-crafted subset. Rebuild on the Pi with: npx tailwindcss -i src/input.css -o homepage/static/app.css --minify */

:root {
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --nav: #1e293b;
  --nav-text: #e2e8f0;
  --nav-active: #93c5fd;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #ea580c;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-2: #1e293b;
    --bg-3: #334155;
    --border: #334155;
    --text: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #64748b;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --nav: #020617;
    --nav-text: #e2e8f0;
    --nav-active: #93c5fd;
    --green: #4ade80;
    --red: #f87171;
    --orange: #fb923c;
  }
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navigation ───────────────────────────────────── */
.site-nav {
  background: var(--nav);
  color: var(--nav-text);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--nav-text);
  margin-right: auto;
  padding: 0.25rem 0;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: background 0.15s;
}

.nav-links a:hover { background: rgba(255,255,255,0.12); }
.nav-links a.active { color: var(--nav-active); font-weight: 600; }

/* ── Main / Footer ────────────────────────────────── */
.site-main {
  flex: 1;
  padding: 1.5rem 1rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.site-footer {
  padding: 0.6rem 1rem;
  text-align: center;
  color: var(--text-3);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ── Typography ───────────────────────────────────── */
h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-hover); }

/* ── Breadcrumb ───────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-2);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb-sep { color: var(--text-3); user-select: none; }

/* ── Tables ───────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--bg-2);
  font-weight: 600;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-2); }

/* ── Badges ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.badge-green  { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--red); }
.badge-orange { background: rgba(249,115,22,0.15); color: var(--orange); }
.badge-gray   { background: var(--bg-3); color: var(--text-2); }

/* ── Alert / Banner ───────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid;
}
.alert-warn    { background: rgba(249,115,22,0.1); border-color: rgba(249,115,22,0.3); color: var(--orange); }
.alert-success { background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.3);  color: var(--green); }
.alert-error   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: var(--red); }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg-2); color: var(--text); }

.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,0.1); color: var(--red); }

.btn-sm { padding: 0.25rem 0.55rem; font-size: 0.75rem; }

.btn-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

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

.card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  gap: 0.5rem;
}
.card-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  text-decoration: none;
  color: var(--text);
}
.card-link .card-icon { font-size: 1.75rem; }

/* ── Forms ────────────────────────────────────────── */
.form-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.form-section h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--text-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.45rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-input-sm { max-width: 10rem; }

.form-textarea { resize: vertical; min-height: 120px; }

.form-hint { font-size: 0.75rem; color: var(--text-3); margin-top: 0.25rem; }

.form-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; margin-bottom: 0.5rem; }
.form-check input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--accent); flex-shrink: 0; }

.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }

/* ── Audio ────────────────────────────────────────── */
audio { height: 2.25rem; max-width: 380px; width: 100%; }

.audio-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.audio-item:last-child { border-bottom: none; }
.audio-meta { color: var(--text-2); font-size: 0.75rem; white-space: nowrap; }
.sg-wrap { display: block; width: 100%; margin-top: 0.5rem; }
.sg-wrap img { max-width: 100%; border-radius: 4px; display: block; height: auto; }

/* ── Spectrogram ──────────────────────────────────── */
#sg-wrapper {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
}
canvas#sg { display: block; width: 100%; height: 60vh; }

.sg-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 0;
  font-size: 0.875rem;
}

/* ── Iframe ───────────────────────────────────────── */
.iframe-fill {
  width: 100%;
  height: calc(100vh - 62px);
  border: none;
  display: block;
}

/* ── Service Controls ─────────────────────────────── */
.service-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.service-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.service-row:last-child { border-bottom: none; }
.service-row:nth-child(even) { background: var(--bg-2); }
.service-name { font-weight: 500; min-width: 200px; font-size: 0.875rem; }
.service-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-left: auto; }

/* ── Command output ───────────────────────────────── */
.cmd-output {
  background: #0d1117;
  color: #e6edf3;
  padding: 1rem;
  border-radius: var(--radius);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 1rem;
}

/* ── Utilities ────────────────────────────────────── */
.text-muted { color: var(--text-2); }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.justify-between { justify-content: space-between; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  .site-main { padding: 1rem 0.75rem; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 0.4rem 0.5rem; }
  h1 { font-size: 1.25rem; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .service-row { flex-direction: column; align-items: flex-start; }
  .service-actions { margin-left: 0; }
  .audio-item { flex-direction: column; align-items: flex-start; }
}
