/* ============================================
   loading.css
   صفحه لودینگ · شرکت اطلس
   طراحی لوکس با میله‌های عمودی متحرک
   ============================================ */

/* ----- فونت وزیر (محلی) ----- */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ----- ریست و پایه ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    font-family: 'Vazir', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
}

/* ----- صفحه لودینگ ----- */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#loading-screen.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ----- پس‌زمینه با افکت گرادینت محو لوکس ----- */
.loading-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 25%, rgba(255, 255, 255, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 255, 255, 0.015) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(255, 255, 255, 0.01) 0%, transparent 40%);
    pointer-events: none;
}

/* ============================================
   کانتینر اصلی - مرکز صفحه
   ============================================ */
.loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5rem;
    width: 100%;
    max-width: 600px;
    padding: 0 2rem;
    z-index: 1;
    margin-top: -5vh;
}

/* ============================================
   لوگو
   ============================================ */
.loader-logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    animation: logoFadeIn 1.2s ease-out forwards;
    opacity: 0;
}

.loader-logo {
    text-align: center;
    position: relative;
}

.logo-main {
    display: block;
    font-size: 5.5rem;
    font-weight: 700;
    color: #f5f5f5;
    letter-spacing: 14px;
    line-height: 1.1;
    font-family: 'Vazir', sans-serif;
    position: relative;
}

/* خط زیر لوگو */
.logo-main::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.logo-sub {
    display: block;
    font-size: 1rem;
    font-weight: 300;
    color: #a5a5a5;
    letter-spacing: 5px;
    margin-top: 0.8rem;
    font-family: 'Vazir', sans-serif;
    animation: logoSubFade 1.2s ease-out 0.3s forwards;
    opacity: 0;
}

@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoSubFade {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   میله‌های بارگذاری عمودی متحرک (لوکس)
   ============================================ */
.loader-bars-wrapper {
    width: 100%;
    max-width: 320px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: barsFadeIn 0.8s ease-out 0.5s forwards;
    opacity: 0;
}

@keyframes barsFadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.loader-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    width: 100%;
    height: 100%;
}

.bar {
    width: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px 4px 2px 2px;
    height: 20%;
    transition: all 0.3s ease;
    position: relative;
    transform-origin: bottom;
}

/* هر میله با ارتفاع و تاخیر متفاوت */
.bar-1 { height: 25%; animation: barAnimation 1.4s ease-in-out infinite 0s; }
.bar-2 { height: 55%; animation: barAnimation 1.4s ease-in-out infinite 0.1s; }
.bar-3 { height: 80%; animation: barAnimation 1.4s ease-in-out infinite 0.2s; }
.bar-4 { height: 95%; animation: barAnimation 1.4s ease-in-out infinite 0.3s; }
.bar-5 { height: 65%; animation: barAnimation 1.4s ease-in-out infinite 0.4s; }
.bar-6 { height: 35%; animation: barAnimation 1.4s ease-in-out infinite 0.5s; }
.bar-7 { height: 85%; animation: barAnimation 1.4s ease-in-out infinite 0.6s; }
.bar-8 { height: 50%; animation: barAnimation 1.4s ease-in-out infinite 0.7s; }
.bar-9 { height: 70%; animation: barAnimation 1.4s ease-in-out infinite 0.8s; }
.bar-10 { height: 30%; animation: barAnimation 1.4s ease-in-out infinite 0.9s; }
.bar-11 { height: 60%; animation: barAnimation 1.4s ease-in-out infinite 1.0s; }
.bar-12 { height: 45%; animation: barAnimation 1.4s ease-in-out infinite 1.1s; }

/* انیمیشن اصلی میله‌ها - بالا و پایین رفتن با افکت لوکس */
@keyframes barAnimation {
    0% {
        height: 20%;
        background: rgba(255, 255, 255, 0.06);
        transform: scaleY(0.8);
        opacity: 0.6;
    }
    25% {
        height: 70%;
        background: rgba(255, 255, 255, 0.15);
        transform: scaleY(1.05);
        opacity: 0.9;
    }
    50% {
        height: 100%;
        background: rgba(255, 255, 255, 0.25);
        transform: scaleY(1.1);
        opacity: 1;
    }
    75% {
        height: 50%;
        background: rgba(255, 255, 255, 0.12);
        transform: scaleY(0.95);
        opacity: 0.7;
    }
    100% {
        height: 20%;
        background: rgba(255, 255, 255, 0.06);
        transform: scaleY(0.8);
        opacity: 0.6;
    }
}

/* افکت درخشش روی میله‌ها */
.bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 4px 4px 0 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bar:hover::before {
    opacity: 1;
}

/* ============================================
   فوتر - کاملاً در پایین صفحه
   ============================================ */
.loader-footer {
    position: fixed;
    bottom: 40px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 2rem;
    animation: footerFadeIn 1.4s ease-out 0.8s forwards;
    opacity: 0;
    z-index: 2;
}

