/* ============================================
   CV UPLOAD v3 - Premium Multi-Step Wizard
   Finders & Company CI
   ============================================ */

/* === OVERLAY === */
.cv-upload-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: cvFadeIn 0.2s ease;
}

/* === MODAL === */
.cv-upload-modal-v3 {
    background: white;
    border-radius: 16px;
    width: 92%;
    max-width: 900px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    animation: cvSlideUp 0.3s ease;
}

/* === HEADER === */
.cv-upload-header {
    padding: 20px 28px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e3c3c 0%, #163030 100%);
}
.cv-upload-header h2 {
    margin: 0; font-size: 22px; font-weight: 700; color: white;
    display: flex; align-items: center; gap: 10px;
}
.cv-upload-header h2 i { color: #ff6101; }
.cv-header-subtitle {
    margin: 4px 0 0; font-size: 13px; color: rgba(255,255,255,0.7);
}
.cv-upload-close {
    background: rgba(255,255,255,0.1); border: none;
    width: 36px; height: 36px; border-radius: 50%;
    color: white; font-size: 18px; cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.cv-upload-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

/* === STEP PROGRESS === */
.cv-step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 28px;
    gap: 0;
    background: #fafbfc;
    border-bottom: 1px solid #eee;
}
.cv-step {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    opacity: 0.4; transition: all 0.3s;
}
.cv-step.active { opacity: 1; }
.cv-step.completed .cv-step-circle {
    background: #10b981; border-color: #10b981;
}
.cv-step-circle {
    width: 40px; height: 40px; border-radius: 50%;
    background: white; border: 2px solid #d1d5db;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #6b7280; transition: all 0.3s;
}
.cv-step.active .cv-step-circle {
    border-color: #1e3c3c; color: #1e3c3c;
    box-shadow: 0 0 0 4px rgba(30,60,60,0.1);
}
.cv-step.completed .cv-step-circle { color: white; }
.cv-step span { font-size: 11px; font-weight: 600; color: #6b7280; }
.cv-step.active span { color: #1e3c3c; }

.cv-step-line {
    width: 60px; height: 2px;
    background: #e5e7eb;
    margin: 0 8px;
    margin-bottom: 20px;
    transition: background 0.3s;
}
.cv-step-line.active { background: #1e3c3c; }

/* === BODY === */
.cv-upload-body { padding: 28px; }
.cv-candidate-label {
    margin: 0 0 20px;
    padding: 10px 14px;
    background: #f0fdf4;
    border-radius: 8px;
    color: #166534;
    font-size: 14px;
}

/* === DROP ZONE === */
.cv-drop-zone {
    border: 3px dashed #d1d5db; border-radius: 16px;
    padding: 50px 30px; text-align: center;
    background: #fafbfc; transition: all 0.3s;
    cursor: pointer; position: relative; overflow: hidden;
}
.cv-drop-zone:hover, .cv-drop-zone.drag-over {
    border-color: #1e3c3c; background: #f0f5f5;
    transform: scale(1.01);
}
.cv-drop-icon { font-size: 56px; color: #1e3c3c; margin-bottom: 16px; animation: cvFloat 3s ease-in-out infinite; }
.cv-drop-zone h3 { margin: 0 0 10px; font-size: 20px; font-weight: 700; color: #1e3c3c; }
.cv-drop-zone p { margin: 0 0 6px; color: #6b7280; font-size: 14px; }
.cv-drop-zone .file-types { font-size: 12px; color: #9ca3af; margin-top: 12px; }
#cv-file-input { display: none; }

/* === SELECTED FILE === */
.cv-selected-file {
    margin-top: 20px; padding: 16px 20px;
    background: linear-gradient(135deg, #f0f5f5 0%, #e6edeb 100%);
    border-radius: 12px; border-left: 4px solid #1e3c3c;
    display: none;
}
.cv-selected-file.visible { display: block; animation: cvSlideDown 0.3s ease; }
.cv-file-info { display: flex; align-items: center; gap: 14px; }
.cv-file-icon {
    width: 46px; height: 46px; background: #1e3c3c;
    color: white; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.cv-file-details h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: #1e3c3c; }
.cv-file-details p { margin: 0; font-size: 12px; color: #6b7280; }
.cv-file-pages { color: #1e3c3c !important; font-weight: 500; }
.cv-file-remove {
    margin-left: auto; background: #ef4444; border: none;
    color: white; width: 34px; height: 34px; border-radius: 8px;
    cursor: pointer; font-size: 14px; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.cv-file-remove:hover { background: #dc2626; transform: scale(1.05); }

/* === STEP 2: EXTRACTION === */
.cv-extraction-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.cv-extraction-header h3 { margin: 0; font-size: 18px; color: #1e3c3c; }
.cv-quality-badge {
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    background: #e5e7eb; color: #6b7280;
}
.cv-quality-badge.high { background: #d1fae5; color: #065f46; }
.cv-quality-badge.excellent { background: #d1fae5; color: #065f46; }
.cv-quality-badge.medium { background: #fef3c7; color: #92400e; }
.cv-quality-badge.low { background: #fee2e2; color: #991b1b; }
.cv-quality-badge.critical { background: #ef4444; color: white; }

.cv-extraction-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin-bottom: 20px;
}
.cv-stat {
    text-align: center; padding: 14px 10px;
    background: #f9fafb; border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.cv-stat i { font-size: 18px; color: #1e3c3c; display: block; margin-bottom: 6px; }
.cv-stat span { font-size: 20px; font-weight: 700; color: #1e3c3c; display: block; }
.cv-stat label { font-size: 11px; color: #6b7280; margin-top: 2px; }

/* Smart Detect */
.cv-smart-detect {
    margin-bottom: 20px;
    padding: 16px; background: #fefce8; border-radius: 10px;
    border: 1px solid #fde68a;
}
.cv-smart-detect h4 {
    margin: 0 0 12px; font-size: 14px; color: #92400e;
    display: flex; align-items: center; gap: 8px;
}
.cv-detect-items { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-detect-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; background: white; border-radius: 8px;
    font-size: 13px; border: 1px solid #fde68a;
}
.cv-detect-item i { color: #1e3c3c; width: 16px; }
.cv-detect-item strong { color: #374151; }
.cv-detect-item span { color: #6b7280; font-size: 12px; }

/* Text Preview */
.cv-text-preview { margin-bottom: 16px; }
.cv-text-preview-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.cv-text-preview-header h4 {
    margin: 0; font-size: 14px; color: #374151;
    display: flex; align-items: center; gap: 6px;
}
.cv-btn-sm {
    background: #f3f4f6; border: 1px solid #d1d5db;
    padding: 4px 10px; border-radius: 6px; cursor: pointer;
    font-size: 12px; color: #6b7280; transition: all 0.2s;
}
.cv-btn-sm:hover { background: #e5e7eb; }
.cv-text-content {
    background: #1e293b; color: #e2e8f0;
    padding: 16px; border-radius: 10px;
    font-size: 12px; line-height: 1.6;
    max-height: 120px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word;
    font-family: 'SF Mono', 'Fira Code', monospace;
    transition: max-height 0.3s;
}
.cv-text-preview.expanded .cv-text-content { max-height: 400px; }

/* Vision Notice */
.cv-vision-notice {
    display: flex; gap: 12px; padding: 14px 16px;
    background: #fef3c7; border-radius: 10px;
    border: 1px solid #fde68a; margin-top: 12px;
}
.cv-vision-notice i { color: #d97706; font-size: 20px; margin-top: 2px; }
.cv-vision-notice strong { color: #92400e; display: block; margin-bottom: 4px; }
.cv-vision-notice p { margin: 0; font-size: 13px; color: #92400e; line-height: 1.5; }

/* === STEP 3: AI ANALYSIS === */
.cv-analysis-progress { text-align: center; padding: 20px 0; }
.cv-analysis-animation { position: relative; width: 120px; height: 120px; margin: 0 auto 24px; }
.cv-brain-pulse {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px; color: #1e3c3c; z-index: 2;
    animation: cvBrainPulse 2s ease-in-out infinite;
}
.cv-pulse-rings { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.cv-pulse-ring {
    position: absolute; top: 50%; left: 50%;
    width: 80px; height: 80px;
    margin-top: -40px; margin-left: -40px;
    border: 2px solid #1e3c3c;
    border-radius: 50%; opacity: 0;
    animation: cvPulseRing 2s ease-out infinite;
}
.cv-analysis-progress h3 { margin: 0 0 8px; font-size: 20px; color: #1e3c3c; }
.cv-analysis-subtitle { margin: 0 0 28px; font-size: 14px; color: #6b7280; }

.cv-analysis-steps-list {
    max-width: 400px; margin: 0 auto 20px; text-align: left;
}
.cv-analysis-step-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; font-size: 14px; color: #9ca3af;
    transition: all 0.3s;
}
.cv-analysis-step-item.active { color: #1e3c3c; font-weight: 500; }
.cv-analysis-step-item.active i { color: #10b981; }
.cv-analysis-step-item i { width: 20px; text-align: center; }

.cv-elapsed-time {
    font-size: 13px; color: #9ca3af;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* === STEP 4: RESULTS === */
.cv-result-banner {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
    border-radius: 12px; margin-bottom: 20px;
    border: 1px solid #a7f3d0;
}
.cv-result-banner-icon { font-size: 32px; color: #10b981; }
.cv-result-banner h3 { margin: 0 0 2px; font-size: 16px; color: #065f46; }
.cv-result-banner p { margin: 0; font-size: 13px; color: #047857; }

/* Score Hero */
.cv-result-score-hero {
    display: flex; gap: 24px; align-items: flex-start;
    padding: 24px; background: #f9fafb; border-radius: 14px;
    margin-bottom: 20px; border: 1px solid #e5e7eb;
}
.cv-result-score-circle {
    width: 100px; height: 100px; border-radius: 50%;
    background: conic-gradient(var(--score-color) 0%, var(--score-color) var(--score-pct), #e5e7eb var(--score-pct), #e5e7eb 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
}
.cv-result-score-circle::before {
    content: ''; position: absolute;
    width: 80px; height: 80px; border-radius: 50%;
    background: white;
}
.cv-result-score-value {
    position: relative; z-index: 1;
    font-size: 28px; font-weight: 800; color: #1e3c3c;
}
.cv-result-score-label {
    position: relative; z-index: 1;
    font-size: 10px; font-weight: 600; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.cv-result-summary { margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: #374151; }
.cv-result-strengths h5 {
    margin: 0 0 8px; font-size: 13px; color: #1e3c3c;
    display: flex; align-items: center; gap: 6px;
}
.cv-result-strength-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-strength-tag {
    padding: 4px 10px; background: #1e3c3c; color: white;
    border-radius: 16px; font-size: 12px; font-weight: 500;
}

/* Tabs */
.cv-result-tabs {
    display: flex; gap: 4px; margin-bottom: 16px;
    border-bottom: 2px solid #e5e7eb; padding-bottom: 0;
}
.cv-result-tab {
    padding: 10px 16px; border: none; background: none;
    font-size: 13px; font-weight: 600; color: #6b7280;
    cursor: pointer; transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex; align-items: center; gap: 6px;
}
.cv-result-tab:hover { color: #1e3c3c; }
.cv-result-tab.active { color: #1e3c3c; border-bottom-color: #1e3c3c; }
.cv-result-tab-content { display: none; }
.cv-result-tab-content.active { display: block; animation: cvFadeIn 0.3s ease; }

/* Result Grid */
.cv-result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cv-result-card {
    padding: 18px; background: white; border-radius: 12px;
    border: 1px solid #e5e7eb;
}
.cv-result-card h4 {
    margin: 0 0 14px; font-size: 14px; font-weight: 700;
    color: #1e3c3c; display: flex; align-items: center; gap: 8px;
}
.cv-result-field-list { display: flex; flex-direction: column; gap: 8px; }
.cv-rfield {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.cv-rfield span { color: #6b7280; }
.cv-rfield strong { color: #1e3c3c; }

/* Languages */
.cv-lang-list { display: flex; flex-direction: column; gap: 8px; }
.cv-lang-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; background: #f9fafb; border-radius: 8px;
}
.cv-lang-name { font-weight: 600; color: #1e3c3c; font-size: 13px; }
.cv-lang-level { font-size: 12px; color: #6b7280; }

/* Education */
.cv-edu-list { display: flex; flex-direction: column; gap: 12px; }
.cv-edu-item { padding-left: 12px; border-left: 3px solid #1e3c3c; }
.cv-edu-degree { font-weight: 600; color: #1e3c3c; font-size: 13px; }
.cv-edu-inst { font-size: 13px; color: #6b7280; }
.cv-edu-time { font-size: 12px; color: #9ca3af; font-style: italic; }

/* Certifications */
.cv-cert-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-cert-tag {
    padding: 5px 12px; background: #fef3c7; color: #92400e;
    border-radius: 16px; font-size: 12px; font-weight: 500;
}

/* Interests */
.cv-interest-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-interest-tag {
    padding: 5px 12px; background: #fce7f3; color: #9d174d;
    border-radius: 16px; font-size: 12px; font-weight: 500;
    display: flex; align-items: center; gap: 4px;
}
.cv-interest-tag i { font-size: 10px; }

/* Timeline (Experience) */
.cv-timeline { position: relative; padding-left: 24px; }
.cv-timeline::before {
    content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
    width: 2px; background: #e5e7eb;
}
.cv-timeline-item {
    position: relative; margin-bottom: 24px;
    animation: cvFadeIn 0.4s ease forwards;
    opacity: 0;
}
.cv-timeline-dot {
    position: absolute; left: -20px; top: 6px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #1e3c3c; border: 3px solid white;
    box-shadow: 0 0 0 2px #1e3c3c;
}
.cv-timeline-content {
    padding: 16px; background: white;
    border-radius: 10px; border: 1px solid #e5e7eb;
}
.cv-timeline-header {
    display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px;
}
.cv-timeline-header h5 { margin: 0; font-size: 15px; color: #1e3c3c; }
.cv-timeline-period {
    font-size: 12px; color: #6b7280; background: #f3f4f6;
    padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}
.cv-timeline-company {
    font-size: 13px; color: #6b7280; margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px;
}
.cv-timeline-loc { margin-left: 12px; }
.cv-timeline-desc { font-size: 13px; color: #4b5563; line-height: 1.6; margin: 8px 0 0; }
.cv-timeline-achievements { margin-top: 10px; }
.cv-achievement {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 12px; color: #059669; padding: 4px 0;
}
.cv-achievement i { font-size: 11px; margin-top: 2px; }

/* Skills */
.cv-skills-section { margin-bottom: 24px; }
.cv-skills-section h4 {
    margin: 0 0 14px; font-size: 15px; color: #1e3c3c;
    display: flex; align-items: center; gap: 8px;
}
.cv-skills-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px;
}
.cv-skill-card {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; background: #f9fafb; border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.cv-skill-name { font-size: 13px; font-weight: 600; color: #1e3c3c; }
.cv-skill-level { font-size: 11px; color: #6b7280; }
.cv-soft-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-soft-skill-tag {
    padding: 5px 12px; background: #ede9fe; color: #6d28d9;
    border-radius: 16px; font-size: 12px; font-weight: 500;
}

/* Fit Scores */
.cv-fitscore-section { margin-bottom: 24px; }
.cv-fitscore-section h4 {
    margin: 0 0 14px; font-size: 15px; color: #1e3c3c;
    display: flex; align-items: center; gap: 8px;
}
.cv-fitscore-bar-item { margin-bottom: 16px; }
.cv-fitscore-bar-header {
    display: flex; justify-content: space-between; margin-bottom: 6px;
    font-size: 14px;
}
.cv-fitscore-bar-header span { color: #374151; }
.cv-fitscore-bar-header strong { color: #1e3c3c; }
.cv-fitscore-bar {
    height: 10px; background: #e5e7eb; border-radius: 10px;
    overflow: hidden;
}
.cv-fitscore-fill {
    height: 100%; border-radius: 10px;
    transition: width 0.8s ease; animation: cvFillBar 1s ease forwards;
}
.cv-fitscore-reasoning {
    margin: 6px 0 0; font-size: 12px; color: #6b7280;
    line-height: 1.5; font-style: italic;
}

/* Development Potential */
.cv-dev-potential { display: flex; flex-direction: column; gap: 12px; }
.cv-dev-card {
    padding: 16px; background: linear-gradient(135deg, #f0f5f5 0%, #f9fafb 100%);
    border-radius: 10px; border: 1px solid #e5e7eb;
}
.cv-dev-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.cv-dev-role { font-weight: 700; color: #1e3c3c; }
.cv-dev-score {
    background: #1e3c3c; color: white;
    padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: 600;
}
.cv-dev-timeline {
    font-size: 13px; color: #6b7280;
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 8px;
}
.cv-dev-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-dev-step {
    font-size: 12px; color: #4b5563;
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; background: white; border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.cv-no-data { text-align: center; color: #9ca3af; padding: 24px; font-size: 14px; }
.cv-result-error { text-align: center; color: #ef4444; padding: 24px; font-size: 14px; }

/* === FOOTER === */
.cv-upload-footer {
    padding: 16px 28px; border-top: 1px solid #eee;
    display: flex; gap: 12px; justify-content: flex-end;
    background: #fafafa; border-radius: 0 0 16px 16px;
}
.btn-cancel, .btn-upload {
    padding: 10px 24px; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; border: none;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-cancel { background: white; color: #6b7280; border: 1px solid #d1d5db; }
.btn-cancel:hover { background: #f9fafb; border-color: #1e3c3c; color: #1e3c3c; }
.btn-upload { background: #1e3c3c; color: white; }
.btn-upload:hover:not(:disabled) {
    background: #2d5555; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30,60,60,0.3);
}
.btn-upload:disabled { background: #9ca3af; cursor: not-allowed; transform: none; }
.btn-upload.success { background: #10b981; }
.btn-upload.success:hover { background: #059669; }

/* === ANIMATIONS === */
@keyframes cvFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cvSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes cvSlideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 200px; }
}
@keyframes cvFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes cvBrainPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}
@keyframes cvPulseRing {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}
@keyframes cvFillBar {
    from { width: 0; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .cv-upload-modal-v3 { width: 96%; max-height: 96vh; }
    .cv-upload-header, .cv-upload-body, .cv-upload-footer { padding: 16px; }
    .cv-drop-zone { padding: 30px 16px; }
    .cv-drop-icon { font-size: 40px; }
    .cv-step-progress { padding: 12px; gap: 0; }
    .cv-step span { font-size: 9px; }
    .cv-step-line { width: 30px; }
    .cv-extraction-stats { grid-template-columns: repeat(2, 1fr); }
    .cv-result-grid { grid-template-columns: 1fr; }
    .cv-result-score-hero { flex-direction: column; align-items: center; text-align: center; }
    .cv-result-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .cv-skills-grid { grid-template-columns: 1fr; }
}
