﻿
/* =========================================
   YADAMO - PLANETARY ORBIT LOADER
   Night Sky Edition
   ========================================= */

:root {
    --loader-font: "Vazirmatn", "Vazir", Tahoma, sans-serif;
}

:root {
    --loader-bg: #030711;
    --loader-primary: #22c7bc;
    --loader-secondary: #65eee0;
    --loader-blue: #438cf5;
    --loader-text: #f2fbff;
    --loader-muted: #8b9daf;
}


/* Force application font on loader */

.yadamo-loader,
.yadamo-loader *,
.yadamo-loader *::before,
.yadamo-loader *::after {
    font-family: var(--loader-font) !important;
}

.loader-title {
    font-family: var(--loader-font) !important;
    font-weight: 700;
}

.loader-subtitle,
.loader-status,
.loader-quote,
.loader-footer {
    font-family: var(--loader-font) !important;
}


/* Main Loader */

.yadamo-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
            radial-gradient(ellipse at 50% 42%,
            #0b1929 0%,
            #070f1e 38%,
            #030711 78%,
            #01040b 100%);
    color: var(--loader-text);
    font-family: inherit;
    opacity: 1;
    visibility: visible;
    transition: opacity .85s ease, visibility .85s ease;
    isolation: isolate;
}

.yadamo-loader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* =========================================
   NIGHT SKY BACKGROUND
   ========================================= */

.space-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    background:
            radial-gradient(ellipse at 20% 20%,
            rgba(25, 51, 85, .13),
            transparent 42%),
            radial-gradient(ellipse at 80% 75%,
            rgba(12, 69, 78, .10),
            transparent 45%);
}

.space-glow {
    position: absolute;
    width: 650px;
    height: 650px;
    left: 50%;
    top: 43%;
    transform: translate(-50%, -50%);
    background: radial-gradient(
            circle,
            rgba(24, 189, 180, .075) 0%,
            rgba(24, 189, 180, .025) 38%,
            transparent 72%
    );
    animation: glow-pulse 6s ease-in-out infinite;
}

/* Three layers of stars */

.space-stars {
    position: absolute;
    inset: -20%;
    pointer-events: none;
    background-repeat: repeat;
    will-change: opacity, background-position;
}

