/* Human Simulation Viewer — Dark Theme */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

header {
    background-color: #16213e;
    padding: 1rem 2rem;
    border-bottom: 1px solid #0f3460;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background-color: #16213e;
    border-radius: 8px;
    padding: 1.2rem;
    border: 1px solid #0f3460;
}

.card h3 {
    font-size: 0.85rem;
    color: #8892b0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card .value {
    font-size: 1.6rem;
    font-weight: 700;
}

/* Charts */
.charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-container {
    background-color: #16213e;
    border-radius: 8px;
    padding: 1.2rem;
    border: 1px solid #0f3460;
}

.chart-container h3 {
    font-size: 0.9rem;
    color: #8892b0;
    margin-bottom: 0.8rem;
}

.chart-container canvas {
    width: 100% !important;
    max-height: 220px;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.control-group {
    background-color: #16213e;
    border-radius: 8px;
    padding: 1.2rem;
    border: 1px solid #0f3460;
}

.control-group h3 {
    font-size: 0.9rem;
    color: #8892b0;
    margin-bottom: 0.8rem;
}

.input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

input[type="number"],
select {
    background-color: #1a1a2e;
    color: #e0e0e0;
    border: 1px solid #0f3460;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    outline: none;
    flex: 1;
    min-width: 100px;
}

input[type="number"]:focus,
select:focus {
    border-color: #4a90d9;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background-color: #4a90d9;
    color: #fff;
}

.btn-primary:hover {
    background-color: #3a7bc8;
}

.btn-danger {
    background-color: #d94a4a;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c43a3a;
}

/* Alerts */
.alerts {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.7rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-warning {
    background-color: rgba(255, 152, 0, 0.15);
    border: 1px solid #ff9800;
    color: #ffb74d;
}

.alert-critical {
    background-color: rgba(244, 67, 54, 0.15);
    border: 1px solid #f44336;
    color: #ef9a9a;
}

.alert-emergency {
    background-color: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
    color: #ff5252;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Toggle switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4a90d9;
}

/* Event log */
.event-log {
    list-style: none;
    margin-top: 0.6rem;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.8rem;
    color: #8892b0;
}

.event-log li {
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
}

/* Auto-Eat Log Section */
.auto-eat-section {
    background-color: #16213e;
    border-radius: 8px;
    padding: 1.2rem;
    border: 1px solid #0f3460;
    margin-bottom: 1.5rem;
}

.auto-eat-section h3 {
    font-size: 0.9rem;
    color: #8892b0;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-log-large {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.95rem;
    font-family: monospace;
}

.event-log-large li {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
    color: #ff9800;
}

.log-empty {
    color: #556;
    font-size: 0.9rem;
    font-style: italic;
}

/* Card alert coloring */
.card.alert-warning  { border-color: #ff9800; }
.card.alert-critical { border-color: #f44336; }
.card.alert-emergency { border-color: #f44336; box-shadow: 0 0 12px rgba(244, 67, 54, 0.4); }
