* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0A0A0A;
    color: #FFFFFF;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
.header {
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #A0A0A0;
    font-size: 1rem;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid;
}

.badge.connected {
    border-color: rgba(34, 197, 94, 0.5);
    background-color: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.badge.disconnected {
    border-color: rgba(239, 68, 68, 0.5);
    background-color: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.badge.mode-badge.auto {
    border-color: rgba(234, 179, 8, 0.5);
    background-color: rgba(234, 179, 8, 0.1);
    color: #EAB308;
}

.badge.mode-badge.manual {
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.icon {
    flex-shrink: 0;
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.last-update {
    font-size: 0.75rem;
    color: #666;
}

/* Alerts */
.alert {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    border: 1px solid;
}

.alert-warning {
    border-color: rgba(234, 179, 8, 0.5);
    background-color: rgba(234, 179, 8, 0.1);
    color: #EAB308;
}

.alert-error {
    border-color: rgba(239, 68, 68, 0.5);
    background-color: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.alert-icon {
    flex-shrink: 0;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-description {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Sections */
.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Sensor Grid */
.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.sensor-card {
    background-color: #1A1A1A;
    border: 1px solid #333;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.sensor-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.sensor-card.warning {
    border-color: rgba(234, 179, 8, 0.3);
}

.sensor-card.critical {
    border-color: rgba(239, 68, 68, 0.3);
}

.sensor-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sensor-label {
    font-size: 0.875rem;
    color: #A0A0A0;
}

.sensor-icon {
    width: 20px;
    height: 20px;
}

.sensor-icon.normal {
    color: #22C55E;
}

.sensor-icon.warning {
    color: #EAB308;
}

.sensor-icon.critical {
    color: #EF4444;
}

.sensor-value-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.sensor-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.sensor-unit {
    font-size: 0.875rem;
    color: #666;
}

/* Water Gauge */
.water-gauge-card {
    background-color: #1A1A1A;
    border: 1px solid #333;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.water-gauge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.water-gauge-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #A0A0A0;
    margin-bottom: 0.5rem;
}

.water-gauge-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.water-gauge-status {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.water-gauge-status.good {
    color: #22C55E;
}

.water-gauge-status.medium {
    color: #EAB308;
}

.water-gauge-status.low {
    color: #EF4444;
}

.water-temp {
    text-align: right;
}

.water-temp-label {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.water-temp-value {
    font-size: 1.125rem;
    font-family: 'JetBrains Mono', monospace;
}

.water-gauge-container {
    position: relative;
    height: 128px;
    background-color: #0A0A0A;
    border: 1px solid #333;
    border-radius: 0.5rem;
    overflow: hidden;
}

.water-gauge-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height 0.5s ease;
    background: linear-gradient(to top, rgba(34, 197, 94, 0.8), rgba(34, 197, 94, 0.6));
}

.water-gauge-fill.low {
    background: linear-gradient(to top, rgba(239, 68, 68, 0.8), rgba(239, 68, 68, 0.6));
}

.water-gauge-fill.medium {
    background: linear-gradient(to top, rgba(234, 179, 8, 0.8), rgba(234, 179, 8, 0.6));
}

.water-gauge-markers {
    position: absolute;
    inset: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.marker {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.marker-line {
    width: 8px;
    height: 1px;
    background-color: #444;
}

.marker-text {
    font-size: 0.75rem;
    color: #666;
}

/* Control Grid */
.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.control-card {
    background-color: #1A1A1A;
    border: 1px solid #333;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.control-card.active {
    border-color: rgba(34, 197, 94, 0.3);
    background-color: rgba(34, 197, 94, 0.05);
}

.control-card.disabled {
    opacity: 0.5;
}

.control-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-icon {
    width: 20px;
    height: 20px;
    transition: color 0.3s ease;
}

.control-icon.active {
    color: #22C55E;
}

.control-icon.inactive {
    color: #666;
}

.control-label {
    font-weight: 500;
}

.control-state {
    font-size: 0.75rem;
    color: #666;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #333;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-switch.active {
    background-color: #22C55E;
}

.toggle-switch.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active .toggle-thumb {
    transform: translateX(20px);
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background-color: #1A1A1A;
    border: 1px solid #333;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    color: #666;
    font-size: 0.875rem;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer p {
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .header-content {
        flex-direction: column;
    }

    .sensor-grid,
    .control-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .water-gauge-header {
        flex-direction: column;
        gap: 1rem;
    }

    .water-temp {
        text-align: left;
    }
}