.stars-one {
    opacity: .75;
    background-image:
            radial-gradient(1px 1px at 20px 30px, #ffffff 99%, transparent),
            radial-gradient(1px 1px at 90px 110px, #c8fff9 99%, transparent),
            radial-gradient(1.5px 1.5px at 160px 70px, #ffffff 99%, transparent),
            radial-gradient(1px 1px at 230px 180px, #e3ffff 99%, transparent),
            radial-gradient(1.5px 1.5px at 300px 40px, #b4fff7 99%, transparent),
            radial-gradient(1px 1px at 70px 210px, #ffffff 99%, transparent);
    background-size: 340px 240px;
    animation:
            stars-drift 130s linear infinite,
            stars-twinkle 4s ease-in-out infinite alternate;
}

.stars-two {
    opacity: .55;
    background-image:
            radial-gradient(2px 2px at 50px 60px, #dfffff 99%, transparent),
            radial-gradient(1px 1px at 130px 190px, #55e6d5 99%, transparent),
            radial-gradient(1.5px 1.5px at 250px 90px, #ffffff 99%, transparent),
            radial-gradient(1px 1px at 320px 220px, #c5ffff 99%, transparent);
    background-size: 390px 290px;
    animation:
            stars-drift 180s linear infinite reverse,
            stars-twinkle 5.5s ease-in-out infinite alternate-reverse;
}

.stars-three {
    opacity: .35;
    background-image:
            radial-gradient(2px 2px at 100px 100px, #ffffff 99%, transparent),
            radial-gradient(1.5px 1.5px at 280px 200px, #a7fff7 99%, transparent),
            radial-gradient(1px 1px at 190px 40px, #ffffff 99%, transparent);
    background-size: 310px 270px;
    animation:
            stars-drift 220s linear infinite,
            stars-twinkle 7s ease-in-out infinite alternate;
}

/* Soft distant nebula */

.space-background::before,
.space-background::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.space-background::before {
    top: -230px;
    left: -120px;
    background: rgba(41, 86, 139, .08);
}

.space-background::after {
    bottom: -250px;
    right: -120px;
    background: rgba(25, 144, 133, .07);
}

/* =========================================
   CONTENT
   ========================================= */

.loader-content {
    gap: 0;
    position: relative;
    z-index: 2;
    width: min(100% - 32px, 480px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: content-enter 1s ease both;
}

/* =========================================
   PLANETARY SYSTEM
   ========================================= */

.planetary-system {
    position: relative;
    width: 290px;
    height: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

/* Center Planet */

.planet-center {
    position: relative;
    width: 116px;
    height: 116px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.planet-glow {
    position: absolute;
    inset: -28px;
    border-radius: 50%;
    background: radial-gradient(
            circle,
            rgba(32, 201, 189, .25),
            rgba(32, 201, 189, .07) 48%,
            transparent 72%
    );
    animation: planet-glow 4s ease-in-out infinite;
}

.planet-logo {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(
            circle at 35% 30%,
            #173441,
            #0b202d 55%,
            #06111d
    );
    border: 1px solid rgba(85, 230, 213, .32);
    box-shadow:
            0 0 25px rgba(34, 199, 188, .18),
            0 0 65px rgba(34, 199, 188, .08),
            inset 0 0 25px rgba(34, 199, 188, .12);
    animation: planet-float 4s ease-in-out infinite;
}

.planet-logo img {
    width: 72%;
    height: 72%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(85, 230, 213, .25));
}

/* Orbits */

.orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    border: 1px solid rgba(102, 212, 211, .17);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center;
}

.orbit-one {
    width: 170px;
    height: 170px;
    animation: orbit-rotate 12s linear infinite;
}

.orbit-two {
    width: 225px;
    height: 225px;
    transform: translate(-50%, -50%) rotateX(64deg);
    animation: orbit-rotate 17s linear infinite reverse;
    border-color: rgba(67, 140, 245, .24);
}

.orbit-three {
    width: 278px;
    height: 278px;
    transform: translate(-50%, -50%) rotateX(66deg) rotateY(-12deg);
    animation: orbit-rotate 24s linear infinite;
    border-color: rgba(85, 230, 213, .11);
}

/* Orbit Planets */

.orbit-planet {
    position: absolute;
    top: 50%;
    left: 0;
    display: block;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.planet-one {
    width: 10px;
    height: 10px;
    background: #55e6d5;
    box-shadow:
            0 0 8px #55e6d5,
            0 0 20px rgba(85, 230, 213, .8);
}

.planet-two {
    width: 13px;
    height: 13px;
    background: #65a8ff;
    box-shadow:
            0 0 10px #438cf5,
            0 0 22px rgba(67, 140, 245, .7);
}

.planet-three {
    width: 7px;
    height: 7px;
    background: #b1fff6;
    box-shadow:
            0 0 8px #55e6d5,
            0 0 18px rgba(85, 230, 213, .8);
}

/* Floating Stars */

.floating-star {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c5fff9;
    box-shadow: 0 0 10px #55e6d5;
    animation: floating-twinkle 3s ease-in-out infinite;
}

.star-a {
    top: 14%;
    right: 25%;
}

.star-b {
    bottom: 18%;
    right: 18%;
    animation-delay: .8s;
}

.star-c {
    top: 30%;
    left: 8%;
    animation-delay: 1.5s;
}

.star-d {
    bottom: 10%;
    left: 32%;
    animation-delay: .5s;
}

/* =========================================
   BRAND
   ========================================= */

.loader-brand {
    margin-top: 4px;
}

.loader-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 8px;
    padding-left: 8px;
    background: linear-gradient(
            100deg,
            #eafffc,
            #55e6d5,
            #d4fffa
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.loader-subtitle {
    margin-top: 7px;
    font-size: 13px;
    font-weight: 400;
    color: var(--loader-muted);
}

/* =========================================
   STATUS
   ========================================= */

.loader-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 32px;
    min-height: 24px;
    font-size: 12px;
    color: #a8c5ce;
}

.status-dot {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--loader-primary);
    box-shadow: 0 0 10px var(--loader-primary);
    animation: status-pulse 1.5s ease-in-out infinite;
}

/* =========================================
   REDESIGNED PROGRESS BAR
   ========================================= */

.loader-progress {
    position: relative;
    width: min(280px, 78%);
    margin-top: 19px;
    padding: 5px;
    border: 1px solid rgba(85, 230, 213, .13);
    border-radius: 30px;
    background: rgba(255, 255, 255, .035);
    box-shadow:
            0 0 18px rgba(34, 199, 188, .04),
            inset 0 1px 3px rgba(0, 0, 0, .35);
}

.loader-progress-track {
    position: relative;
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(1, 9, 19, .85);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5);
}

.loader-progress-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 48%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
            90deg,
            rgba(18, 130, 130, .1),
            #119f9b 18%,
            #22c7bc 55%,
            #a4fff6 85%,
            #22c7bc
    );
    box-shadow:
            0 0 7px rgba(34, 199, 188, .8),
            0 0 16px rgba(34, 199, 188, .45);
    animation: progress-flow 2s cubic-bezier(.45, 0, .55, 1) infinite;
}

.loader-progress-indicator::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 35%;
    height: 100%;
    border-radius: inherit;
    background: #eafffc;
    filter: blur(3px);
    opacity: .85;
}

/* Subtle light around progress */

.loader-progress::after {
    content: "";
    position: absolute;
    inset: -5px -10px;
    z-index: -1;
    border-radius: 30px;
    background: rgba(34, 199, 188, .12);
    filter: blur(13px);
    opacity: .65;
}

/* =========================================
   MOTIVATIONAL QUOTES
   ========================================= */

.loader-quote {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    width: 100%;
    margin-top: 24px;
    padding: 0 24px;
    color: #91a8b8;
    font-size: 12px;
    line-height: 2.2;
    transition: opacity .4s ease, transform .4s ease;
    flex-shrink: 0;
}

.loader-quote.quote-changing {
    opacity: 0;
    transform: translateY(6px);
}

.quote-mark {
    position: absolute;
    top: -12px;
    right: 6px;
    font-family: Georgia, serif;
    font-size: 36px;
    color: rgba(85, 230, 213, .35);
    line-height: 1;
}

/* =========================================
   FOOTER
   ========================================= */

.loader-footer {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 9px;
    letter-spacing: 2px;
    color: rgba(143, 172, 187, .4);
}

.footer-separator {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--loader-primary);
}

/* =========================================
   ERROR UI
   ========================================= */

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 20px 20px;
    z-index: 100001;
}

.error-card {
    max-width: 420px;
    margin: auto;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: #101c2d;
    color: #fff;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0, 0, 0, .5);
}

.error-icon {
    font-size: 30px;
}

.error-title {
    font-weight: 700;
    margin: 10px 0;
}

.error-message {
    color: #a9bacb;
    font-size: 13px;
    line-height: 2;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.btn-reload,
.btn-dismiss {
    border: 0;
    border-radius: 8px;
    padding: 9px 15px;
    font: inherit;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.btn-reload {
    background: #19aaa2;
    color: white;
}

.btn-dismiss {
    background: rgba(255, 255, 255, .1);
    color: white;
}

/* =========================================
   ANIMATIONS
   ========================================= */

@keyframes orbit-rotate {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 360deg;
    }
}

@keyframes planet-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes planet-glow {
    0%, 100% {
        opacity: .55;
        transform: scale(.92);
    }
    50% {
        opacity: 1;
        transform: scale(1.12);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: .55;
        transform: translate(-50%, -50%) scale(.95);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes stars-drift {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 100px 100px;
    }
}

@keyframes stars-twinkle {
    0% {
        opacity: .3;
        filter: brightness(.7);
    }
    50% {
        opacity: .85;
        filter: brightness(1.3);
    }
    100% {
        opacity: .45;
        filter: brightness(.9);
    }
}

@keyframes floating-twinkle {
    0%, 100% {
        opacity: .25;
        transform: scale(.7);
    }
    50% {
        opacity: 1;
        transform: scale(1.4);
    }
}

@keyframes status-pulse {
    0%, 100% {
        opacity: .5;
        transform: scale(.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes progress-flow {
    0% {
        transform: translateX(-115%);
    }
    100% {
        transform: translateX(220%);
    }
}

@keyframes content-enter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 480px) {

    .planetary-system {
        width: 255px;
        height: 255px;
    }

    .planet-center {
        width: 100px;
        height: 100px;
    }

    .orbit-one {
        width: 150px;
        height: 150px;
    }

    .orbit-two {
        width: 195px;
        height: 195px;
    }

    .orbit-three {
        width: 245px;
        height: 245px;
    }

    .loader-title {
        font-size: 26px;
    }

    .loader-status {
        margin-top: 24px;
    }

    .loader-quote {
        padding: 0 18px;
        font-size: 11px;
    }
}

/* =========================================
   ACCESSIBILITY
   ========================================= */

@media (prefers-reduced-motion: reduce) {

    .yadamo-loader *,
    .yadamo-loader *::before,
    .yadamo-loader *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }

    .yadamo-loader {
        transition-duration: .2s;
    }
}


/* Fix loader vertical spacing */

.loader-content {
    gap: 0;
}

.loader-brand {
    margin-top: 0;
}

.loader-status {
    margin-top: 24px;
}

.loader-progress {
    margin-top: 12px;
}

.loader-quote {
    margin-top: 18px;
}

/* Keep progress centered */
.loader-progress {
    position: relative;
    align-self: center;
    margin-inline: auto;
}
/* Motivational quote - highlighted */
.loader-quote {
    position: relative;
    width: min(420px, 88vw);
    min-height: 76px;
    margin: 28px auto 0;
    padding: 18px 24px 20px;
    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
            135deg,
            rgba(20, 184, 166, 0.13),
            rgba(45, 212, 191, 0.045)
    );

    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 16px;

    box-shadow:
            0 0 24px rgba(20, 184, 166, 0.09),
            inset 0 0 20px rgba(45, 212, 191, 0.035);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    overflow: hidden;
    text-align: center;
}

/* Quote mark */
.loader-quote::before {
    content: "“";
    position: absolute;
    top: -7px;
    right: 13px;

    color: #5eead4;
    font-family: Georgia, serif;
    font-size: 52px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.75;
}

/* Animated light line */
.loader-quote::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: -40%;
    width: 40%;
    height: 2px;

    background: linear-gradient(
            90deg,
            transparent,
            #5eead4,
            #99f6e4,
            transparent
    );

    box-shadow: 0 0 12px #2dd4bf;
    animation: quote-light 3s ease-in-out infinite;
}

#quoteText {
    position: relative;
    z-index: 1;

    color: #e6fffb;
    font-size: 15px;
    font-weight: 700;
    line-height: 2;
    text-shadow: 0 0 14px rgba(94, 234, 212, 0.22);

    transition: opacity 0.35s ease, transform 0.35s ease;
}

@keyframes quote-light {
    0% {
        left: -40%;
    }

    100% {
        left: 110%;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .loader-quote {
        width: 88vw;
        min-height: 72px;
        padding: 15px 18px;
        margin-top: 20px;
    }

    #quoteText {
        font-size: 13px;
    }
}