* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    height: 100vh;
}

/* ====== لودر ====== */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0a0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* حالت مخفی شدن لودر */
#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2.5rem 3rem;
    border-radius: 48px;
    background: rgba(20, 18, 28, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    min-width: 300px;
}

/* ====== ذرات دکوراتیو ====== */
.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #f0dfd0, #c49b7c);
    opacity: 0;
    filter: blur(2px);
    pointer-events: none;
}

.p1 {
    width: 10px;
    height: 10px;
    top: 8%;
    left: 6%;
    animation: floatParticle 4.5s ease-in-out infinite 0s;
}

.p2 {
    width: 7px;
    height: 7px;
    bottom: 10%;
    right: 5%;
    animation: floatParticle 5s ease-in-out infinite 1.3s;
}

.p3 {
    width: 14px;
    height: 14px;
    top: 20%;
    right: 3%;
    animation: floatParticle 4.8s ease-in-out infinite 2.6s;
    opacity: 0.15;
}

.p4 {
    width: 8px;
    height: 8px;
    bottom: 25%;
    left: 4%;
    animation: floatParticle 5.2s ease-in-out infinite 0.8s;
}

@keyframes floatParticle {
    0% {
        transform: translate(0, 0) scale(0.3);
        opacity: 0;
    }
    25% {
        opacity: 0.6;
    }
    75% {
        opacity: 0.4;
    }
    100% {
        transform: translate(25px, -35px) scale(1.3);
        opacity: 0;
    }
}

/* ====== اسپینر (حلقه‌های چرخان) ====== */
.spinner {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
    will-change: transform;
}

.ring1 {
    width: 100%;
    height: 100%;
    border-top-color: #c49b7c;
    border-bottom-color: #c49b7c;
    animation: spin 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    filter: drop-shadow(0 0 15px rgba(196, 155, 124, 0.3));
}

.ring2 {
    width: 76%;
    height: 76%;
    border-right-color: #d9b8a0;
    border-left-color: #d9b8a0;
    animation: spin 2.3s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
    filter: drop-shadow(0 0 18px rgba(217, 184, 160, 0.25));
}

.ring3 {
    width: 48%;
    height: 48%;
    border-top-color: #f0dfd0;
    border-bottom-color: #f0dfd0;
    animation: spin 2.9s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    filter: drop-shadow(0 0 22px rgba(240, 223, 208, 0.2));
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* نقطه مرکزی */
.center-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 30% 30%, #f0dfd0, #c49b7c);
    border-radius: 50%;
    box-shadow: 0 0 35px rgba(196, 155, 124, 0.5), 0 0 70px rgba(196, 155, 124, 0.2);
    animation: pulseDot 2.2s ease-in-out infinite;
    z-index: 2;
}

@keyframes pulseDot {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.85;
    }
    50% {
        transform: scale(1.35);
        opacity: 1;
        box-shadow: 0 0 50px rgba(196, 155, 124, 0.7), 0 0 90px rgba(196, 155, 124, 0.3);
    }
}

/* ====== برند (نام سایت) ====== */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.site-name {
    font-size: 2.4rem;
    font-weight: 300;
    letter-spacing: 8px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #f0dfd0 0%, #c49b7c 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(196, 155, 124, 0.15);
    animation: floatText 3s ease-in-out infinite;
}

.loading-text {
    font-size: 0.75rem;
    letter-spacing: 10px;
    font-weight: 300;
    background: linear-gradient(90deg, transparent, #c49b7c, transparent);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 3.5s linear infinite;
    margin-top: -0.2rem;
}

@keyframes floatText {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes shimmerText {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ====== نوار پیشرفت ====== */
.progress-wrapper {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c49b7c, #f0dfd0, #c49b7c);
    background-size: 200% 100%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(196, 155, 124, 0.4);
    transition: width 0.15s ease-out;
    animation: shimmerBar 2s linear infinite;
}

@keyframes shimmerBar {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ====== درصد ====== */
.percentage {
    color: rgba(240, 223, 208, 0.4);
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    margin-top: -0.5rem;
}

/* ====== ریسپانسیو ====== */
@media (max-width: 520px) {
    .loader-container {
        min-width: unset;
        width: 90%;
        padding: 2rem 1.5rem;
        border-radius: 32px;
        gap: 1.5rem;
    }

    .spinner {
        width: 100px;
        height: 100px;
    }

    .site-name {
        font-size: 1.8rem;
        letter-spacing: 5px;
    }

    .loading-text {
        font-size: 0.65rem;
        letter-spacing: 7px;
    }

    .progress-wrapper {
        width: 160px;
    }

    .ring {
        border-width: 2.5px;
    }

    .center-dot {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 380px) {
    .loader-container {
        padding: 1.5rem 1rem;
        gap: 1.2rem;
    }

    .spinner {
        width: 80px;
        height: 80px;
    }

    .site-name {
        font-size: 1.4rem;
        letter-spacing: 3px;
    }

    .progress-wrapper {
        width: 130px;
    }
}
