body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    color: #333;
}

.dashboard-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ecg-monitor {
    background: #2c3e50;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

#ecgCanvas {
    background: #1a2530;
    display: block;
    margin: 10px auto;
    border-radius: 4px;
    border: 1px solid #34495e;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#startBtn { background-color: #2ecc71; color: white; }
#stopBtn { background-color: #e74c3c; color: white; }
#hrValue { font-weight: bold; }

.hrv-dashboard {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 6px;
}

.hrv-dashboard h2 {
    color: #2c3e50;
    margin-top: 0;
    text-align: center;
}

.charts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.chart-wrapper {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 300px; /* Prevents charts from getting too small */
    max-width: 500px;
}

.chart-wrapper h3 {
    font-size: 1em;
    margin-top: 0;
    text-align: center;
    color: #7f8c8d;
}
.alerts-panel {
    background: #fff3cd; /* Light yellow background for the panel */
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
}

.alerts-panel h2 {
    color: #856404;
    margin-top: 0;
}

.alert {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.5s;
}

.alert-tachycardia {
    background-color: #f8d7da; /* Light red */
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-bradycardia {
    background-color: #d1ecf1; /* Light blue */
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-timestamp {
    font-size: 0.8em;
    font-weight: normal;
    opacity: 0.8;
}

.no-alert {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

/* Keyframes for animating the alert appearance */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Class to make the ECG line red */
.alert-active {
    stroke-style: #ff0000 !important; /* Important to override the inline style */
}
