﻿/* ============================================================
   IKHAYALAMI PREMIUM LOADER
   Minimal, refined — property sector standard
   ============================================================ */

.loader-overlay {
    position: fixed;
    inset: 0;
    /* Pure white — matches the header exactly so the non-transparent
       logo PNG blends seamlessly, as it does in the navbar */
    background: #FFFFFF;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Two-stage exit: first fade, then vanish.
       Durations halved 2026-05 alongside loader.js MIN/MAX_DISPLAY cuts. */
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.05s, visibility 0s linear 0.4s;
    opacity: 1;
    visibility: visible;
    overflow: hidden;
}

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

/* ── Ambient gradient glow — kept at the bottom edge only so it never
   bleeds behind the logo's white background at centre screen. ── */
.loader-ambient {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 600px;
    height: 280px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient( ellipse at center, rgba(86, 196, 248, 0.06) 0%, rgba(245, 130, 32, 0.04) 55%, transparent 75% );
    pointer-events: none;
    animation: ambient-breathe 3.5s ease-in-out infinite;
}

@keyframes ambient-breathe {
    0%, 100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.08);
    }
}

/* ── Logo ──
   The JPG logo has a white background. The loader is also pure #FFFFFF,
   so the logo appears seamlessly transparent — identical to the header.
   We set background-color explicitly on the wrap as a hard guarantee
   against any browser compositing tint from ancestor elements. ── */
.loader-logo-wrap {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background-color: #FFFFFF; /* locks the logo box to pure white */
    /* Entrance: gentle rise from slightly below (halved 2026-05) */
    animation: logo-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes logo-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loader-logo-img {
    width: 160px;
    height: auto;
    display: block;
    /* No filter, no mix-blend — the white page IS the logo background */
}

@media (max-width: 480px) {
    .loader-logo-img {
        width: 120px;
    }
}

/* ── Wordmark / tagline beneath the logo ── */
.loader-wordmark {
    margin-top: 14px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #1A1D20;
    opacity: 0;
    animation: fade-in 0.3s ease both 0.3s;
}

@keyframes fade-in {
    to {
        opacity: 0.45;
    }
}

/* ── Progress track ── */
.loader-track {
    position: absolute;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    overflow: visible;
    opacity: 0;
    animation: fade-in-full 0.25s ease both 0.45s;
}

@keyframes fade-in-full {
    to {
        opacity: 1;
    }
}

/* The animated fill — orange → blue gradient */
.loader-track-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: linear-gradient(90deg, #F58220 0%, #56C4F8 100%);
    animation: track-fill 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.5s;
    position: relative;
}

    /* Trailing glow on the fill tip */
    .loader-track-fill::after {
        content: '';
        position: absolute;
        right: -6px;
        top: 50%;
        transform: translateY(-50%);
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #F58220;
        filter: blur(5px);
        opacity: 0.7;
    }

@keyframes track-fill {
    0% {
        width: 0%;
    }

    15% {
        width: 12%;
    }

    40% {
        width: 40%;
    }

    65% {
        width: 68%;
    }

    85% {
        width: 88%;
    }

    100% {
        width: 100%;
    }
}

/* ── Status label under the track ── */
.loader-status {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6C757D;
    opacity: 0;
    white-space: nowrap;
    animation: fade-in-full 0.25s ease both 0.55s;
}

/* ── Decorative orange + blue accent lines (one of each, very thin) ── */
.loader-accent-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    pointer-events: none;
}

    .loader-accent-line.top {
        top: 0;
        background: linear-gradient(90deg, transparent 0%, #F58220 30%, #56C4F8 70%, transparent 100% );
        opacity: 0;
        animation: accent-slide-in 0.35s ease both 0.15s;
    }

    .loader-accent-line.bottom {
        bottom: 0;
        background: linear-gradient(90deg, transparent 0%, #56C4F8 30%, #F58220 70%, transparent 100% );
        opacity: 0;
        animation: accent-slide-in 0.35s ease both 0.25s;
    }

@keyframes accent-slide-in {
    from {
        opacity: 0;
        transform: scaleX(0.4);
    }

    to {
        opacity: 0.35;
        transform: scaleX(1);
    }
}

/* Fade these out early so they don't compete on exit */
.loader-overlay.loader-hidden .loader-accent-line {
    opacity: 0;
    transition: opacity 0.3s ease;
}
