/* Overlay */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

/* Show popup */
.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup Box */
.popup {
    background: linear-gradient(135deg, #183047, #07645c);
    width: 92%;
    max-width: 480px;
    border-radius: 16px;border:1px dotted white;
    padding: 24px 20px 30px;
    color: #fff;
    text-align: center;
    position: relative;
    transform: scale(0.7) translateY(40px);
    transition: all 0.4s ease;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

/* Animation */
.popup-overlay.active .popup {
    transform: scale(1) translateY(0);
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 20px;
    cursor: pointer;
    background: rgba(255,255,255,0.25);
    width: 32px;
    height: 32px; 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Headings */
.popup h2 {
   font-size: 27px;
    margin-bottom: 10px;
    font-weight: 700;
    color: white;
}

.popup .timer {
    font-size: 14px;
    margin-bottom: 15px;
    opacity: 0.9;
}

/* Offer Text */
.popup p {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 16px;     color: #cecece;
}

/* Call Button */
.call-btn {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: black;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
    
     animation: magneticPulse 2s infinite;
}

 @keyframes magneticPulse {
        0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
        70% { box-shadow: 0 0 0 15px rgba(245, 158, 11, 0); }
        100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
    }
    
.call-btn:hover { 
    background: #f59e0b;
    color: black; 
}

/* Pulse animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* Small Text */
.popup .note {
       font-size: 13px;
    margin-top: 26px;
    opacity: 0.95;
    font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
    .popup h2 {
        font-size: 20px;
    }
    .call-btn {
        font-size: 15px; 
        padding: 13px 20px;
    }
    
    .popup { 
    max-width: 420px;
    }
}





.overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(15, 23, 42, 0.85);
            backdrop-filter: blur(10px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            animation: fadeIn 0.3s ease;
            overflow-y: auto;
            padding: 20px;
        }

        .overlay.active {
            display: flex;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* HEARTBEAT FOR WHOLE POPUP */
@keyframes popupHeartbeat {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.30);
    }
    35% {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 28px 70px rgba(0, 0, 0, 0.40);
    }
    55% {
        transform: translateY(-1px) scale(1.01);
        box-shadow: 0 26px 65px rgba(0, 0, 0, 0.35);
    }
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.30);
    }
}

.popup-container {
    background: white;
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    padding: 48px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    /* Ã°Å¸â€˜â€¡ DOUBle animation: entry + heartbeat */
    animation: 
        slideUp 0.4s ease,
        popupHeartbeat 3.2s ease-in-out infinite 0.4s;
    position: relative;
    text-align: center;
}


        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(40px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .close-btn {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #f1f5f9;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            font-size: 18px;
            color: #64748b;
        }

        .close-btn:hover {
            background: #e2e8f0;
            transform: rotate(90deg);
        }

        .stage-section {
            display: none;
        }

        .stage-section.active {
            display: block;
            animation: slideInRight 0.5s ease;
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(30px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .stage-icon {
            width: 100px;
            height: 100px;
            margin: 0 auto 28px;
        }

        /* Stage 1: Processing with rotating spinner */
        .spinner {
            width: 100px;
            height: 100px;
            border: 3px solid #e2e8f0;
            border-top: 3px solid #3b82f6;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Stage 2: Searching with animated dots */
        .search-icon {
            width: 100px;
            height: 100px;
            background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .search-icon svg {
            width: 50px;
            height: 50px;
            stroke: #3b82f6;
            stroke-width: 2;
            fill: none;
            animation: searchPulse 1.5s ease-in-out infinite;
        }

        @keyframes searchPulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.1); opacity: 0.8; }
        }

        .search-dots {
            position: absolute;
            bottom: -30px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 8px;
        }

        .search-dot {
            width: 8px;
            height: 8px;
            background: #3b82f6;
            border-radius: 50%;
            animation: dotPulse 1.4s ease-in-out infinite;
        }

        .search-dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .search-dot:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes dotPulse {
            0%, 60%, 100% { transform: scale(1); opacity: 0.5; }
            30% { transform: scale(1.5); opacity: 1; }
        }

        /* Stage 3: Deep Loading with circular progress */
        .loading-icon {
            width: 100px;
            height: 100px;
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .circular-progress {
            width: 100px;
            height: 100px;
            position: absolute;
            transform: rotate(-90deg);
        }

        .circular-progress circle {
            width: 100%;
            height: 100%;
            fill: none;
            stroke: #f59e0b;
            stroke-width: 3;
            stroke-linecap: round;
            stroke-dasharray: 283;
            stroke-dashoffset: 283;
            animation: progressCircle 2s ease-in-out infinite;
        }

        @keyframes progressCircle {
            0% { stroke-dashoffset: 283; }
            50% { stroke-dashoffset: 70; }
            100% { stroke-dashoffset: 283; }
        }

        .loading-icon svg {
            width: 50px;
            height: 50px;
            stroke: #f59e0b;
            stroke-width: 2;
            fill: none;
        }

        /* Stage 4: Still Searching with radar effect */
        .radar-icon {
            width: 100px;
            height: 100px;
            background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }

        .radar-wave {
            position: absolute;
            width: 100%;
            height: 100%;
            border: 2px solid #6366f1;
            border-radius: 50%;
            opacity: 0;
            animation: radarWave 2s ease-out infinite;
        }

        .radar-wave:nth-child(2) {
            animation-delay: 0.5s;
        }

        .radar-wave:nth-child(3) {
            animation-delay: 1s;
        }

        @keyframes radarWave {
            0% {
                transform: scale(0.5);
                opacity: 1;
            }
            100% {
                transform: scale(2);
                opacity: 0;
            }
        }

        .radar-icon svg {
            width: 50px;
            height: 50px;
            stroke: #6366f1;
            stroke-width: 2;
            fill: none;
            z-index: 2;
        }

        /* Stage 5: Success */
        .success-icon {
            width: 100px;
            height: 100px;
background: linear-gradient(135deg, #FF9800 0%, #ffc773e6 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: scaleIn 0.5s ease;
        }

        @keyframes scaleIn {
            from {
                transform: scale(0);
                opacity: 0;
            }
            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .success-icon svg {
            width: 50px;
            height: 50px;
            stroke: white;
            stroke-width: 3;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .checkmark {
            stroke-dasharray: 100;
            stroke-dashoffset: 100;
            animation: drawCheck 0.6s ease forwards;
            animation-delay: 0.2s;
        }

        @keyframes drawCheck {
            to { stroke-dashoffset: 0; }
        }

        .stage-title {
            font-size: 22px;
            font-weight: 700;
            color: #1e293b;
            margin-bottom: 10px;
            letter-spacing: -0.3px;
        }

        .stage-description {
            font-size: 15px;
            color: #64748b;
            line-height: 1.5;
            margin-bottom: 28px;
        }

        /* Progress bar - hidden */
        .progress-container {
            display: none;
        }

        .agent-card {
            background: #f8fafc;
            border-radius: 14px;
            padding: 20px;
            margin-top: 24px;
            border: 1px solid #e2e8f0;
        }

        .agent-info {
            display: flex;
            align-items: center;
            gap: 14px;
            text-align: left;
        }
        
        p.timer-text {
    color: red;
    font-size: 17px;
    font-weight: 700;
}