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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

h2 {
    color: #3498db;
    margin-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 5px;
}

h3 {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 5px;
}

/* Dashboard layout */
.dashboard {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    height: calc(100vh - 180px); /* 设置固定高度，减去header和状态栏高度 */
    min-height: 600px; /* 最小高度 */
}

.visualization-panel {
    flex: 1 1 65%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.control-panel-container {
    flex: 1 1 30%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%; /* 填充dashboard的高度 */
}

.counter-panel {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.mqtt-panel {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    margin-top: 0; /* 覆盖之前的margin设置 */
}

/* Visualization styles */
.visualization-container {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    flex: 1; /* 填充visualization-panel的高度 */
    display: flex;
    flex-direction: column;
}

#heatmapCanvas {
    display: block;
    width: 100%;
    height: 100%; /* 让canvas填满容器 */
    background: #f0f0f0;
    object-fit: contain;
}

#avgHeatmapCanvas {
    display: block;
    width: 100%;
    height: 100%; /* 让canvas填满容器 */
    background: #f0f0f0;
    object-fit: contain;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#avgOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Counter styles */
.counter-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    flex-grow: 1;
}

.counter-box {
    text-align: center;
    padding: 15px;
    border-radius: 6px;
    background: #f8f9fa;
    width: 45%;
}

.counter-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2980b9;
}

.reset-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    align-self: center;
}

.reset-button:hover {
    background-color: #2980b9;
}

/* Status panel */
.status-panel {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.connection-status, .last-update {
    font-size: 0.9rem;
    color: #7f8c8d;
}

#connectionStatus.connected {
    color: #27ae60;
    font-weight: bold;
}

#connectionStatus.disconnected {
    color: #e74c3c;
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .dashboard {
        flex-direction: column;
        height: auto;
    }
    
    .control-panel-container {
        width: 100%;
    }
    
    .visualization-container {
        height: 400px;
    }
    
    .counter-container {
        flex-direction: column;
        align-items: center;
    }
    
    .counter-box {
        width: 80%;
        margin-bottom: 10px;
    }
    
    .status-panel {
        flex-direction: column;
        gap: 5px;
    }
}

/* Add styles for MQTT settings panel */
.mqtt-settings-container {
    margin-top: 15px;
}

/* Make sure button styles are consistent */
.apply-button, .reset-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.apply-button:hover, .reset-button:hover {
    background-color: #45a049;
}

.apply-button:active, .reset-button:active {
    background-color: #3d8b40;
} 