/* BirdNest Dashboard Styles */
:root {
    --bg: #1a1a2e;
    --surface: #16213e;
    --accent: #0f3460;
    --highlight: #e94560;
    --text: #eee;
    --text-muted: #999;
    --success: #4ecca3;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--accent);
    margin-bottom: 1.5rem;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--text-muted); }

.status {
    background: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

section { margin-bottom: 2rem; }

.stream-container {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.stream {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--accent);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--success);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.visits-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}

.visits-table th,
.visits-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--accent);
}

.visits-table th {
    background: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.visits-table tr:last-child td {
    border-bottom: none;
}

/* Mobile responsive */
@media (max-width: 600px) {
    body { padding: 0.5rem; }
    h1 { font-size: 1.2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 1.5rem; }
    .visits-table th, .visits-table td { padding: 0.5rem; font-size: 0.85rem; }
}

/* Tuning controls */
.tuning-grid {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--accent);
}

.tuning-control {
    margin-bottom: 1rem;
}

.tuning-control label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.tuning-control input[type="range"] {
    width: 100%;
    accent-color: var(--success);
}

.tuning-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.tuning-status {
    margin-left: 1rem;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    background: var(--accent);
    color: var(--text);
    border: 1px solid var(--highlight);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--highlight);
}

/* Timelapse */
.timelapse-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.timelapse-controls select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--accent);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.timelapse-status {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.timelapse-download {
    margin-top: 0.5rem;
}

/* Small button variant */
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    margin-top: 0;
}

/* Disk usage bar */
.disk-section { margin-bottom: 2rem; }

.disk-bar-container {
    background: var(--surface);
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
    border: 1px solid var(--accent);
}

.disk-bar {
    height: 100%;
    background: var(--success);
    border-radius: 8px;
    transition: width 0.5s ease, background 0.5s ease;
    min-width: 2%;
}

.disk-bar.warning { background: #f0a500; }
.disk-bar.critical { background: var(--highlight); }

.disk-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Header status bar */
.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-pill {
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--accent);
    white-space: nowrap;
}

.pill-ok { border-color: var(--success); color: var(--success); }
.pill-warn { border-color: #f0a500; color: #f0a500; }
.pill-crit { border-color: var(--highlight); color: var(--highlight); }
.pill-off { opacity: 0.5; }

/* Video clip player */
.clip-player {
    margin: 0.75rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.clip-video {
    width: 100%;
    max-height: 400px;
    display: block;
}

/* Species section */
.species-section .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/* Danger button */
.btn-danger {
    border-color: var(--highlight);
    color: var(--highlight);
}
.btn-danger:hover {
    background: var(--highlight);
    color: var(--text);
}
