/* ===================================
   Professional Loader CSS for Construction Website
   =================================== */

/* Loader Container */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #334155 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    overflow: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Animated Background Blueprint Pattern */
.loader-bg-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    overflow: hidden;
}

/* Animated Grid Lines */
.grid-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, #EAB308, transparent);
    animation: gridMove 3s linear infinite;
}

.grid-line.horizontal {
    width: 100%;
    height: 2px;
    left: 0;
}

.grid-line.vertical {
    height: 100%;
    width: 2px;
    top: 0;
}

.grid-line:nth-child(1) { top: 10%; animation-delay: 0s; }
.grid-line:nth-child(2) { top: 30%; animation-delay: 0.5s; }
.grid-line:nth-child(3) { top: 50%; animation-delay: 1s; }
.grid-line:nth-child(4) { top: 70%; animation-delay: 1.5s; }
.grid-line:nth-child(5) { top: 90%; animation-delay: 2s; }

.grid-line:nth-child(6) { left: 20%; animation-delay: 0.3s; }
.grid-line:nth-child(7) { left: 40%; animation-delay: 0.8s; }
.grid-line:nth-child(8) { left: 60%; animation-delay: 1.3s; }
.grid-line:nth-child(9) { left: 80%; animation-delay: 1.8s; }

@keyframes gridMove {
    0% { opacity: 0; transform: scaleX(0); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: scaleX(1); }
}

/* Blueprint Dots Pattern */
.blueprint-dots {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #64748B 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
    animation: dotsFloat 20s linear infinite;
}

@keyframes dotsFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

/* Building Illustration Animation */
.building-lines {
    position: absolute;
    width: 600px;
    height: 400px;
    opacity: 0.15;
}

.building-line {
    position: absolute;
    background: #EAB308;
    transform-origin: bottom;
    animation: buildingRise 2s ease-out forwards;
}

.building-line:nth-child(1) {
    width: 3px;
    height: 200px;
    left: 100px;
    bottom: 0;
    animation-delay: 0.2s;
}

.building-line:nth-child(2) {
    width: 3px;
    height: 250px;
    left: 200px;
    bottom: 0;
    animation-delay: 0.4s;
}

.building-line:nth-child(3) {
    width: 3px;
    height: 180px;
    left: 300px;
    bottom: 0;
    animation-delay: 0.6s;
}

.building-line:nth-child(4) {
    width: 3px;
    height: 220px;
    left: 400px;
    bottom: 0;
    animation-delay: 0.8s;
}

.building-line:nth-child(5) {
    width: 3px;
    height: 150px;
    left: 500px;
    bottom: 0;
    animation-delay: 1s;
}

/* Horizontal lines */
.building-line:nth-child(6) {
    height: 3px;
    width: 100px;
    left: 100px;
    bottom: 200px;
    animation-delay: 1.2s;
}

.building-line:nth-child(7) {
    height: 3px;
    width: 100px;
    left: 200px;
    bottom: 250px;
    animation-delay: 1.4s;
}

@keyframes buildingRise {
    0% { 
        transform: scaleY(0);
        opacity: 0;
    }
    100% { 
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Main Loader Content */
.loader-content {
    position: relative;
    z-index: 10;
    text-align: center;
    animation: contentFadeIn 1s ease-out;
}

@keyframes contentFadeIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Logo Container */
.loader-logo {
    width: 200px;
    height: 80px;
    margin: 0 auto 30px;
    position: relative;
}

/* Logo SVG Animation Container */
.logo-svg-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.logo-svg-container svg {
    width: 100%;
    height: 100%;
}

/* SVG Path Animation */
.logo-path {
    stroke: #EAB308;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLogo 2s ease-out forwards;
}

@keyframes drawLogo {
    to {
        stroke-dashoffset: 0;
        fill: #EAB308;
    }
}

/* Logo Image (if using PNG/JPG) */
.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    animation: logoReveal 1.5s ease-out 0.5s forwards;
}

@keyframes logoReveal {
    0% { 
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
        filter: blur(10px);
    }
    100% { 
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0);
    }
}

/* Company Name */
.loader-company-name {
    font-size: 2rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 3px;
    margin-bottom: 20px;
    opacity: 0;
    animation: nameReveal 1s ease-out 1.8s forwards;
    text-transform: uppercase;
    position: relative;
}

.loader-company-name::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #EAB308, transparent);
    animation: lineExpand 1s ease-out 2.3s forwards;
}

@keyframes nameReveal {
    0% { 
        opacity: 0;
        transform: translateY(30px);
        letter-spacing: 10px;
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 3px;
    }
}

@keyframes lineExpand {
    to { width: 200px; }
}

/* Tagline */
.loader-tagline {
    font-size: 0.9rem;
    color: #94A3B8;
    margin-top: 20px;
    opacity: 0;
    animation: taglineFade 1s ease-out 2.5s forwards;
    font-weight: 300;
    letter-spacing: 2px;
}

@keyframes taglineFade {
    0% { 
        opacity: 0;
        transform: translateY(20px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Bar */
.loader-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 30px auto 0;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #EAB308, #F59E0B, #EAB308);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressLoad 2.5s ease-out forwards, progressShine 1.5s linear infinite;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.5);
}

@keyframes progressLoad {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes progressShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading Text */
.loader-text {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #94A3B8;
    font-weight: 300;
    opacity: 0;
    animation: textPulse 1.5s ease-in-out 1s infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Percentage Counter */
.loader-percentage {
    font-size: 2.5rem;
    font-weight: 700;
    color: #EAB308;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    opacity: 0;
    animation: percentageFade 0.5s ease-out 0.5s forwards;
}

@keyframes percentageFade {
    to { opacity: 1; }
}

/* Architectural Compass Animation */
.compass-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    opacity: 0.08;
}

.compass-circle {
    position: absolute;
    border: 2px solid #EAB308;
    border-radius: 50%;
    animation: compassRotate 10s linear infinite;
}

.compass-circle:nth-child(1) {
    width: 100%;
    height: 100%;
    animation-delay: 0s;
}

.compass-circle:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    animation-delay: 0.5s;
    animation-direction: reverse;
}

.compass-circle:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    animation-delay: 1s;
}

@keyframes compassRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loader-company-name {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
    
    .loader-logo {
        width: 150px;
        height: 60px;
    }
    
    .loader-progress {
        width: 250px;
    }
    
    .loader-percentage {
        font-size: 2rem;
    }
    
    .building-lines {
        width: 300px;
        height: 200px;
        transform: scale(0.7);
    }
    
    .compass-animation {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .loader-company-name {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .loader-tagline {
        font-size: 0.75rem;
    }
    
    .loader-progress {
        width: 200px;
    }
}