/* =================
   FID WIZARD STYLES  
   ================= */

/* Ensure full width for all wizard containers */
.container-fluid .wizard-container,
.container .wizard-container,
.row .wizard-container {
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Wizard Container */
.wizard-container {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    margin: 20px auto;
    max-width: 1200px;
    width: 95%;
    position: relative;
    z-index: 1;
}

/* Wizard Header */
.wizard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.wizard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M20 20c0 11.046-8.954 20-20 20v20h40V20H20z'/%3E%3C/g%3E%3C/svg%3E") repeat;
}

.wizard-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}

.wizard-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 8px 0 0 0;
    position: relative;
    z-index: 1;
}

/* Enhanced Progress Bar */
.progress-wrapper {
    background: transparent;
    padding: 25px 40px;
    border-bottom: none;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 60%;
    right: -40%;
    height: 3px;
    background: var(--border-color);
    transition: background-color 0.3s ease;
}

.progress-step.completed::after,
.progress-step.active::after {
    background: var(--primary-color);
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 3px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    box-shadow: none;
}

.progress-step.completed .step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.progress-step.active .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: none;
}

.step-label {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    transition: color 0.3s ease;
}

.progress-step.completed .step-label,
.progress-step.active .step-label {
    color: var(--primary-color);
}

.progress-bar-custom {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    transition: width 0.6s ease;
    border-radius: 3px;
}

/* Form Content */
.wizard-content {
    padding: 40px;
    background: transparent;
}

/* Enhanced Form Sections */
.form-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 30px 0;
    border: none;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer; /* Ganzer Bereich klickbar wenn collapsed */
}

.form-section.collapsed {
    cursor: pointer;
}

.form-section.active {
    cursor: default;
    border-color: transparent;
    box-shadow: none;
}

.form-section:hover {
    border-color: transparent;
    box-shadow: none;
}

.form-section h4 {
    margin: 0;
    padding: 25px 30px 25px 30px; /* Gleichmäßiges Padding */
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-bottom: none;
    font-weight: 700;
    color: white !important;
    border-radius: 10px 10px 0 0;
    font-size: 1.2rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    display: block;
    gap: 0;
    width: 100%; /* Volle Breite */
    box-sizing: border-box; /* Padding included in width */
}

.form-section.collapsed h4 {
    border-radius: 10px;
    overflow: hidden; /* Verhindert das Herausragen des Buttons */
}

.form-section h4::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    border-radius: inherit;
    z-index: -1;
}

/* Collapsible Form Sections - Updated */
.form-section {
    position: relative;
    overflow: hidden;
}

.form-section-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: none;
    z-index: 10;
}

.form-section-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: none;
}

.form-section-toggle.collapsed {
    background: var(--gray-500);
    transform: none;
}

.form-section-toggle.collapsed:hover {
    background: var(--gray-600);
    transform: scale(1.1);
}

.form-section-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.form-section-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.form-section-content:not(.collapsed) {
    max-height: none;
    opacity: 1;
}

/* Section States */
.form-section.collapsed {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.form-section.collapsed h4 {
    color: var(--gray-600);
    margin-bottom: 0;
}

.form-section.active {
    border-color: var(--primary-color);
    box-shadow: none;
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb), 0.02) 0%, 
        var(--background-light) 100%);
}

.form-section.completed {
    border-color: var(--success-color);
    background: linear-gradient(135deg, 
        rgba(var(--success-rgb), 0.05) 0%, 
        rgba(var(--success-rgb), 0.02) 100%);
}

.form-section.completed::before {
    background: linear-gradient(180deg, var(--success-color) 0%, var(--success-light) 100%);
}

.form-section.completed .form-section-toggle {
    background: var(--success-color);
}

.form-section.completed .form-section-toggle:hover {
    background: var(--success-dark);
}

/* Header spacing adjustment for toggle button */
.form-section h4 {
    margin-right: 60px; /* Space for toggle button */
    padding-right: 10px;
}

