/* Loader Container - Full Screen Overlay */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3bb78f, #003a20);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    
    

    /* Smooth transition */
    transition: opacity 0.2s ease-in-out ,visibility 0.2s ease-in-out;
 
}

.loader-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Animated Background */
.loader-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.15;
}

.loader-background::before,
.loader-background::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(100px);
    animation: float 8s ease-in-out infinite;
}

.loader-background::before {
    background:  linear-gradient(45deg, #00b327, #ff9900);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.loader-background::after {
    background:  linear-gradient(45deg, #00b327, #ff9900);
    bottom: -250px;
    right: -250px;
    animation-delay: 2s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(100px, -100px) scale(1.1);
    }

    66% {
        transform: translate(-100px, 100px) scale(0.9);
    }
}

/* Loader Content */
.loader-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* Logo Animation */
.loader-logo {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: logoGlow 2s ease-in-out infinite;
}

.loader-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 15px;
}

.loader-logo::before {
    content: '';
    position: absolute;
    inset: -2px;
    background:  linear-gradient(45deg, #00b327, #ff9900);
    border-radius: 30px;
    z-index: -1;
    opacity: 0;
    animation: gradientPulse 2s ease-in-out infinite;
}

@keyframes logoGlow {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.5);
    }
}

@keyframes gradientPulse {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 0.6;
    }
}

/* Spinner */
.loader-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #eef5ff;
    animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
    border-top-color: #ffffff;
    animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
    border-top-color: #10b981;
    animation-delay: -0.15s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* Loading Text */
.loader-text {
    text-align: center;
}

.loader-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px 0;
    background:  linear-gradient(45deg, #00b327, #ff9900);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.loader-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-weight: 400;
    letter-spacing: 1px;
}

/* Progress Bar */
.loader-progress {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
}

.progress-bar {
    height: 100%;
    background:  linear-gradient(45deg, #00b327, #ff9900);
    background-size: 200% 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressGradient 2s linear infinite;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

@keyframes progressGradient {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* Loading Status Text */
.loader-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    min-height: 20px;
    margin-top: 12px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Percentage Display */
.loader-percentage {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    margin: 20px 0;
    font-family: 'Arial', sans-serif;
    text-shadow: 0 0 20px rgb(255, 255, 255);
}

/* Dots Animation */
.loading-dots {
    display: inline-flex;
    gap: 6px;
    margin-left: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: rgb(255, 255, 255);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loader-logo {
        width: 100px;
        height: 100px;
    }

    .loader-logo img {
        width: 60px;
        height: 60px;
    }

    .loader-title {
        font-size: 24px;
    }

    .loader-subtitle {
        font-size: 14px;
    }

    .loader-progress {
        width: 250px;
    }

    .loader-percentage {
        font-size: 36px;
    }

    .loader-spinner {
        width: 60px;
        height: 60px;
    }
}