/* =============================================
   PAGE LOADING ANIMATION
   ============================================= */

/* Preloader Overlay */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1A202C 0%, #2D3748 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Logo Animation */
.loader-logo {
    width: 200px;
    height: auto;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-logo 1.5s ease-in-out infinite;
}

.loader-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

@keyframes pulse-logo {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Tiles Animation (Brand specific) */
.loader-tiles {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.loader-tile {
    width: 20px;
    height: 20px;
    background: #F6AD55;
    border-radius: 4px;
    animation: tile-bounce 1.2s ease-in-out infinite;
}

.loader-tile:nth-child(1) { animation-delay: 0s; }
.loader-tile:nth-child(2) { animation-delay: 0.1s; }
.loader-tile:nth-child(3) { animation-delay: 0.2s; }
.loader-tile:nth-child(4) { animation-delay: 0.3s; }

@keyframes tile-bounce {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Spinner */
.loader-spinner {
    width: 50px;
    height: 50px;
    position: relative;
    margin-bottom: 1.5rem;
}

.loader-spinner::before,
.loader-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
}

.loader-spinner::before {
    border-top-color: #F6AD55;
    animation: spin 1s linear infinite;
}

.loader-spinner::after {
    border-bottom-color: #ED8936;
    animation: spin 1s linear infinite reverse;
    animation-delay: 0.2s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Text */
.loader-text {
    color: #F6AD55;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    animation: fade-text 1.5s ease-in-out infinite;
}

@keyframes fade-text {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Progress Bar */
.loader-progress {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #F6AD55, #ED8936);
    border-radius: 3px;
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
        margin-left: 0;
    }
    50% {
        width: 70%;
        margin-left: 15%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* Hide page content initially */
body.loading {
    overflow: hidden;
}

/* Page content fade in */
.page-content {
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .loader-logo {
        width: 150px;
    }
    
    .loader-progress {
        width: 150px;
    }
    
    .loader-text {
        font-size: 1rem;
        letter-spacing: 2px;
    }
}