.form-section h5 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 500;
    margin: 25px 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Enhanced Form Controls */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: none;
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Required field indicator */
.required {
    color: var(--error-color);
    font-weight: bold;
}

/* Enhanced Checkbox and Radio Groups */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
    margin: 8px 0;
}

/* Enhanced Form Controls */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
    max-width: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: none;
    transform: translateY(-1px);
}

/* Select elements wider */
select.form-control {
    width: 100%;
}

/* Input groups wider */
.input-group {
    width: 100%;
}

.input-group .form-control {
    min-width: 0;
    flex: 1;
}

/* Multi-select and checkbox groups */
.form-check-input[type="checkbox"] {
    width: 1.25em;
    height: 1.25em;
}

/* Textarea fields wider */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
    width: 100%;
}

.checkbox-item,
.radio-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.checkbox-item:hover,
.radio-item:hover {
    border-color: var(--primary-light);
    background: var(--background-light);
    transform: translateY(-1px);
}

.checkbox-item input:checked + label,
.radio-item input:checked + label {
    color: var(--primary-color);
    font-weight: 600;
}

.checkbox-item:has(input:checked),
.radio-item:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.form-check-label {
    margin: 0;
    cursor: pointer;
    line-height: 1.4;
}

/* Dynamic Input Groups */
.dynamic-input-group {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
}

.dynamic-items {
    margin-bottom: 15px;
}

.dynamic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--background-light);
    border-radius: 8px;
    margin-bottom: 8px;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dynamic-item .badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 20px;
}

.remove-dynamic-item {
    background: none;
    border: none;
    color: var(--error-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remove-dynamic-item:hover {
    background: var(--error-color);
    color: white;
}

.add-dynamic-item {
    background: var(--primary-color);
    border: none;
    color: white;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-dynamic-item:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* File Upload Enhancement */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: var(--background-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
    transform: scale(1.02);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.file-upload-text {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.file-upload-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid;
}

.alert-info {
    background: rgba(var(--info-rgb), 0.1);
    border-left-color: var(--info-color);
    color: var(--info-dark);
}

.alert-success {
    background: rgba(var(--success-rgb), 0.1);
    border-left-color: var(--success-color);
    color: var(--success-dark);
}

.alert-warning {
    background: rgba(var(--warning-rgb), 0.1);
    border-left-color: var(--warning-color);
    color: var(--warning-dark);
}

.alert-danger {
    background: rgba(var(--error-rgb), 0.1);
    border-left-color: var(--error-color);
    color: var(--error-dark);
}

/* Navigation Buttons */
.wizard-navigation {
    background: var(--background-light);
    padding: 30px 40px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.btn-wizard {
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    text-decoration: none;
}

.btn-wizard-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: none;
}

.btn-wizard-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: none;
    color: white;
}

.btn-wizard-secondary {
    background: var(--background-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-wizard-secondary:hover {
    background: var(--text-color);
    color: white;
    border-color: var(--text-color);
}

.btn-wizard-success {
    background: var(--success-color);
    color: white;
    box-shadow: none;
}

.btn-wizard-success:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
    box-shadow: none;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wizard-header {
        padding: 20px;
    }
    
    .wizard-title {
        font-size: 1.5rem;
    }
    
    .wizard-subtitle {
        font-size: 1rem;
    }
    
    .progress-wrapper {
        padding: 20px;
    }
    
    .progress-steps {
        flex-direction: column;
        gap: 20px;
    }
    
    .progress-step::after {
        display: none;
    }
    
    .wizard-content {
        padding: 20px;
    }
    
    .form-section {
        padding: 20px;
        margin: 20px 0;
    }
    
    .wizard-navigation {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-wizard {
        width: 100%;
        justify-content: center;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auto-save indicator */
.auto-save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.auto-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Field validation states */
.form-control.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 2.94 2.94-3.88-3.88z'/%3e%3c/svg%3e");
}

.form-control.is-invalid {
    border-color: var(--error-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.25 5.25 1.5 1.5m0-1.5-1.5 1.5'/%3e%3c/svg%3e");
}

/* Smooth transitions for everything */
* {
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
