/* Hide navbar during loading */
body:has(#loader) nav {
    display: none !important;
}

/* Loader Styles */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    backdrop-filter: blur(10px);
}

.loader-container.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.loader-logo {
    margin-bottom: 3rem;
    animation: logoFloat 2s ease-in-out infinite;
}

.house-icon {
    position: relative;
    width: 80px;
    height: 60px;
    margin: 0 auto 2rem;
}


.loader-logo-image {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: logoImageSlideIn 1.2s ease-out 1.2s both;
}

.company-logo {
    max-width: 650px;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
  
    transition: transform 0.3s ease;
}

.company-logo:hover {
    transform: scale(1.05);
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(52, 73, 94, 0.2);
    border-radius: 2px;
    margin: 2rem auto 1rem;
    overflow: hidden;
    animation: progressBarAppear 0.5s ease-out 2s both;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2c3e50, #34495e, #2c3e50);
    background-size: 200% 100%;
    border-radius: 2px;
    width: 0%;
    animation: progressFill 3s ease-out 2.2s both, shimmer 1.5s ease-in-out infinite 2.2s;
}

.loading-text {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 400;
    letter-spacing: 1px;
    animation: loadingPulse 1.5s ease-in-out infinite 2s;
}

/* Bottom Progress Bar */
.bottom-progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 10000;
}

.bottom-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2c3e50, #3498db, #2c3e50);
    background-size: 200% 100%;
    width: 0%;
    animation: bottomProgressFill 4s ease-out 1s both, bottomShimmer 2s ease-in-out infinite 1s;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes roofBuild {
    from {
        border-bottom-width: 0px;
        opacity: 0;
    }
    to {
        border-bottom-width: 30px;
        opacity: 1;
    }
}

@keyframes chimneyBuild {
    from {
        height: 0px;
        opacity: 0;
    }
    to {
        height: 15px;
        opacity: 1;
    }
}

@keyframes logoImageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes progressBarAppear {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes bottomProgressFill {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

@keyframes bottomShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loader-content {
        padding: 0 2rem;
    }
    
    .house-icon {
        width: 60px;
        height: 45px;
    }
    
    .roof {
        border-left-width: 30px;
        border-right-width: 30px;
        border-bottom-width: 22px;
    }
    
    .chimney {
        width: 6px;
        height: 12px;
        right: 12px;
    }
    
    .company-logo {
        max-width: 480px;
        max-height: 260px;
    }
    
    .progress-bar {
        width: 250px;
    }
    
    .loading-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .house-icon {
        width: 50px;
        height: 38px;
    }
    
    .roof {
        border-left-width: 25px;
        border-right-width: 25px;
        border-bottom-width: 18px;
    }
    
    .chimney {
        width: 5px;
        height: 10px;
        right: 10px;
    }
    
    .company-logo {
        max-width: 480px;
        max-height: 260px;
    }
    
    .progress-bar {
        width: 200px;
        height: 3px;
    }
    
    .loading-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 320px) {
    .company-logo {
        max-width: 180px;
        max-height: 100px;
    }
    
    .progress-bar {
        width: 180px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .house-icon {
        transform: translateZ(0);
    }
    
    .roof, .chimney {
        transform: translateZ(0);
    }
}

/* Ensure hero elements are visible by default */
.brand-logo-image,
.hero-text-block h4 {
    opacity: 1;
    visibility: visible;
}

/* Only hide them when JavaScript is enabled */
.js-enabled .brand-logo-image,
.js-enabled .hero-text-block h4 {
    opacity: 0;
}