﻿/* ==========================================
   1. PWA SPLASH (صفحه شروع اپلیکیشن)
   ========================================== */
/* استایل لودینگ اختصاصی */
/* --- Splash Screen Styles --- */
#pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #15161D;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999999;
    transition: opacity 0.3s ease;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.splash-logo {
    width: 120px;
    height: auto;
    margin-bottom: 30px;
    animation: splash-pulse 1.5s infinite ease-in-out;
}

.splash-loader-bar {
    width: 150px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.splash-loader-fill {
    width: 40%;
    height: 100%;
    background: #0092e6;
    animation: splash-progress 1.5s infinite ease-in-out;
}

@keyframes splash-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.8;
    }
}

@keyframes splash-progress {
    0% {
        transform: translateX(-150%);
    }

    100% {
        transform: translateX(250%);
    }
}


/* ==========================================
   2. MINI LOADER (لودر بین صفحات)
   ========================================== */
#mini-loader {
    position: fixed;
    inset: 0;
    z-index: 9999998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(21, 22, 29, 0.88);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    content-visibility: auto;
}

    #mini-loader.mini-loader-active {
        opacity: 1;
        visibility: visible;
        content-visibility: visible;
        /* ✅ این خط معجزه می‌کنه: جلوگیری از کلیک روی محتوای پشت لودر */
        pointer-events: all;
    }

/* کارت لودر (شیشه‌ای روشن) */

/* کارت لودر (شیشه‌ای با ته‌رنگ آبی) */
/* کارت لودر (شیشه‌ای آبی، کم‌رنگ و ملایم) */
/* کارت لودر (شیشه‌ای آبی، کم‌رنگ و ملایم) */
.loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px 40px;
    /* ✅ ته‌رنگ آبی روشن‌تر با شفافیت بالاتر (کم‌رنگ‌تر) */
    background: rgba(0, 164, 255, 0.08);
    /* ✅ حاشیه آبی روشن‌تر و کمی محوتر */
    border: 1px solid rgba(0, 164, 255, 0.3);
    border-radius: 20px;
    /* ✅ سایه ملایم آبی */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 164, 255, 0.1);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}


#mini-loader.mini-loader-active .loader-card {
    transform: translateY(0) scale(1);
}

/* ==========================================
   دایره SVG (شارپ، تک‌رنگ، بدون تاری)
   ========================================== */
.loader-circle-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* شروع از بالا */
}

/* مسیر خاکستری پس‌زمینه */
.svg-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 4;
}

/* ✅ مسیر آبی پر شونده (بدون طیف و تاری) */
.svg-progress {
    fill: none;
    stroke: #0092e6; /* آبی تک‌رنگ */
    stroke-width: 4;
    stroke-linecap: round; /* لبه‌های سر خط گرد و نرم */
    stroke-dasharray: 289; /* محیط دایره */
    stroke-dashoffset: 289; /* در ابتدا خالیه */
    transition: stroke-dashoffset 0.3s ease-out;
}

/* لوگو وسط دایره */

.loader-icon {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #15161D;
    border: 2px solid #005484;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
    animation: loader-pulse 2s infinite ease-in-out;
}

    .loader-icon img {
        width: 45px;
        height: 45px;
        border-radius: 40%;
        object-fit: contain;
    }

.dynamic-text {
    color: #E2E8F0;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    min-width: 160px;
    text-align: center;
}

@keyframes loader-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

@media screen and (display-mode: standalone) {
    html {
        background-color: #15161D;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loader-icon, .splash-logo, .splash-loader-fill {
        animation: none;
    }

    .svg-progress {
        transition: none;
    }
}
