@charset "utf-8";
/* CSS Document */

/* Allgemeine Formular-Styles */
.dashboard-container {
    padding: 20px;
    background-color: #f8f9fa;
    min-height: 100vh;
}

.dashboard-right-column {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    padding: 30px;
}

#general-health-form {
    /*font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;*/
    margin-top: 30px;
}

/* Formular-Sektionen */
.general-health-form-section {
    margin-bottom: 25px;
    border: 2px solid #82aac5;
    border-radius: 5px;
    background: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.general-health-form-section:hover {
    border-color: #17669d;
    box-shadow: 0 8px 25px rgba(23, 102, 157, 0.15);
}

/* Section Header */
.form-section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #18669d;
    color: white;
    padding: 12px 24px;
    cursor: pointer;
    width: 1050px;
}

.section-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.section-toggle-btn i {
    transition: transform 0.3s ease-in-out;
}

.section-toggle-btn.collapsed i {
    transform: rotate(-90deg);
}

.form-section-title {
    margin: 0;
    font-size: 20px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex: 1;
}

/* Section Content - Collapsible */
.form-section-content {
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, padding 0.4s ease-out;
    overflow: hidden;
    opacity: 1;
    padding: 20px 24px;
}

.form-section-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Feldgruppen ohne Gruppen (Rückwärtskompatibilität) */
.general-health-form-field-group {
    padding: 20px 0;
    border-bottom: 1px solid #f1f1f1;
}

.general-health-form-field-group:last-child {
    border-bottom: none;
}

/* Gruppen-Container */
.general-health-form-group {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #d1ecf1;
    border-radius: 5px;
    margin: 15px 0;
    padding: 0;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Group Header */
.form-group-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 25px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fc 0%, #e9ecef 100%);
    cursor: pointer;
    text-align: left;
}

.group-toggle-btn {
    background: rgba(23, 162, 184, 0.1);
    border: 2px solid #17a2b8;
    color: #17a2b8;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.group-toggle-btn:hover {
    background: rgba(23, 162, 184, 0.2);
    transform: scale(1.05);
}

.group-toggle-btn i {
    transition: transform 0.3s ease-in-out;
}

.group-toggle-btn.collapsed i {
    transform: rotate(-90deg);
}

.form-group-title-container {
    flex: 1;
}

.form-group-title {
    color: #17a2b8;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
    letter-spacing: 0.3px;
}

.form-group-description {
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
    margin: 0;
    line-height: 1.4;
}

/* Group Content - Collapsible */
.form-group-content {
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, padding 0.4s ease-out;
    overflow: hidden;
    opacity: 1;
    padding: 20px 25px;
}

.form-group-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.section-toggle-btn.collapsed i,
.group-toggle-btn.collapsed i {
    transform: rotate(-90deg);
}

/* Gruppen-Felder Container */
.general-health-form-group-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Anpassung der bestehenden Feldgruppen in Gruppen */
.general-health-form-group .general-health-form-field-group {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.general-health-form-group .general-health-form-field-group:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #17a2b8;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.1);
}

/* Labels */
.form-field-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.3px;
    padding: 3px;
    text-align: left;
}

/* Input-Felder */
.form-control,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background-color: #ffffff;
    box-sizing: border-box;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: #17669d;
    box-shadow: 0 0 0 3px rgba(23, 102, 157, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #a0a9b8;
    font-style: italic;
}

/* Select-Felder */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    appearance: none;
    cursor: pointer;
}

/* Einzelne Checkboxen */
.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s ease;
    font-size: 14px;
}

.checkbox-label:hover {
    color: #17669d;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #17669d;
    cursor: pointer;
}

/* Multi-Select Container (Mehrspaltiges Layout) */
.multi-select-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 20px;
    margin-top: 8px;
    padding: 16px;
    background: #f8f9fc;
    border-radius: 8px;
    border: 1px solid #e3e6f0;
}

/* Responsive Anpassungen für Multi-Select */
@media (max-width: 992px) {
    .multi-select-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .multi-select-container {
        grid-template-columns: 1fr;
    }
}

/* Form-Check Items - Klickbar machen */
.form-check {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.form-check:hover {
    border-color: #17669d;
    box-shadow: 0 2px 4px rgba(23, 102, 157, 0.1);
    transform: translateY(-1px);
}

.form-check.checked {
    background-color: #f0f4ff;
    border-color: #17669d;
    box-shadow: 0 2px 4px rgba(23, 102, 157, 0.15);
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: #17669d;
    cursor: pointer;
    pointer-events: none;
}

.form-check-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
    margin: 0;
    flex: 1;
}

/* Multi-Select Container in Gruppen */
.general-health-form-group .multi-select-container {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1ecf1;
}

.general-health-form-group .form-check {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #d1ecf1;
}

.general-health-form-group .form-check:hover {
    border-color: #17a2b8;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.1);
}

.general-health-form-group .form-check.checked {
    background-color: rgba(23, 162, 184, 0.05);
    border-color: #17a2b8;
}

/* Button-Styling */
.form-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e3e6f0;
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.btn i {
    /*margin-right: 8px;*/
}

/* Fehlermeldung/Leer-Zustand */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
    font-size: 16px;
}

.text-danger {
    color: #dc3545;
    padding: 40px 20px;
    font-size: 16px;
}

