/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #e94560;
}

header p {
    font-size: 1.2em;
    opacity: 0.8;
}

/* Status Bar */
.status-bar {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.status-item .label {
    font-weight: 600;
    color: #888;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-item .value {
    font-size: 1.3em;
    font-weight: 700;
    color: #e0e0e0;
}

/* Status coloring */
.status-active {
    color: #28a745 !important;
}

.status-suspended {
    color: #ffc107 !important;
}

.status-error,
.status-empty,
.status-low_battery {
    color: #dc3545 !important;
}

.controller-on {
    color: #17a2b8 !important;
}

.controller-off {
    color: #6c757d !important;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Cards */
.card {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.card h3 {
    margin-bottom: 20px;
    color: #e94560;
}

.chart-card {
    grid-column: span 2;
}

@media (max-width: 1200px) {
    .chart-card {
        grid-column: span 1;
    }
}

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

.control-group {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
}

.control-group h3 {
    color: #e94560;
    margin-bottom: 12px;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-row input {
    background: #16213e;
    border: 1px solid #444;
    border-radius: 6px;
    color: #e0e0e0;
    padding: 8px 12px;
    font-size: 1rem;
    width: 120px;
}

.input-row input:focus {
    border-color: #e94560;
    outline: none;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: #e94560;
    color: white;
}

.btn-primary:hover {
    background: #d63851;
}

.btn-warning {
    background: #ffc107;
    color: #1a1a2e;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.feedback {
    margin-top: 8px;
    font-size: 0.9rem;
    min-height: 1.2em;
}

.feedback.success { color: #28a745; }
.feedback.error { color: #dc3545; }

/* Chart Container */
canvas {
    max-height: 300px;
}

/* Footer */
footer {
    text-align: center;
    color: #888;
    padding: 20px;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .status-bar {
        flex-direction: column;
        align-items: center;
    }

    header h1 {
        font-size: 2em;
    }

    .card {
        padding: 15px;
    }
}