@keyframes footerFadeIn {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* خط جداکننده نازک */
.footer-line {
    display: block;
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    margin-bottom: 4px;
}

.footer-text {
    font-size: 0.8rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 4px;
    font-family: 'Vazir', sans-serif;
    transition: color 0.3s ease;
}

.footer-text:hover {
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   حالت تکمیل - محو شدن میله‌ها
   ============================================ */
.loader-bars-wrapper.complete .bar {
    animation: barComplete 0.7s ease forwards;
}

@keyframes barComplete {
    0% {
        opacity: 1;
        transform: scaleY(1);
        height: 100%;
    }
    50% {
        opacity: 0.5;
        transform: scaleY(0.5);
        height: 50%;
    }
    100% {
        opacity: 0;
        transform: scaleY(0);
        height: 0%;
    }
}

/* ============================================
   ریسپانسیو - لپ‌تاپ
   ============================================ */
@media (max-width: 1200px) {
    .loader-container {
        gap: 4.5rem;
    }

    .logo-main {
        font-size: 5rem;
        letter-spacing: 12px;
    }

    .loader-bars-wrapper {
        max-width: 280px;
        height: 60px;
    }

    .bar {
        width: 5px;
    }
}

/* ============================================
   ریسپانسیو - تبلت
   ============================================ */
@media (max-width: 992px) {
    .loader-container {
        gap: 4rem;
        margin-top: -3vh;
    }

    .logo-main {
        font-size: 4.2rem;
        letter-spacing: 10px;
    }

    .logo-sub {
        font-size: 0.9rem;
        letter-spacing: 4px;
    }

    .logo-main::after {
        width: 50px;
    }

    .loader-bars-wrapper {
        max-width: 250px;
        height: 55px;
    }

    .bar {
        width: 5px;
        gap: 4px;
    }

    .loader-footer {
        bottom: 35px;
    }

    .footer-text {
        font-size: 0.75rem;
        letter-spacing: 3px;
    }

    .footer-line {
        width: 35px;
    }
}

/* ============================================
   ریسپانسیو - موبایل
   ============================================ */
@media (max-width: 768px) {
    .loader-container {
        gap: 3.5rem;
        padding: 0 1.5rem;
        margin-top: -2vh;
    }

    .logo-main {
        font-size: 3.5rem;
        letter-spacing: 8px;
    }

    .logo-sub {
        font-size: 0.8rem;
        letter-spacing: 3px;
        margin-top: 0.6rem;
    }

    .logo-main::after {
        width: 40px;
        height: 1.5px;
        bottom: -6px;
    }

    .loader-bars-wrapper {
        max-width: 220px;
        height: 48px;
    }

    .loader-bars {
        gap: 4px;
    }

    .bar {
        width: 4px;
        border-radius: 3px 3px 2px 2px;
    }

    .loader-footer {
        bottom: 30px;
        gap: 10px;
        padding: 0 1.5rem;
    }

    .footer-text {
        font-size: 0.7rem;
        letter-spacing: 3px;
    }

    .footer-line {
        width: 30px;
        height: 1px;
    }
}

/* ============================================
   ریسپانسیو - موبایل کوچک
   ============================================ */
@media (max-width: 480px) {
    .loader-container {
        gap: 3rem;
        padding: 0 1rem;
        margin-top: -1vh;
    }

    .logo-main {
        font-size: 2.8rem;
        letter-spacing: 6px;
    }

    .logo-sub {
        font-size: 0.7rem;
        letter-spacing: 2px;
        margin-top: 0.5rem;
    }

    .logo-main::after {
        width: 30px;
        height: 1px;
        bottom: -5px;
    }

    .loader-bars-wrapper {
        max-width: 180px;
        height: 40px;
    }

    .loader-bars {
        gap: 3px;
    }

    .bar {
        width: 3.5px;
        border-radius: 2px;
    }

    .loader-footer {
        bottom: 25px;
        gap: 8px;
        padding: 0 1rem;
    }

    .footer-text {
        font-size: 0.6rem;
        letter-spacing: 2px;
    }

    .footer-line {
        width: 25px;
        height: 1px;
    }
}

/* ============================================
   ریسپانسیو - موبایل بسیار کوچک
   ============================================ */
@media (max-width: 360px) {
    .loader-container {
        gap: 2.5rem;
        margin-top: 0;
    }

    .logo-main {
        font-size: 2.2rem;
        letter-spacing: 4px;
    }

    .logo-sub {
        font-size: 0.6rem;
        letter-spacing: 2px;
    }

    .loader-bars-wrapper {
        max-width: 150px;
        height: 35px;
    }

    .loader-bars {
        gap: 2.5px;
    }

    .bar {
        width: 3px;
    }

    .loader-footer {
        bottom: 20px;
    }

    .footer-text {
        font-size: 0.5rem;
        letter-spacing: 2px;
    }

    .footer-line {
        width: 20px;
    }
}