/* Frontend CSS - assets/frontend.css - Korrigierte Version */

.kanban-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e1e5e9;
}

.kanban-form-container h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
    font-weight: 600;
}

.kanban-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-field-wrapper {
    margin-bottom: 25px;
    background: #fafbfc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-field-wrapper:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.form-field-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    line-height: 1.4;
}

.required {
    color: #e74c3c;
    margin-left: 4px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #3498db;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    background-color: #fafbfc;
}

.form-control:invalid,
.form-control.invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.15);
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 0.8;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
    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;
    padding-right: 40px;
}

/* Spezielle Styling für Adressfelder */
.address-field,
.address-street-field,
.address-zip-field,
.address-city-field,
.address-combined-field {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%233498db" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
    border-left: 4px solid #3498db;
}

.address-field:focus,
.address-street-field:focus,
.address-zip-field:focus,
.address-city-field:focus,
.address-combined-field:focus {
    border-left-color: #2980b9;
    background-color: #f8fbff;
}

/* Checkbox and Radio Groups */
.checkbox-group,
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e9ecef;
}

.checkbox-label:hover,
.radio-label:hover {
    color: #3498db;
    background: #f8fbff;
    border-color: #3498db;
    transform: translateY(-1px);
}

.checkbox-label input,
.radio-label input {
    margin-right: 12px;
    margin-top: 2px;
    transform: scale(1.3);
    flex-shrink: 0;
}

/* Enhanced File Upload with Drag & Drop */
.drag-drop-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.drag-drop-area {
    border: 3px dashed #bdc3c7;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.drag-drop-area:hover {
    border-color: #3498db;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    transform: scale(1.02);
}

.drag-drop-area.drag-over {
    border-color: #2980b9;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
}

.drag-drop-content {
    position: relative;
    z-index: 2;
}

.drag-drop-hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.95);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3;
    border-radius: 9px;
}

.drag-drop-area.drag-over .drag-drop-hover {
    display: flex;
}

.drag-drop-area.drag-over .drag-drop-content {
    opacity: 0.3;
}

.drag-drop-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.drag-drop-text {
    margin: 15px 0 8px 0;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
}

.drag-drop-subtext {
    margin: 8px 0 20px 0;
    font-size: 14px;
    color: #7f8c8d;
}

.drag-drop-button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.drag-drop-button:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.file-preview {
    margin-top: 15px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.file-preview-item:hover {
    background: linear-gradient(135deg, #e6f3ff 0%, #cce7ff 100%);
    transform: translateY(-1px);
}

.file-preview-icon {
    margin-right: 12px;
    font-size: 20px;
}

.file-preview-name {
    flex: 1;
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.file-preview-size {
    font-size: 12px;
    color: #7f8c8d;
    margin-left: 12px;
}

.file-preview-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 12px;
    transition: all 0.2s ease;
}

.file-preview-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.file-info {
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.file-info small {
    color: #6c757d;
    font-size: 12px;
    display: block;
    margin-bottom: 2px;
}

/* Error Messages */
.field-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #fdf2f2;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

.field-error::before {
    content: "⚠";
    margin-right: 8px;
    font-size: 16px;
    color: #e74c3c;
}

/* Form Error */
.form-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
}

/* Submit Section */
.form-submit {
    text-align: center;
    padding: 30px 0;
    border-top: 2px solid #e9ecef;
    margin-top: 30px;
}

.submit-button {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-button:hover {
    background: linear-gradient(135deg, #229954 0%, #196f3d 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.submit-button:active {
    transform: translateY(-1px);
}

.submit-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.form-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #3498db;
    font-style: italic;
    font-weight: 500;
}

.form-loading::before {
    content: "";
    width: 24px;
    height: 24px;
    border: 3px solid #ecf0f1;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success Message */
.form-success {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #d5f4e6 0%, #fafafa 100%);
    border: 2px solid #27ae60;
    border-radius: 12px;
    color: #155724;
    position: relative;
    overflow: hidden;
}

.form-success::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #27ae60, #2ecc71, #27ae60);
    animation: successPulse 2s ease-in-out infinite;
}

.form-success::after {
    content: "✓";
    display: block;
    font-size: 60px;
    color: #27ae60;
    margin-bottom: 20px;
    animation: bounceIn 0.8s ease-out;
}

.form-success h3 {
    margin: 0 0 15px 0;
    color: #155724;
    font-size: 28px;
    font-weight: 700;
}

.form-success p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

@keyframes successPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Conditional Fields Animation */
.form-field-wrapper {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.form-field-wrapper[style*="display: none"] {
    max-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    transform: translateY(-10px);
}

/* Conditional Notices */
.conditional-notice {
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.conditional-notice strong {
    display: block;
    margin-bottom: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kanban-form-container {
        margin: 10px;
        padding: 20px;
    }
    
    .form-field-wrapper {
        padding: 15px;
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .submit-button {
        width: 100%;
        padding: 18px;
    }
    
    .checkbox-group,
    .radio-group {
        grid-template-columns: 1fr;
    }
    
    .drag-drop-area {
        padding: 30px 15px;
        min-height: 120px;
    }
    
    .drag-drop-icon {
        font-size: 36px;
    }
    
    .drag-drop-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .kanban-form-container {
        margin: 5px;
        padding: 15px;
    }
    
    .form-field-wrapper {
        margin-bottom: 20px;
        padding: 12px;
    }
    
    .drag-drop-area {
        padding: 20px 10px;
        min-height: 100px;
    }
}

/* Focus States for Better Accessibility */
.submit-button:focus,
.form-control:focus,
.checkbox-label input:focus,
.radio-label input:focus,
.drag-drop-button:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 2px;
    }
    
    .form-field-wrapper {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .form-submit,
    .drag-drop-button,
    .file-preview-remove {
        display: none;
    }
    
    .kanban-form-container {
        box-shadow: none;
        border: 2px solid #000;
        background: white;
    }
    
    .form-control {
        border: 1px solid #000;
        background: white;
    }
}