/* ============================================================================
   BLUTDRUCK-APP STYLES
   ============================================================================ */

/* Basis-Layout */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Header */
.header {
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    margin-bottom: 10px;
}

.patient-info {
    color: #666;
    margin-bottom: 5px;
}

/* Patienten-Auswahl */
.patient-selection {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.patient-selection label {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    color: #495057;
}

.patient-selection select {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
}

/* File-Upload */
.file-input {
    margin-bottom: 20px;
    padding: 20px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    text-align: center;
    background-color: #fafafa;
}

.file-input input[type="file"] {
    margin-bottom: 10px;
}

.upload-options {
    margin-top: 10px;
    font-size: 12px;
}

/* Kontrollen */
.controls {
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filter {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f9f9f9;
}

.date-filter label {
    font-weight: bold;
    color: #555;
}

.date-filter input[type="date"] {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Buttons */
.filter-button {
    padding: 8px 16px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.filter-button:hover {
    background-color: #1d4ed8;
}

.reset-button {
    padding: 8px 16px;
    background-color: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.reset-button:hover {
    background-color: #4b5563;
}

.export-button {
    padding: 10px 20px;
    background-color: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
}

.export-button:hover {
    background-color: #b91c1c;
}

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

.stat-card {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card.sys {
    background-color: #fee2e2;
}

.stat-card.dia {
    background-color: #dbeafe;
}

.stat-card.pulse {
    background-color: #dcfce7;
}

.stat-card.classification {
    background-color: #f0f9ff;
}

.stat-card.trends {
    background-color: #f0fdf4;
}

.stat-card.time-analysis {
    background-color: #fefce8;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
}

.stat-card .value {
    font-size: 18px;
    font-weight: bold;
    margin: 5px 0;
}

/* Erweiterte Statistiken */
.advanced-stats {
    margin: 20px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.classification-chart .normal {
    color: #16a34a;
    font-weight: bold;
}

.classification-chart .elevated {
    color: #dc2626;
    font-weight: bold;
}

.time-period {
    margin: 5px 0;
    padding: 5px;
    background-color: rgba(255,255,255,0.5);
    border-radius: 4px;
}

.trend-comparison div {
    margin: 5px 0;
    padding: 5px;
    background-color: rgba(255,255,255,0.5);
    border-radius: 4px;
}

/* Chart */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

/* Legende und Notizen */
.notes {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Export-Sektion */
.export-section {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.export-options {
    margin-top: 10px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* Duplikat-Verwaltung */
.duplicate-section {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    background-color: #fefbf2;
}

/* Nachrichten */
.error {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success {
    background-color: #dcfce7;
    color: #16a34a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification Messages */
.message-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    white-space: pre-line;
    font-family: Arial, sans-serif;
    line-height: 1.4;
}

.message-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.message-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.message-error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .date-filter {
        flex-direction: column;
        gap: 5px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .export-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .message-notification {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 18px;
    }

    .patient-selection,
    .file-input {
        padding: 15px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
    }
}