/* ============================================
   🎨 ELITE RECEIPT SCANNER - PROGRESS TRACKER
   Sistema de processamento em segundo plano elegante
   ============================================ */

/* Container flutuante no canto inferior direito */
#elite-scanner-progress {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-height: 500px;
    z-index: 9500;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#elite-scanner-progress.active {
    pointer-events: auto;
}

/* Card principal */
.scanner-progress-card {
    background: linear-gradient(135deg,
        rgba(5, 5, 15, 0.98) 0%,
        rgba(10, 10, 25, 0.98) 100%);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#elite-scanner-progress.active .scanner-progress-card {
    transform: translateY(0);
    opacity: 1;
}

/* Header do card */
.scanner-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.scanner-progress-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #22d3ee;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.scanner-progress-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #22d3ee, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    animation: scanner-pulse 2s ease-in-out infinite;
}

@keyframes scanner-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(34, 211, 238, 0);
    }
}

.scanner-progress-close {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8B8B9A;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.scanner-progress-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: rotate(90deg);
}

/* Status geral */
.scanner-overall-status {
    margin-bottom: 1rem;
}

.scanner-overall-text {
    font-size: 0.875rem;
    color: #F5F5F7;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scanner-overall-count {
    color: #8b5cf6;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    background: rgba(139, 92, 246, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Barra de progresso geral */
.scanner-overall-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.scanner-overall-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #8b5cf6, #ec4899);
    border-radius: 3px;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.scanner-overall-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent);
    animation: scanner-shimmer 1.5s infinite;
}

@keyframes scanner-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Lista de arquivos */
.scanner-files-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 1rem;
}

.scanner-files-list::-webkit-scrollbar {
    width: 6px;
}

.scanner-files-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.scanner-files-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.scanner-files-list::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Item individual */
.scanner-file-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: scanner-file-entrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scanner-file-entrance {
    0% {
        transform: translateX(20px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.scanner-file-item.processing {
    border-color: rgba(34, 211, 238, 0.3);
    background: rgba(34, 211, 238, 0.05);
}

.scanner-file-item.success {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.scanner-file-item.error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.scanner-file-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.scanner-file-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.scanner-file-icon i {
    font-size: 1rem;
}

.scanner-file-item.processing .scanner-file-icon {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
}

.scanner-file-item.processing .scanner-file-icon i {
    animation: scanner-spin 1s linear infinite;
}

@keyframes scanner-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.scanner-file-item.success .scanner-file-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.scanner-file-item.error .scanner-file-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.scanner-file-info {
    flex: 1;
    min-width: 0;
}

.scanner-file-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #F5F5F7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.scanner-file-status {
    font-size: 0.75rem;
    color: #8B8B9A;
    font-weight: 500;
}

.scanner-file-item.processing .scanner-file-status {
    color: #22d3ee;
}

.scanner-file-item.success .scanner-file-status {
    color: #10b981;
}

.scanner-file-item.error .scanner-file-status {
    color: #ef4444;
}

/* Ações finais */
.scanner-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    display: none;
}

.scanner-actions.active {
    display: block;
}

.scanner-action-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #22d3ee, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
}

.scanner-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.4);
}

.scanner-action-btn:active {
    transform: translateY(0);
}

/* Responsivo */
@media (max-width: 768px) {
    #elite-scanner-progress {
        width: calc(100% - 32px);
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    #elite-scanner-progress {
        width: calc(100% - 24px);
        right: 12px;
        bottom: 12px;
    }

    .scanner-progress-card {
        padding: 1.25rem;
    }

    .scanner-files-list {
        max-height: 200px;
    }
}

/* Light Mode */
[data-theme="light"] .scanner-progress-card {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 248, 252, 0.98) 100%);
    border-color: rgba(0, 122, 255, 0.2);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 80px rgba(0, 122, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

[data-theme="light"] .scanner-progress-header {
    border-bottom-color: rgba(0, 122, 255, 0.15);
}

[data-theme="light"] .scanner-progress-title {
    color: #007AFF;
}

[data-theme="light"] .scanner-file-name {
    color: #1D1D1F;
}

[data-theme="light"] .scanner-file-status {
    color: #3C3C43;
}

[data-theme="light"] .scanner-file-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .scanner-file-item.processing {
    border-color: rgba(0, 122, 255, 0.3);
    background: rgba(0, 122, 255, 0.05);
}

[data-theme="light"] .scanner-file-item.success {
    border-color: rgba(52, 199, 89, 0.3);
    background: rgba(52, 199, 89, 0.05);
}

[data-theme="light"] .scanner-file-item.error {
    border-color: rgba(255, 59, 48, 0.3);
    background: rgba(255, 59, 48, 0.05);
}
