/* ===============================================
   BALKRISHNA BANQUETS - FAIL-PROOF PRELOADER
   ===============================================
   Simple, lightweight, and fail-proof preloader
   Version: 1.0 | Date: 2024-12-19
   =============================================== */

/* Preloader Container */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #C38208 0%, #8B5A00 100%);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* Preloader Content */
.preloader-content {
    text-align: center;
    color: white;
}

/* Logo Animation */
.preloader-logo {
    width: 360px;
    height: 360px;
    margin: 0 auto 30px;
    animation: logoFloat 2s ease-in-out infinite;
}

.preloader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Loading Text */
.preloader-text {
    font-family: 'Arial', sans-serif;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    opacity: 0.9;
}

/* Loading Spinner */
.preloader-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Progress Bar */
.preloader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 20px auto 0;
    overflow: hidden;
}

.preloader-progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
    animation: progressLoad 3s ease-out forwards;
}

/* Animations */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes progressLoad {
    0% { width: 0%; }
    20% { width: 30%; }
    40% { width: 60%; }
    60% { width: 80%; }
    80% { width: 95%; }
    100% { width: 100%; }
}

/* Fade Out Animation */
#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .preloader-logo {
        width: 240px;
        height: 240px;
        margin-bottom: 20px;
    }
    
    .preloader-text {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .preloader-progress {
        width: 150px;
    }
    
    .preloader-spinner {
        width: 40px;
        height: 40px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #preloader {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    #preloader {
        background: #000000;
    }
    
    .preloader-logo img {
        filter: brightness(0) invert(1);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .preloader-logo,
    .preloader-spinner,
    .preloader-progress-bar {
        animation: none;
    }
    
    .preloader-logo {
        transform: none;
    }
    
    .preloader-spinner {
        border-top-color: white;
    }
    
    .preloader-progress-bar {
        width: 100%;
    }
}
