﻿/* CV Upload Styles für Datenbank-Speicherung */
.cv-upload-container {
    padding: 1.5rem 0;
    max-width: 100%;
}

.upload-info {
    margin-bottom: 2rem;
    text-align: center;
}

.upload-info p {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.upload-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #5a6c7d;
}

.feature-icon {
    font-size: 1.2rem;
}

.cv-upload-form {
    max-width: 100%;
}

/* ✅ KORRIGIERT: Form-Row Layout für gleichmäßige Ausrichtung */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: start; /* ✅ NEU: Items am Anfang ausrichten */
}

.form-group {
    margin-bottom: 1.5rem;
    min-height: 120px; /* ✅ NEU: Mindesthöhe für konsistente Ausrichtung */
    display: flex;
    flex-direction: column;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    flex-shrink: 0; /* ✅ NEU: Label-Höhe konstant halten */
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    flex-shrink: 0; /* ✅ NEU: Input-Höhe konstant halten */
}

/* ✅ NEU: Spezielle Behandlung für disabled E-Mail-Feld */
.form-input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.8;
}

/* ✅ NEU: Form-Help Container für konsistente Höhe */
.form-help {
    display: block;
    font-size: 0.8rem;
    color: #28a745; /* ✅ Grün für Bestätigung */
    margin-top: 0.5rem;
    font-weight: 500;
    min-height: 1.2rem; /* ✅ Mindesthöhe für Konsistenz */
    line-height: 1.2;
}

/* ✅ NEU: Error-Container */
/* KORREKTUR: min-height entfernt, damit leere Validierungsfelder keinen Platz global verschwenden */
.field-validation-error {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block; /* War none, muss aber sichtbar sein WENN Fehler da ist */
    font-weight: 500;
    line-height: 1.2;
}

/* Leere Validierungs-Spans ausblenden (wichtig für Razor Pages) */
.field-validation-valid {
    display: none !important;
}

/* ✅ NEU: Konsistente Abstände in Form-Groups */
.form-group-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.form-group-footer {
    margin-top: 0.5rem;
    min-height: 1.5rem; /* ✅ Reservierter Platz für Help/Error */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.file-upload-area {
    position: relative;
    border: 3px dashed #3498db;
    border-radius: 15px;
    padding: 2.5rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05), rgba(155, 89, 182, 0.05));
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: #2980b9;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(155, 89, 182, 0.1));
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.15);
}

.file-upload-area.file-selected {
    border-color: #27ae60;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.05), rgba(46, 204, 113, 0.05));
}

.file-upload-content svg {
    color: #3498db;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.file-upload-content h4 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1.2rem;
}

.file-upload-content p {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin: 0.5rem 0;
}

.upload-info-text {
    font-size: 0.85rem !important;
    color: #3498db !important;
    font-weight: 500;
    margin-top: 0.75rem !important;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(46, 204, 113, 0.1));
    border: 2px solid #27ae60;
    border-radius: 12px;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.file-info.show {
    opacity: 1;
    transform: translateY(0);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.file-icon {
    font-size: 2rem;
}

.file-meta {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: #27ae60;
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.file-size {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.remove-file-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: 1rem;
}

.remove-file-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.btn-primary-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary-custom:hover::before {
    left: 100%;
}

.btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.4);
}

.btn-primary-custom:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

.upload-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.upload-success {
    text-align: center;
    padding: 3rem 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.upload-success.show {
    opacity: 1;
    transform: translateY(0);
}

.success-animation {
    max-width: 400px;
    margin: 0 auto;
}

.success-icon {
    margin-bottom: 2rem;
    display: inline-block;
    padding: 1rem;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.3);
    animation: successPulse 2s ease-in-out infinite;
}

.success-icon svg {
    color: white;
    display: block;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.upload-success h4 {
    color: #27ae60;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.5rem;
}

.upload-success p {
    color: #7f8c8d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.success-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 25px;
    font-size: 0.9rem;
    color: #27ae60;
    font-weight: 500;
}

.stat-icon {
    font-size: 1.1rem;
}

/* ✅ Erweiterte Feld-Fehler-Styling */
.field-validation-error {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
    animation: slideDown 0.2s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cv-upload-container {
        padding: 1rem 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        min-height: auto; /* ✅ Flexible Höhe auf Mobile */
    }
    
    .file-upload-area {
        padding: 1.5rem 1rem; /* ✅ Weniger Padding auf Mobile */
        min-height: 120px;
    }
    
    .file-upload-content h4 {
        font-size: 1rem; /* ✅ Kleinere Schrift für Mobile */
    }
    
    .file-upload-content p {
        font-size: 0.85rem;
    }
    
    .btn-primary-custom {
        padding: 1rem 1.5rem; /* ✅ Kompaktere Buttons */
        font-size: 1rem;
    }
    
    .file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem; /* ✅ Weniger Padding */
    }
    
    .remove-file-btn {
        margin-left: 0;
        align-self: flex-end;
        padding: 0.5rem; /* ✅ Kleinerer Button */
    }
    
    .success-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-item {
        padding: 0.5rem 1rem; /* ✅ Kompakter */
        font-size: 0.85rem;
    }
}

/* ✅ Extra kleine Bildschirme (iPhone SE, etc.) */
@media (max-width: 480px) {
    .cv-upload-container {
        padding: 0.5rem 0;
    }
    
    .upload-info h4 {
        font-size: 1.1rem;
    }
    
    .form-input {
        padding: 0.75rem; /* ✅ Weniger Padding für kleine Screens */
        font-size: 0.95rem;
    }
    
    .file-upload-area {
        padding: 1rem 0.5rem;
        min-height: 100px;
    }
    
    .btn-primary-custom {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
}

/* ✅ Touch-Optimierungen */
@media (pointer: coarse) {
    .file-upload-area {
        /* ✅ Bessere Touch-Targets */
        min-height: 140px;
    }
    
    .btn-primary-custom {
        /* ✅ Größere Touch-Fläche */
        min-height: 48px;
    }
    
    .remove-file-btn {
        min-width: 44px;
        min-height: 44px;
    }
}