/* AI Recruiter Demo - Upload Styles */

/* ====== TAB NAVIGATION ====== */
.tab-navigation {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 2rem;
    background: white;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    padding: 1rem 2rem;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-button.active {
    background: white;
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* ====== UPLOAD CONTAINER ====== */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.upload-job-context {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #374151;
}

.upload-job-context .context-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.upload-job-context .context-value {
    font-weight: 600;
    color: #111827;
}

.upload-header {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ====== DRAG AND DROP ZONE ====== */
.upload-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    margin-bottom: 2rem;
    overflow: visible;
}

#uploadDropZone.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.drop-note {
    margin-top: 10px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.drop-error {
    margin-top: 10px;
    font-size: 12px;
    color: #dc2626;
    text-align: center;
}

.upload-drop-zone:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.upload-drop-zone.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: scale(1.02);
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #9ca3af;
}

.drop-zone-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.drop-zone-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.drop-zone-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.drop-zone-actions { display: flex; gap: 8px; justify-content: center; margin: 8px 0 0; }
.drop-zone-button.secondary { background: #e5e7eb; color: #111827; }
.drop-zone-button.secondary:hover { background: #d1d5db; }
.drop-note.small { font-size: 11px; color: #94a3b8; }

/* Batch progress */
.batch-progress { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.batch-progress-bar { width: 100%; height: 6px; background: #e5e7eb; border-radius: 9999px; overflow: hidden; }
.batch-progress-fill { height: 100%; background: #3b82f6; width: 0; transition: width .2s ease; }
.batch-progress-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #6b7280; }
.batch-cancel { color: #ef4444; text-decoration: none; }
.batch-cancel:hover { text-decoration: underline; }

.drop-zone-button:hover {
    background: #2563eb;
}

.upload-file-input {
    display: none;
}

/* ====== FILE CONSTRAINTS ====== */
.upload-constraints {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.constraints-title {
    font-weight: 500;
    color: #0c4a6e;
    margin-bottom: 0.5rem;
}

.constraints-list {
    color: #0369a1;
    margin: 0;
    padding-left: 1.25rem;
}

/* ====== UPLOAD ERRORS ====== */
.upload-errors {
    margin-bottom: 2rem;
}

.upload-errors:empty {
    margin: 0;
}

.upload-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.error-title {
    font-weight: 500;
    color: #991b1b;
    margin-bottom: 0.5rem;
}

.error-list {
    color: #dc2626;
    margin: 0.5rem 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
}

.error-dismiss {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    float: right;
    margin-top: -0.5rem;
}

.error-dismiss:hover {
    background: #dc2626;
}

/* ====== FILES LIST ====== */
.files-section {
    margin-top: 2rem;
}

.files-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.upload-quota-banner {
    margin: 8px 0 12px 0;
    font-size: 12px;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
}

.uploaded-files-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Constrain height so large batches scroll inside this box */
    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px; /* prevent content under scrollbar */
}

.upload-summary {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #d1fae5;
    background: #ecfdf5;
    border-radius: 10px;
    color: #065f46;
    font-weight: 500;
}

.upload-summary .summary-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-summary button {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.upload-summary button:hover {
    background: #1d4ed8;
}

.no-files {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

/* ====== FILE ITEMS ====== */
.file-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.file-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-item.uploading { border-color: #3b82f6; background: #eff6ff; }

.file-item.processing { border-color: #f59e0b; background: #fffbeb; }

.file-item.ready { border-color: #10b981; background: #ecfdf5; }

.file-item.error { border-color: #ef4444; background: #fef2f2; }

/* Ensure consistent card heights regardless of status */
.file-item { min-height: 76px; display: flex; flex-direction: column; gap: 0.5rem; }
/* Keep layout space but hide the blue line unless uploading/processing */
.file-item .progress-bar { height: 4px; visibility: hidden; }
.file-item.uploading .progress-bar,
.file-item.processing .progress-bar { visibility: visible; }

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #111827;
    flex: 1;
    min-width: 200px;
}

.file-name-text {
    flex: 1;
    word-break: break-word;
}

.file-icon {
    font-size: 1.25rem;
}

.file-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.file-item.uploading .file-status {
    background: #dbeafe;
    color: #1d4ed8;
}

.file-item.processing .file-status {
    background: #fef3c7;
    color: #d97706;
}

.file-item.ready .file-status {
    background: #d1fae5;
    color: #059669;
}

.file-item.error .file-status {
    background: #fee2e2;
    color: #dc2626;
}

.file-size {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: normal;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 200px;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #f3f4f6;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.file-action:hover {
    background: #e5e7eb;
}

.file-action--delete {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

.file-action--delete:hover {
    background: #fee2e2;
}

.file-action--retry {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.file-action--retry:hover {
    background: #dbeafe;
}

/* ====== PROGRESS BAR ====== */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.error-message {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #991b1b;
}

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 768px) {
    .upload-container {
        margin: 1rem;
        padding: 1rem;
    }
    
    .upload-drop-zone {
        padding: 2rem 1rem;
    }
    
    .drop-zone-icon {
        font-size: 2rem;
    }
    
    .file-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-name {
        min-width: auto;
        width: 100%;
    }
    
    /* Slightly smaller scroll box on mobile */
    .uploaded-files-list {
        max-height: 320px;
    }
    
    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* ====== ANIMATIONS ====== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Disable animations for upload items to prevent flicker */
.file-item { animation: none; }

.upload-error {
    animation: fadeIn 0.3s ease;
}

/* ====== PROCESSING ANIMATION ====== */
.file-item.processing .file-icon {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ====== INTEGRATION WITH EXISTING STYLES ====== */
.upload-container {
    font-family: inherit;
}

.upload-container * {
    box-sizing: border-box;
}

/* ====== UPLOAD HEADER + TOOLTIP ====== */
.upload-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 28px;
}

.upload-title {
    font-size: 24px;
    font-weight: 600;
}

.upload-tip {
    position: relative;
}

.info-btn {
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    padding: 2px 8px;
    line-height: 1;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
}

.info-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.tip-popover {
    position: absolute;
    top: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    padding: 12px;
    font-size: 13px;
    color: #374151;
    opacity: 0;
    pointer-events: none;
    display: none;
    transition: opacity .12s ease, transform .12s ease;
    z-index: 30;
}

.upload-tip:hover .tip-popover,
.upload-tip:focus-within .tip-popover {
    display: block;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
