/* Brandschutz Analyzer - Frontend Styles */

.bsa-analyzer {
    max-width: 760px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Steps */
.bsa-step {
    display: none;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.bsa-step.bsa-active {
    display: block;
}

.bsa-step-title {
    font-size: 1.3em;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #0073aa;
    color: #0073aa;
}

/* Fields */
.bsa-field {
    margin-bottom: 18px;
}

.bsa-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.bsa-field input[type="text"],
.bsa-field input[type="email"],
.bsa-field input[type="number"],
.bsa-field input[type="url"],
.bsa-field select,
.bsa-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.bsa-field input:focus,
.bsa-field select:focus,
.bsa-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.15);
}

.bsa-hint {
    display: block;
    font-size: 0.82em;
    color: #888;
    margin-top: 3px;
}

/* Checkboxes */
.bsa-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bsa-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.bsa-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Buttons */
.bsa-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    background: #f0f0f0;
    color: #333;
}

.bsa-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.bsa-btn-next,
.bsa-btn-submit {
    background: #0073aa;
    color: #fff;
}

.bsa-btn-next:hover,
.bsa-btn-submit:hover {
    background: #005a87;
}

.bsa-btn-primary {
    background: #28a745;
    color: #fff;
    font-size: 1.05em;
    padding: 14px 28px;
}

.bsa-btn-primary:hover {
    background: #218838;
}

.bsa-btn-prev {
    background: transparent;
    border: 1px solid #ccc;
    color: #666;
}

.bsa-btn-prev:hover {
    background: #f8f8f8;
}

.bsa-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    gap: 12px;
}

/* Loading */
.bsa-loading {
    text-align: center;
    padding: 60px 20px;
}

.bsa-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: bsa-spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes bsa-spin {
    to { transform: rotate(360deg); }
}

/* Result */
.bsa-result {
    margin-top: 30px;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bsa-result h2 {
    font-size: 1.4em;
    margin: 0 0 20px 0;
    color: #333;
}

.bsa-status-banner {
    padding: 16px 20px;
    border-radius: 6px;
    color: #fff;
    font-size: 1.15em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
}

.bsa-status-banner.status-green {
    background: #28a745;
}

.bsa-status-banner.status-yellow {
    background: #ffc107;
    color: #333;
}

.bsa-status-banner.status-red {
    background: #dc3545;
}

.bsa-result-section {
    margin-bottom: 25px;
}

.bsa-ai-summary {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
    border: 1px solid #b8d4e8;
    border-radius: 8px;
    padding: 16px 20px;
}

.bsa-ai-summary h3 {
    color: #1a5276 !important;
    border-bottom-color: #b8d4e8 !important;
}

.bsa-ai-summary .bsa-analysis-text {
    background: rgba(255, 255, 255, 0.7);
    border-left-color: #2980b9;
    font-size: 0.95em;
    line-height: 1.7;
}

.bsa-result-section h3 {
    font-size: 1.05em;
    color: #0073aa;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.bsa-result-section table {
    width: 100%;
    border-collapse: collapse;
}

.bsa-result-section table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.93em;
}

.bsa-result-section table td:first-child {
    font-weight: 600;
    width: 40%;
    color: #555;
}

.bsa-analysis-text {
    background: #f8f9fa;
    padding: 15px;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
    font-size: 0.93em;
    white-space: pre-line;
}

/* Measure lists */
.bsa-measures-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bsa-measures-list li {
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 0.93em;
}

.bsa-measures-list li.measure-dringend {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.bsa-measures-list li.measure-situativ {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
}

.bsa-measures-list li.measure-verbot {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.bsa-source-tag {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Sources */
.bsa-sources ul {
    font-size: 0.85em;
    color: #555;
    padding-left: 20px;
}

.bsa-sources li {
    margin-bottom: 6px;
}

/* Disclaimer */
.bsa-disclaimer {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 4px;
    font-size: 0.82em;
    color: #777;
}

/* Actions */
.bsa-result-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* === Scenario-based Risk Assessment === */
.bsa-scenario-risks-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.bsa-scenario-risks-container h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 18px;
}

.bsa-scenario-table-wrapper {
    overflow-x: auto;
}

.bsa-scenario-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bsa-scenario-table thead {
    background: #f8f9fa;
}

.bsa-scenario-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.bsa-scenario-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
}

.bsa-scenario-table tbody tr:hover {
    background: #f8f9fa;
}

.bsa-scenario-name {
    font-weight: 500;
    color: #333;
}

.bsa-scenario-level {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.bsa-scenario-level.bsa-level-1 {
    background: #d4edda;
    color: #155724;
}

.bsa-scenario-level.bsa-level-2 {
    background: #d1ecf1;
    color: #0c5460;
}

.bsa-scenario-level.bsa-level-3 {
    background: #fff3cd;
    color: #856404;
}

.bsa-scenario-level.bsa-level-4 {
    background: #f8d7da;
    color: #721c24;
}

.bsa-scenario-level.bsa-level-5 {
    background: #dc3545;
    color: #fff;
}

.bsa-scenario-risk-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

/* === Measures List === */
.bsa-measures-list-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.bsa-measures-list-container h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 18px;
}

.bsa-measures-table-wrapper {
    overflow-x: auto;
}

.bsa-measures-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bsa-measures-table thead {
    background: #f8f9fa;
}

.bsa-measures-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.bsa-measures-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
}

.bsa-measures-table tbody tr:hover {
    background: #f8f9fa;
}

.bsa-measures-table tbody tr.bsa-priority-kritisch {
    background: #fff5f5;
}

.bsa-measures-table tbody tr.bsa-priority-hoch {
    background: #fffbf5;
}

.bsa-measure-text {
    font-weight: 500;
    color: #333;
}

.bsa-priority-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.bsa-priority-badge.bsa-priority-kritisch {
    background: #dc3545;
    color: #fff;
}

.bsa-priority-badge.bsa-priority-hoch {
    background: #ff9800;
    color: #fff;
}

.bsa-priority-badge.bsa-priority-mittel {
    background: #ffc107;
    color: #333;
}

.bsa-measure-responsible {
    color: #666;
    font-size: 13px;
}

.bsa-measures-note {
    margin: 16px 0 0 0;
    padding: 12px 16px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

/* === Critical Warnings === */
.bsa-critical-warnings-container {
    background: #fff;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.bsa-critical-warnings-container h3 {
    margin: 0 0 15px 0;
    color: #dc3545;
    font-size: 18px;
}

.bsa-critical-warning {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.bsa-critical-warning:last-child {
    margin-bottom: 0;
}

.bsa-warning-critical {
    background: #fff5f5;
    border-left: 4px solid #dc3545;
}

.bsa-warning-high {
    background: #fffbf5;
    border-left: 4px solid #ff9800;
}

.bsa-warning-icon {
    font-size: 24px;
    line-height: 1;
}

.bsa-warning-content {
    flex: 1;
}

.bsa-warning-message {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
}

.bsa-warning-recommendation {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 600px) {
    .bsa-step,
    .bsa-result {
        padding: 20px 15px;
    }

    .bsa-nav {
        flex-direction: column;
    }

    .bsa-btn {
        width: 100%;
        text-align: center;
    }

    .bsa-result-actions {
        flex-direction: column;
    }

    .bsa-scenario-table,
    .bsa-measures-table {
        font-size: 12px;
    }

    .bsa-scenario-table th,
    .bsa-scenario-table td,
    .bsa-measures-table th,
    .bsa-measures-table td {
        padding: 10px 8px;
    }

    .bsa-scenario-risks-container,
    .bsa-measures-list-container {
        padding: 16px;
    }
}
