/* PREMIUM GLASSMORPHIC PRELOADER STYLES - OPTIMIZED & RESPONSIVE */

:root {
    --preloader-bg-light: rgba(255, 255, 255, 0.45);
    --preloader-bg-dark: rgba(15, 23, 42, 0.45);
    --preloader-blur: 20px;
    --preloader-z: 100000; /* Higher priority */
}

#preloader-premium {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--preloader-bg-light);
    backdrop-filter: blur(var(--preloader-blur));
    -webkit-backdrop-filter: blur(var(--preloader-blur));
    z-index: var(--preloader-z);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, visibility;
}

[data-theme='dark'] #preloader-premium {
    background: var(--preloader-bg-dark);
}

.preloader-content-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    max-width: 100%;
}

.preloader-logo-container {
    position: relative;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 200px;
    min-height: 140px;
}

.preloader-logo-img {
    height: auto;
    width: auto;
    max-width: 260px;
    max-height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.12));
    animation: preloader-pulse-scale 2.5s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.preloader-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    margin-top: -100px;
    margin-left: -100px;
    border: 3px solid transparent;
    border-top-color: var(--bs-primary, #3b82f6);
    border-radius: 50%;
    animation: preloader-spin 1.8s linear infinite;
    opacity: 0.6;
    z-index: 1;
}

.preloader-glow-ring::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 3px solid transparent;
    border-bottom-color: #2dd4bf;
    border-radius: 50%;
    animation: preloader-spin-rev 2.2s linear infinite;
    opacity: 0.3;
}

/* Response for Mobile */
@media (max-width: 576px) {
    .preloader-logo-img {
        max-width: 200px;
        max-height: 100px;
    }
    .preloader-glow-ring {
        width: 160px;
        height: 160px;
        margin-top: -80px;
        margin-left: -80px;
    }
}

/* Animations */
@keyframes preloader-pulse-scale {
    0%, 100% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.05) translateY(-5px); opacity: 1; }
}

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

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

.preloader-dots {
    display: flex;
    gap: 12px;
}

.preloader-dot {
    width: 12px;
    height: 12px;
    background: var(--bs-primary, #3b82f6);
    border-radius: 50%;
    animation: preloader-dot-pulse 1.4s ease-in-out infinite both;
}

.preloader-dot:nth-child(2) { animation-delay: 0.2s; background: #2dd4bf; }
.preloader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes preloader-dot-pulse {
    0%, 80%, 100% { transform: scale(0.3); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

#preloader-premium.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.preloader-active {
    overflow: hidden !important;
    height: 100vh !important;
}
