/* ===========================================
   POPUP DE PROGRESO - Argun
   Sistema de seguimiento de tareas de búsqueda
   =========================================== */

.progress-popup {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg, rgba(10, 14, 23, 0.95), rgba(22, 33, 62, 0.95));
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    z-index: 9999;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

.progress-popup.show {
    display: block;
    animation: slideInUp 0.3s ease-out;
}

.progress-popup.minimized {
    height: 60px;
}

.progress-popup.minimized .progress-popup-content {
    display: none;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.progress-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    background: rgba(0, 255, 255, 0.05);
    border-radius: 10px 10px 0 0;
}

.progress-popup-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.progress-popup-title i {
    font-size: 1.1rem;
    animation: pulse 2s ease-in-out infinite;
}

.progress-popup-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.progress-popup-toggle,
.progress-popup-close {
    background: transparent;
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: rgba(0, 255, 255, 0.2);
    touch-action: manipulation;
}

.progress-popup-toggle:hover,
.progress-popup-close:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.progress-popup-close:hover {
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
    color: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
}

.progress-popup-toggle i {
    transition: transform 0.3s ease;
}

.progress-popup-content {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Suaviza el scroll en iOS */
}

.progress-popup-content::-webkit-scrollbar {
    width: 6px;
}

.progress-popup-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.progress-popup-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.4);
    border-radius: 3px;
}

.progress-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.6);
}

.progress-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-task {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.progress-task:hover {
    border-color: rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
}

.progress-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-task-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #00d4aa;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.progress-task-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.task-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    -webkit-tap-highlight-color: rgba(0, 255, 255, 0.2);
    touch-action: manipulation;
}

.task-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transform: scale(1.1);
}

.task-btn.task-pause:hover {
    background: rgba(255, 152, 0, 0.2);
    border-color: #ff9800;
    color: #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.3);
}

.task-btn.task-resume {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
    color: #4caf50;
}

.task-btn.task-resume:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
}

.task-btn.task-cancel:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
    color: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
}

.task-btn.task-restart {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.4);
    color: #2196f3;
}

.task-btn.task-restart:hover {
    background: rgba(33, 150, 243, 0.3);
    border-color: #2196f3;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.4);
}

.progress-task-status-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.progress-task-status {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-task-status.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.progress-task-status.running {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
    animation: pulse 1.5s ease-in-out infinite;
}

.progress-task-status.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.progress-task-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.progress-task-status.paused {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.progress-task-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.progress-task-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #00d4aa);
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.progress-task-bar-fill.error {
    background: linear-gradient(90deg, #f44336, #ff6b6b);
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

.progress-task-bar-fill.success {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.progress-task-bar-fill.animated {
    animation: progressPulse 1.5s ease-in-out infinite;
}

.progress-task-bar-fill.paused {
    background: linear-gradient(90deg, #ff9800, #ffb74d);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
    animation: none;
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.progress-task-details {
    margin-top: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.progress-task-error {
    margin-top: 8px;
    padding: 8px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #ff6b6b;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.progress-float-button {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffff, #00d4aa);
    border: 3px solid rgba(0, 255, 255, 0.8);
    color: #0a0e17;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 5px 25px rgba(0, 255, 255, 0.6), 
        0 0 40px rgba(0, 255, 255, 0.4),
        0 0 60px rgba(0, 255, 255, 0.2);
    z-index: 99999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: floatPulse 2s ease-in-out infinite;
    -webkit-tap-highlight-color: rgba(0, 255, 255, 0.3);
    touch-action: manipulation;
}

.progress-float-button.visible {
    display: flex !important;
}

.progress-float-button:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 
        0 10px 40px rgba(0, 255, 255, 0.8), 
        0 0 60px rgba(0, 255, 255, 0.6),
        0 0 80px rgba(0, 255, 255, 0.3);
}

.progress-float-button:active {
    transform: scale(1.05);
}

.progress-float-button i {
    font-size: 1.8rem;
    font-weight: bold;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.progress-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #f44336, #ff6b6b);
    color: white;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    border: 3px solid #0a0e17;
    box-shadow: 
        0 3px 12px rgba(244, 67, 54, 0.6),
        0 0 20px rgba(244, 67, 54, 0.4);
    animation: badgePulse 1.5s ease-in-out infinite;
}

.progress-badge.success {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    box-shadow: 
        0 3px 12px rgba(76, 175, 80, 0.6),
        0 0 20px rgba(76, 175, 80, 0.4);
}

@keyframes floatPulse {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Responsive para popup de progreso */
@media (max-width: 768px) {
    .progress-popup {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        max-height: 70vh;
    }
    
    .progress-popup.minimized {
        height: 55px;
    }
    
    .progress-popup-header {
        padding: 12px 15px;
    }
    
    .progress-popup-title {
        font-size: 0.9rem;
    }
    
    .progress-popup-title i {
        font-size: 1rem;
    }
    
    .progress-popup-toggle,
    .progress-popup-close {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .progress-popup-content {
        max-height: calc(70vh - 70px);
        padding: 12px;
    }
    
    .progress-task {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .progress-task-name {
        font-size: 0.85rem;
    }
    
    .progress-task-name i {
        font-size: 0.9rem;
    }
    
    .progress-task-status {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    .progress-task-details {
        font-size: 0.8rem;
    }
    
    .progress-task-error {
        font-size: 0.8rem;
        padding: 8px;
    }
    
    .task-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .progress-float-button {
        bottom: 110px;
        right: 15px;
        width: 56px;
        height: 56px;
    }
    
    .progress-float-button i {
        font-size: 1.3rem;
    }
    
    .progress-badge {
        top: -5px;
        right: -5px;
        min-width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media (max-width: 480px) {
    .progress-popup {
        bottom: 5px;
        right: 5px;
        left: 5px;
        max-height: 60vh;
    }
    
    .progress-popup-content {
        max-height: calc(60vh - 60px);
    }
    
    .progress-popup-title {
        font-size: 0.85rem;
    }
    
    .progress-task-controls {
        gap: 4px;
    }
    
    .task-btn {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    
    .progress-float-button {
        width: 52px;
        height: 52px;
        bottom: 105px;
    }
}

