/* Preloader Styles - Clean and Elegant */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s, visibility 0.3s;
    overflow: hidden;
    will-change: opacity, visibility;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%);
    z-index: -1;
}

.logo-container {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.logo {
    width: 150px;
    height: 150px;
    position: relative;
    z-index: 2;
    transform-origin: center;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
    will-change: transform;
}

.logo-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    filter: blur(15px);
    z-index: 1;
    animation: breathe 4s infinite alternate;
    will-change: transform, opacity;
}

.spinner {
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #3b82f6;
    animation: spin 1.2s linear infinite;
}

.spinner:before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-right-color: #4f46e5;
    animation: spin 1.8s linear infinite reverse;
}

.loading-text {
    position: absolute;
    bottom: -40px;
    color: #1e40af;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    opacity: 0.9;
}

.dots {
    display: inline-block;
    margin-left: 3px;
}

.dots::after {
    content: "";
    animation: dots 1.5s infinite;
}

.progress-container {
    position: absolute;
    bottom: -20px;
    width: 140px;
    height: 3px;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #3b82f6, #4f46e5);
    border-radius: 3px;
    transition: width 0.3s ease-out;
    position: relative;
}

.progress-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shine 1.5s infinite;
}

/* Keyframes for animations - clean and elegant */
@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes breathe {
    0% {
        opacity: 0.3;
        transform: scale(0.9);
    }
    100% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes dots {
    0%,
    20% {
        content: ".";
    }
    40% {
        content: "..";
    }
    60%,
    100% {
        content: "...";
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .logo {
        width: 120px;
        height: 120px;
    }

    .logo-glow {
        width: 140px;
        height: 140px;
    }

    .spinner {
        width: 140px;
        height: 140px;
    }

    .loading-text {
        font-size: 12px;
        bottom: -35px;
    }

    .progress-container {
        width: 120px;
        bottom: -16px;
    }
}

/* Page-specific loader styles */
#pageLoader {
    backdrop-filter: blur(8px);
}

#pageLoader .inline-block {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

#pageLoader p {
    animation: fadeInOut 1.5s infinite;
    position: relative;
}

#pageLoader p::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, transparent, #3b82f6, transparent);
    border-radius: 2px;
}

@keyframes fadeInOut {
    0%,
    100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}
