@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
}

#main-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0f;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Animated Background */
.bg-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float-bg 8s ease-in-out infinite;
}

.bg-circle:nth-child(1) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15), transparent);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.bg-circle:nth-child(2) {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.1), transparent);
    bottom: -15%;
    right: -10%;
    animation-delay: 2s;
}

.bg-circle:nth-child(3) {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 140, 0, 0.12), transparent);
    top: 40%;
    right: 10%;
    animation-delay: 4s;
}

/* Main Loader Container */
.preloader-loader-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* Logo Container with Morph Effect */
.logo-container {
    position: relative;
    width: 180px;
    height: 180px;
}

.morph-shape {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 8s ease-in-out infinite, rotate-morph 20s linear infinite;
    filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.6));
}

.morph-shape::before {
    content: '';
    position: absolute;
    inset: 3px;
    background: #0a0a0f;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 8s ease-in-out infinite reverse;
}

.logo-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gold-icon {
    font-size: 70px;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

/* Orbiting Particles */
.orbit-container {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotate-orbit 15s linear infinite;
}

.main-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 20px #FFD700, 0 0 40px #FFA500;
}

.main-particle:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse-particle 2s ease-in-out infinite;
}

.main-particle:nth-child(2) {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    animation: pulse-particle 2s ease-in-out infinite 0.5s;
}

.main-particle:nth-child(3) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse-particle 2s ease-in-out infinite 1s;
}

.main-particle:nth-child(4) {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    animation: pulse-particle 2s ease-in-out infinite 1.5s;
}

/* Text Section */
.text-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.brand-name {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-flow 3s ease infinite;
    letter-spacing: 2px;
}

.loading-text {
    font-size: 14px;
    color: #888;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: fade-pulse 2s ease-in-out infinite;
}

/* Modern Progress Bar */
.progress-container {
    width: 280px;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.main-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 100%;
    border-radius: 10px;
    width: 0%;
    animation: load-progress 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.progress-glow {
    position: absolute;
    top: -10px;
    left: 0;
    width: 60px;
    height: 23px;
    background: radial-gradient(ellipse, rgba(255, 215, 0, 0.5), transparent);
    filter: blur(10px);
    animation: glow-move 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Percentage Counter */
.percentage {
    font-size: 48px;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    font-variant-numeric: tabular-nums;
}

/* Animations */
@keyframes morph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
    }
}

@keyframes rotate-morph {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse-particle {
    0%, 100% {
        transform: scale(1) translateX(-50%);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) translateX(-50%);
        opacity: 0.5;
    }
}

@keyframes shine {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.9));
    }
}

@keyframes gradient-flow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes fade-pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

@keyframes load-progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes glow-move {
    0% {
        left: 0%;
    }
    100% {
        left: calc(100% - 60px);
    }
}

@keyframes float-bg {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Content */
.main-preloader-content {
    display: none;
    padding: 50px;
    text-align: center;
    background: #0a0a0f;
    color: #FFD700;
    min-height: 100vh;
}

.main-preloader-content.show {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.main-preloader-content h1 {
    font-size: 56px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-preloader-content p {
    font-size: 20px;
    color: #888;
}