/* Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}



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

/* Brick Container */
.brick-container {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Particle Effects */
.brick-container::before,
.brick-container::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(224, 91, 38, 0.8);
    border-radius: 50%;
    animation: particleFloat 2s ease-in-out infinite;
}

.brick-container::before {
    top: 20px;
    left: 30px;
    animation-delay: 0s;
}

.brick-container::after {
    bottom: 20px;
    right: 30px;
    animation-delay: 1s;
}

/* Particle Float Animation */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }
}

/* Brick Image */
.brick-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: brickFall 2.5s ease-in-out infinite, brickGlow 3s ease-in-out infinite;
    transform-origin: center bottom;
    filter: drop-shadow(0 0 20px rgba(224, 91, 38, 0.6));
}

/* Brick Glow Animation */
@keyframes brickGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(224, 91, 38, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(244, 122, 57, 0.8));
    }
}

/* Loading Text */
.loader-text {
    color: #1E1E1E;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    opacity: 0.9;
    animation: textPulse 2.5s ease-in-out infinite;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
    background: linear-gradient(135deg, #1E1E1E 0%, #E05B26 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Brick Fall Animation */
@keyframes brickFall {
    0% {
        transform: translateY(-200px) rotate(0deg);
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    60% {
        transform: translateY(0px) rotate(5deg);
        animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    70% {
        transform: translateY(-20px) rotate(-2deg);
        animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    80% {
        transform: translateY(0px) rotate(1deg);
        animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    90% {
        transform: translateY(-8px) rotate(-0.5deg);
        animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    95% {
        transform: translateY(0px) rotate(0deg);
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    100% {
        transform: translateY(-200px) rotate(0deg);
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}

/* Text Pulse Animation */
@keyframes textPulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .loader-overlay {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .brick-image {
        animation: none;
        transform: translateY(0px) rotate(0deg);
        filter: drop-shadow(0 0 10px rgba(224, 91, 38, 0.4));
    }
    
    .loader-text {
        animation: none;
        opacity: 0.9;
        transform: scale(1);
    }
    
    .brick-container::before,
    .brick-container::after {
        animation: none;
        opacity: 0.6;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .brick-container {
        width: 120px;
        height: 120px;
    }
    
    .brick-image {
        width: 90px;
        height: 90px;
    }
    
    .loader-text {
        font-size: 1rem;
        margin-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    .brick-container {
        width: 100px;
        height: 100px;
    }
    
    .brick-image {
        width: 75px;
        height: 75px;
    }
    
    .loader-text {
        font-size: 0.875rem;
        margin-top: 1rem;
    }
}

/* Hide scrollbar during loading */
body.loader-active {
    overflow: hidden;
}
