/* Popup Overlay */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
}

.popup-overlay.active {
    opacity: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Popup Step */
.popup-step {
    background: #fff;
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
    display: none;
}

.popup-step.active {
    opacity: 1;
    transform: scale(1);
    display: block !important;
}

/* Popup Header */
.popup-header {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    padding: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

.user-details {
    text-align: center;
}

.username {
    font-weight: 600;
    font-size: 16px;
    color: #212529;
}

/* Step Numbers */
.step-numbers {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.step {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #adb5bd;
    transition: all 0.3s ease;
}

.step.active {
    background: #007bff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* Popup Content */
.popup-content {
    padding: 24px;
}

/* Task Section */
.task-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.task-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.task-header i {
    font-size: 24px;
    color: #007bff;
}

.task-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.task-section p {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Processing Section */
.processing-section {
    text-align: center;
    padding: 20px 0;
}

.processing-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 16px;
}

.processing-section p {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 16px;
}

.loading-spinner {
    font-size: 36px;
    color: #007bff;
    margin: 24px 0;
}

.timer {
    font-size: 28px;
    font-weight: 700;
    color: #007bff;
    margin-top: 16px;
    font-variant-numeric: tabular-nums;
}

/* Progress Section */
.progress-section {
    text-align: center;
}

.progress-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
}

.progress-section p {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 20px;
}

.progress {
    height: 12px;
    margin: 20px 0;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(to right, #007bff, #4da6ff);
    height: 100%;
    transition: width 0.3s ease;
}

.progress-numbers {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
}

.current {
    color: #007bff;
}

.total {
    color: #6c757d;
}

/* Buttons */
.task-button {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-success {
    background: #007bff;
    border: none;
    color: #fff;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-success:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .popup-step {
        width: 95%;
        max-width: none;
        margin: 16px;
    }

    .popup-header {
        padding: 20px;
    }

    .popup-content {
        padding: 20px;
    }

    .task-section {
        padding: 16px;
    }

    .task-header h3 {
        font-size: 14px;
    }

    .processing-section h3,
    .progress-section h3 {
        font-size: 16px;
    }
}
