/* ========================================
   STEP 1 IMPROVEMENTS - Drag & Drop Enhanced
   ======================================== */

/* Drag Active State */
#uploadArea.drag-active {
    border-color: var(--primary, #9359f8) !important;
    background: linear-gradient(135deg, rgba(147, 89, 248, 0.1) 0%, rgba(147, 89, 248, 0.05) 100%) !important;
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(147, 89, 248, 0.3), 
                inset 0 0 20px rgba(147, 89, 248, 0.1);
}

#uploadArea.drag-active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, 
        var(--primary, #9359f8), 
        var(--accent-cyan, #00d9ff),
        var(--primary, #9359f8)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderGlow 2s linear infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Improved Upload Area Hover */
#uploadArea:hover:not(.drag-active) {
    border-color: rgba(147, 89, 248, 0.5);
    background: rgba(147, 89, 248, 0.03);
    transform: translateY(-2px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   EXTRACTION PREVIEW IMPROVEMENTS
   ======================================== */

/* Editable Field Indicators */
.glass-input.edited,
.editable-item-field.edited {
    border-left: 3px solid var(--success-green, #10b981) !important;
    background: rgba(16, 185, 129, 0.05) !important;
}

.glass-input:focus,
.editable-item-field:focus {
    border-color: var(--primary, #9359f8) !important;
    box-shadow: 0 0 0 3px rgba(147, 89, 248, 0.1) !important;
}

/* Field Edit Icons */
.field-group {
    position: relative;
}

.field-group:hover .edit-icon {
    opacity: 1;
}

.edit-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--primary, #9359f8);
    font-size: 16px;
    pointer-events: none;
}

/* Stats Row Enhancement */
#fieldsExtracted,
#fieldsEdited {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary, #9359f8), var(--accent-cyan, #00d9ff));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   PROCESSING ANIMATION IMPROVEMENTS
   ======================================== */

/* Enhanced Progress Bar */
#progressFill {
    background: linear-gradient(90deg, 
        var(--primary, #9359f8) 0%, 
        var(--accent-cyan, #00d9ff) 50%,
        var(--primary, #9359f8) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    box-shadow: 0 0 15px rgba(147, 89, 248, 0.5);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Processing Steps Indicator */
.processing-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s;
}

.processing-step.active {
    color: var(--primary, #9359f8);
    font-weight: 600;
}

.processing-step.complete {
    color: var(--success-green, #10b981);
}

.processing-step .step-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
}

.processing-step.active .step-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

.processing-step.complete .step-icon::after {
    content: '✓';
    font-size: 12px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ========================================
   SECTION CARDS & ACCORDIONS
   ======================================== */

.section-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.section-card:hover {
    border-color: rgba(147, 89, 248, 0.3);
    background: rgba(147, 89, 248, 0.05);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.section-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-icon {
    font-size: 18px;
    color: var(--primary, #9359f8);
}

.collapse-icon {
    transition: transform 0.3s;
    color: rgba(255, 255, 255, 0.5);
}

.section-card.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.section-content {
    margin-top: 16px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s;
}

.section-card.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* ========================================
   BADGES & INDICATORS
   ======================================== */

.field-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-verified {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-green, #10b981);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-edited {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning-orange, #fbbf24);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-missing {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-red, #ef4444);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ========================================
   QUALITY SCORE INDICATOR
   ======================================== */

.quality-score {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 16px;
}

.score-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    background: conic-gradient(
        var(--primary, #9359f8) calc(var(--score, 0) * 1%),
        rgba(255, 255, 255, 0.1) 0
    );
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--glass-bg, #0a0a0f);
}

.score-value {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--primary, #9359f8), var(--accent-cyan, #00d9ff));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-label {
    flex: 1;
}

.score-label h5 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.score-label p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}
