/* ====================================================================
   MAGIC LOADING OVERLAY - Premium Pink Theme with Timer
   ==================================================================== */

.magic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, rgba(255, 0, 102, 0.95), rgba(136, 51, 255, 0.95));
    backdrop-filter: blur(20px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.magic-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Animated Magic Circle */
.magic-circle {
    width: 200px;
    height: 200px;
    position: relative;
    margin-bottom: 30px;
}

.magic-circle-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #fff;
    border-right-color: #fff;
    border-radius: 50%;
    animation: magic-spin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.magic-circle-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: #ff66cc;
    border-right-color: #ff66cc;
    animation-delay: -0.5s;
    animation-duration: 1.5s;
}

.magic-circle-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: #ffaaff;
    border-right-color: #ffaaff;
    animation-delay: -1s;
    animation-duration: 1s;
}

@keyframes magic-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Magic Icon */
.magic-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    animation: magic-pulse 1.5s ease-in-out infinite;
}

@keyframes magic-pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        filter: drop-shadow(0 0 40px rgba(255, 102, 204, 1));
    }
}

/* Magic Text */
.magic-text {
    font-size: 32px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 102, 204, 0.8),
        0 0 40px rgba(255, 102, 204, 0.6);
    animation: magic-glow 2s ease-in-out infinite;
}

@keyframes magic-glow {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(255, 102, 204, 0.8),
            0 0 40px rgba(255, 102, 204, 0.6);
    }

    50% {
        text-shadow: 0 0 30px rgba(255, 255, 255, 1),
            0 0 60px rgba(255, 102, 204, 1),
            0 0 80px rgba(136, 51, 255, 0.8);
    }
}

/* Operation Description */
.magic-operation {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    text-align: center;
    max-width: 600px;
    line-height: 1.6;
}

/* Countdown Timer */
.magic-timer {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.magic-timer-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.magic-timer-value {
    font-size: 48px;
    font-weight: 700;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    min-width: 120px;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

/* Progress Bar */
.magic-progress {
    width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-top: 30px;
    overflow: hidden;
    position: relative;
}

.magic-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fff, #ff66cc, #8833ff);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 102, 204, 0.8);
}

/* Floating Particles */
.magic-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.magic-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: magic-particle-float 3s ease-in-out infinite;
}

.magic-particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.magic-particle:nth-child(2) {
    left: 20%;
    animation-delay: 0.5s;
}

.magic-particle:nth-child(3) {
    left: 30%;
    animation-delay: 1s;
}

.magic-particle:nth-child(4) {
    left: 40%;
    animation-delay: 1.5s;
}

.magic-particle:nth-child(5) {
    left: 50%;
    animation-delay: 2s;
}

.magic-particle:nth-child(6) {
    left: 60%;
    animation-delay: 2.5s;
}

.magic-particle:nth-child(7) {
    left: 70%;
    animation-delay: 0.7s;
}

.magic-particle:nth-child(8) {
    left: 80%;
    animation-delay: 1.2s;
}

.magic-particle:nth-child(9) {
    left: 90%;
    animation-delay: 1.8s;
}

@keyframes magic-particle-float {
    0% {
        bottom: 0;
        opacity: 0;
        transform: translateX(0) scale(0);
    }

    10% {
        opacity: 1;
        transform: translateX(10px) scale(1);
    }

    90% {
        opacity: 1;
        transform: translateX(-10px) scale(1);
    }

    100% {
        bottom: 100%;
        opacity: 0;
        transform: translateX(0) scale(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .magic-text {
        font-size: 24px;
    }

    .magic-timer-value {
        font-size: 36px;
        min-width: 100px;
    }

    .magic-progress {
        width: 90%;
    }

    .magic-circle {
        width: 150px;
        height: 150px;
    }

    .magic-icon {
        font-size: 40px;
    }
}