/* ===================================
   DESCOM CONTRACTOR - Page Loader
   Beautiful Loading Animation
   =================================== */

/* Prevent Flash - Hide content until loader is done */
body {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

body.loaded {
    opacity: 1;
}

/* Loader Container */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #003d82 0%, #2c3e50 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Logo Container */
.loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: logoFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(115, 187, 255, 0.3));
}

/* Floating Animation */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulsing Glow Effect */
.loader-spinner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(115, 187, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    z-index: 5;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

/* Spinner Ring */
.loader-spinner {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #73bbff;
    border-right-color: #73bbff;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 85%;
    height: 85%;
    top: 7.5%;
    left: 7.5%;
    border-top-color: #4a90e2;
    border-right-color: #4a90e2;
    animation-duration: 2s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: #73bbff;
    border-right-color: #73bbff;
    animation-duration: 2.5s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Text */
.loader-text {
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 20px;
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        opacity: 0.8;
        text-shadow: 0 0 10px rgba(115, 187, 255, 0.5);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(115, 187, 255, 0.8);
    }
}

/* Progress Bar */
.loader-progress {
    width: 250px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #73bbff 0%, #4a90e2 50%, #73bbff 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressBar 2s ease-in-out infinite;
}

@keyframes progressBar {
    0% {
        width: 0%;
        background-position: 0% 50%;
    }
    50% {
        width: 70%;
        background-position: 100% 50%;
    }
    100% {
        width: 100%;
        background-position: 0% 50%;
    }
}

/* Loading Dots */
.loader-dots {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: #73bbff;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Alternative: Building Animation */
.building-loader {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 60px;
}

.building-bar {
    width: 12px;
    background: linear-gradient(180deg, #73bbff 0%, #4a90e2 100%);
    border-radius: 4px 4px 0 0;
    animation: buildingGrow 1.5s ease-in-out infinite;
}

.building-bar:nth-child(1) {
    animation-delay: 0s;
}

.building-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.building-bar:nth-child(3) {
    animation-delay: 0.4s;
}

.building-bar:nth-child(4) {
    animation-delay: 0.6s;
}

.building-bar:nth-child(5) {
    animation-delay: 0.8s;
}

@keyframes buildingGrow {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 60px;
    }
}

/* Responsive Design */
@media (max-width: 767px) {
    .loader-logo {
        width: 80px;
        height: 80px;
    }

    .loader-spinner {
        width: 160px;
        height: 160px;
    }

    .loader-spinner::before {
        width: 100px;
        height: 100px;
    }

    .loader-text {
        font-size: 1.2rem;
    }

    .loader-progress {
        width: 200px;
    }
}

@media (max-width: 575px) {
    .loader-logo {
        width: 70px;
        height: 70px;
    }

    .loader-spinner {
        width: 140px;
        height: 140px;
    }

    .loader-spinner::before {
        width: 85px;
        height: 85px;
    }

    .loader-text {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .loader-progress {
        width: 180px;
    }
}

/* Fade-in Animation for Content - DISABLED */
/* Removed to prevent page opening animation after loader */
.content-fade-in {
    /* animation: contentFadeIn 0.8s ease-out; */
}

/* @keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} */
