.ai-loader {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.ai-loader.is-visible {
    display: flex !important;
}

.ai-loader__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 12, 22, 0.58);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ai-loader__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 16px 20px;
}

.ai-loader__boxes {
    position: relative;
    width: 220px;
    height: 190px;
}

.ai-loader__box {
    position: absolute;
    width: 108px;
    height: auto;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
    user-select: none;
    pointer-events: none;
}

.ai-loader__box--green {
    top: 0;
    left: 56px;
    z-index: 1;
    animation: ai-box-float 1.7s ease-in-out infinite;
}

.ai-loader__box--yellow {
    top: 52px;
    left: 0;
    z-index: 2;
    animation: ai-box-float 1.7s ease-in-out infinite 0.18s;
}

.ai-loader__box--blue {
    top: 58px;
    left: 102px;
    z-index: 3;
    animation: ai-box-float 1.7s ease-in-out infinite 0.36s;
}

.ai-loader__text {
    margin: 0;
    display: flex;
    align-items: baseline;
    font-family: Vazirmatn, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #a8b2bf;
    line-height: 1.3;
}

.ai-loader__dots {
    display: inline-flex;
    width: 1.2em;
    margin-left: 1px;
}

.ai-loader__dots span {
    opacity: 0.2;
    animation: ai-dot 1.2s ease-in-out infinite;
}

.ai-loader__dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-loader__dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ai-box-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-14px) rotate(2deg); }
}

@keyframes ai-dot {
    0%, 20% { opacity: 0.18; }
    45% { opacity: 1; }
    100% { opacity: 0.18; }
}

@media (max-width: 480px) {
    .ai-loader__boxes {
        width: 180px;
        height: 156px;
    }

    .ai-loader__box {
        width: 88px;
    }

    .ai-loader__box--green { left: 46px; }
    .ai-loader__box--blue { left: 84px; }

    .ai-loader__text {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-loader__box,
    .ai-loader__dots span {
        animation: none;
    }

    .ai-loader__dots span {
        opacity: 1;
    }
}