/* Fokus-Verbesserungen für Barrierefreiheit */
.form-check-input:focus,
.checkbox-label input[type="checkbox"]:focus,
.section-toggle-btn:focus,
.group-toggle-btn:focus {
    outline: 2px solid #17669d;
    outline-offset: 2px;
}

/* Hover-Effekte für bessere UX */
.form-section-header:hover {
    background: linear-gradient(135deg, #145a84 0%, #3d7ba3 100%);
}

.form-group-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

/* Loading States */
.form-container-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.form-container-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #17669d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.mt-4 {
    margin-top: 1.5rem;
}

/* Zwei-Spalten Layout für Fragen und Historie */
.general-health-form-field-group {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #f1f1f1;
    align-items: start;
}

.general-health-form-field-group:last-child {
    border-bottom: none;
}

/* Feld-Container (linke Spalte) */
.field-content {
    padding-right: 10px;
}

/* Historie-Container (rechte Spalte) */
.field-history {
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
}

.field-history:empty {
    display: none;
}

.field-history::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: #17669d;
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #d1ecf1;
    padding-bottom: 6px;
}

/* Historie-Einträge */
.history-content {
    margin-top: 8px;
}

.history-entry {
    margin: 0 0 6px 0;
    padding: 6px 8px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #17669d;
    font-size: 12px;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.history-entry:last-child {
    margin-bottom: 0;
}

/* Datum-Styling in Historie */
.history-entry {
    position: relative;
}

.history-entry::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #17669d;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #17669d;
}

/* Custom Scrollbar für Historie */
.field-history::-webkit-scrollbar {
    width: 6px;
}

.field-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.field-history::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.field-history::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .general-health-form-field-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .field-history {
        max-height: 150px;
    }
}

/* Anpassungen für Gruppen-Container */
.general-health-form-group .general-health-form-field-group {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

/* Grid-Layout in Gruppen-Feldern */
.general-health-form-group-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Entfernen des Gaps, da wir das Grid-Layout verwenden */
}

/* Spezielle Historie-Styles für positive Befunde */
.field-history.has-positive-history {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #f0f8f0 100%);
}

.field-history.has-positive-history::before {
    color: #28a745;
}

/* Alert-Style für wichtige Historie-Einträge */
.history-entry.important {
    background: #fff3cd;
    border-left-color: #ffc107;
    font-weight: 500;
}

.history-entry.positive {
    background: #d1f2d1;
    border-left-color: #28a745;
}

.history-entry.negative {
    background: #f8d7da;
    border-left-color: #dc3545;
}

/* Verbesserte Historie-Optik mit Zeitstrahl-Effekt */
.field-history.has-positive-history {
    position: relative;
}

.field-history.has-positive-history::after {
    content: '';
    position: absolute;
    top: 35px;
    left: 8px;
    bottom: 12px;
    width: 2px;
    background: linear-gradient(to bottom, #17669d 0%, #e3e6f0 100%);
    border-radius: 1px;
}

/* Hover-Effekt für Historie-Einträge */
.history-entry:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading-Indikator für Historie */
.field-history.loading::before {
    content: 'Lade Historie...';
}

/* Print Styles */
@media print {

    /* Hide navigation and other non-printable elements */
    #sidebar-navigation,
    .main-header,
    .control-bar,
    .modal-overlay,
    .modal,
    #general-health-editor-modal,
    .section-actions-bar,
    .section-drag-handle,
    .section-toggle-btn,
    .group-drag-handle,
    .group-toggle-btn,
    .group-actions,
    .add-group-btn,
    .add-field-to-group-btn,
    .manage-options-btn,
    .remove-section-btn,
    .remove-group-btn,
    .remove-field-btn,
    .form-field-grip,
    #toast,
    .header-menu-tabs,
    .header-info-bar,
    button {
        display: none !important;
    }

    /* Reset container styles for full width */
    .dashboard-container {
        padding: 0;
        background: white;
        min-height: auto;
    }

    .dashboard-right-column {
        max-width: 100%;
        margin: 0;
    }

    .dashboard-item {
        box-shadow: none;
        padding: 0;
        border-radius: 0;
    }

    /* Ensure form is visible and expanded */
    #general-health-form {
        margin-top: 0;
        display: block !important;
    }

    .general-health-form-section {
        border: none;
        margin-bottom: 30px;
        page-break-inside: avoid;
        box-shadow: none;
    }

    .form-section-header {
        background: none;
        color: black;
        padding: 10px 0;
        border-bottom: 2px solid #333;
    }

    .form-section-title {
        font-size: 24px;
        color: black;
    }

    .form-section-content {
        display: block !important;
        max-height: none !important;
        padding: 10px 0;
        opacity: 1 !important;
    }

    .form-group-content {
        display: block !important;
        max-height: none !important;
        opacity: 1 !important;
        padding: 10px 0;
    }

    /* Better readbility for print */
    .form-field-label {
        color: black;
        font-weight: bold;
    }

    .history-entry {
        border-left: 1px solid #999;
        color: #333;
    }

    /* Hide empty history */
    .field-history:not(.has-positive-history) {
        display: none;
    }

    /* Layout adjustments */
    .general-health-form-field-group {
        page-break-inside: avoid;
        border-bottom: 1px solid #ccc;
    }
}