/* =========================================
   MEDICAL PRELOADER - PREMIUM FINAL
   با رنگ‌بندی طلایی و حرفه‌ای
   ========================================= */

/* ---------- کانتینر اصلی ---------- */
#medical-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /*background: linear-gradient(135deg, #0A1F3F 0%, #D8D5CA 100%)!important;*/
    /*background: linear-gradient(90deg, #cdffd8, #94b9ff)!important;*/
    /*background: linear-gradient(135deg, #0a1a2f, #d4af37)!important;*/
    /*background: linear-gradient(90deg, #cdffd8, #94b9ff)!important;*/
    /*background: linear-gradient(180deg, #d4af37, #ffffff)!important;*/
    /*background-color: #0a1a2f!important;*/
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    overflow: hidden;
}

/* ---------- لوگوی بزرگ ---------- */
.logo-loader {
    width: min(70vw, 600px) !important;
    height: min(70vw, 600px) !important;
    margin: 0 auto 2.5rem auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preloader-logo {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    object-position: center;

    /* سایه‌های حرفه‌ای */
    filter:
        drop-shadow(0 0 15px rgba(255, 199, 44, 0.4))
        drop-shadow(0 0 25px rgba(63, 127, 122, 0.3))
        contrast(1.1)
        brightness(1.05);
    position: relative;
    z-index: 5;
}

/* ---------- حلقه اصلی (Stroke) ---------- */
.logo-loader::before {
    content: '';
    position: absolute;
    width: 108%;
    height: 108%;
    border: 4px solid #FFC72C; /* زرد طلایی */
    border-radius: 50%;
    opacity: 0.8;
    box-shadow:
        0 0 25px rgba(255, 199, 44, 0.5),
        0 0 15px rgba(63, 127, 122, 0.4);
    z-index: 4;
}

/* ---------- حلقه دوم (سورمه‌ای) ---------- */
.logo-loader::after {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    border: 3px solid #3F7F7A; /* سورمه‌ای روشن */
    border-radius: 50%;
    opacity: 0.7;
    animation: rotateRing 12s linear infinite;
    z-index: 3;
}

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

/* ---------- هاله‌های پالسی ---------- */
.halo-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6); /* سفید شفاف */
    animation: haloPulse 2.5s ease-out infinite;
    z-index: 2;
}

.halo-1 {
    width: 115%;
    height: 115%;
    animation-delay: 0s;
}

.halo-2 {
    width: 130%;
    height: 130%;
    border-color: rgba(255, 226, 138, 0.7); /* زرد روشن */
    animation-delay: 0.3s;
}

.halo-3 {
    width: 145%;
    height: 145%;
    border-color: rgba(255, 255, 255, 0.4);
    animation-delay: 0.6s;
}

@keyframes haloPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ---------- پالس بارهای پررنگ ---------- */
.pulse-loader {
    display: flex;
    gap: 1rem !important;
    justify-content: center;
    align-items: flex-end;
    height: 80px;
    margin-top: 2rem;
}

.pulse-bar {
    width: 8px !important;
    height: 40px !important;
    border-radius: 4px !important;
    position: relative;
    overflow: hidden;
}

/* رنگ‌آمیزی پالس بارها */
.pulse-bar:nth-child(1) {
    background: linear-gradient(
        to top,
        transparent 0%,
        #FFC72C 30%,
        #FFC72C 70%,
        transparent 100%
    );
    box-shadow:
        0 0 15px rgba(255, 199, 44, 0.6),
        inset 0 0 5px rgba(255, 226, 138, 0.5);
}

.pulse-bar:nth-child(2) {
    background: linear-gradient(
        to top,
        transparent 0%,
        #3F7F7A 30%,
        #3F7F7A 70%,
        transparent 100%
    );
    box-shadow:
        0 0 15px rgba(63, 127, 122, 0.6),
        inset 0 0 5px rgba(127, 199, 194, 0.5);
}

.pulse-bar:nth-child(3) {
    background: linear-gradient(
        to top,
        transparent 0%,
        #FFC72C 30%,
        #FFC72C 70%,
        transparent 100%
    );
    box-shadow:
        0 0 15px rgba(255, 199, 44, 0.6),
        inset 0 0 5px rgba(255, 226, 138, 0.5);
}

/* افکت درخشان داخلی */
.pulse-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.7),
        transparent
    );
    animation: shine 1.5s linear infinite;
}

/* انیمیشن‌های پالس بار */
.pulse-bar:nth-child(1) {
    animation: pulseBar1 1.4s ease-in-out infinite;
}

.pulse-bar:nth-child(2) {
    animation: pulseBar2 1.4s ease-in-out infinite 0.2s;
}

.pulse-bar:nth-child(3) {
    animation: pulseBar3 1.4s ease-in-out infinite 0.4s;
}

@keyframes pulseBar1 {
    0%, 100% {
        transform: scaleY(1);
        height: 40px;
    }
    50% {
        transform: scaleY(1.8);
        height: 70px;
        box-shadow:
            0 0 25px rgba(255, 199, 44, 0.8),
            0 0 35px rgba(255, 226, 138, 0.6),
            inset 0 0 10px rgba(255, 255, 255, 0.8);
    }
}

@keyframes pulseBar2 {
    0%, 100% {
        transform: scaleY(1);
        height: 40px;
    }
    50% {
        transform: scaleY(2);
        height: 80px;
        box-shadow:
            0 0 25px rgba(63, 127, 122, 0.8),
            0 0 35px rgba(127, 199, 194, 0.6),
            inset 0 0 10px rgba(255, 255, 255, 0.8);
    }
}

@keyframes pulseBar3 {
    0%, 100% {
        transform: scaleY(1);
        height: 40px;
    }
    50% {
        transform: scaleY(1.8);
        height: 70px;
        box-shadow:
            0 0 25px rgba(255, 199, 44, 0.8),
            0 0 35px rgba(255, 226, 138, 0.6),
            inset 0 0 10px rgba(255, 255, 255, 0.8);
    }
}

@keyframes shine {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* ---------- انیمیشن خروج ---------- */
#medical-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 768px) {
    .logo-loader {
        width: min(85vw, 400px) !important;
        height: min(85vw, 400px) !important;
        margin: 0 auto 1.5rem auto !important;
    }

    .pulse-loader {
        gap: 0.7rem !important;
        height: 70px;
    }

    .pulse-bar {
        width: 6px !important;
        height: 35px !important;
    }
}

@media (max-width: 480px) {
    .logo-loader {
        width: min(90vw, 300px) !important;
        height: min(90vw, 300px) !important;
    }

    .pulse-loader {
        gap: 0.5rem !important;
        height: 60px;
    }

    .pulse-bar {
        width: 5px !important;
        height: 30px !important;
    }
}