/* ============================================================
   ai_loader.css — Reusable AI Step Loader Component
   Include this on any page that uses the AI loader modal.
   ============================================================ */

/* Overlay */
.ai-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 1) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

/* Card */
.ai-loader-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    padding: 60px;
    border-radius: 40px;
    max-width: 550px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 80px rgba(99, 102, 241, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* Icon */
.ai-loader-icon-container {
    font-size: 5rem;
    margin-bottom: 32px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 30px;
    animation: aiLoaderFloat 3s ease-in-out infinite;
}

.ai-loader-icon-glow {
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: aiLoaderPulse 2s ease-in-out infinite;
}

@keyframes aiLoaderFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

@keyframes aiLoaderPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.3; }
    50%      { transform: scale(1.2); opacity: 0.6; }
}

/* Title */
.ai-loader-title {
    font-size: 2.25rem;
    font-weight: 900;
    margin-bottom: 40px;
    color: white;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, #fff, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Steps List */
.ai-loader-steps {
    text-align: left;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-loader-step {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
    border-radius: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-loader-step.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: scale(1.02) translateX(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ai-loader-step.completed {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.ai-loader-step-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.5);
}

.ai-loader-step.active .ai-loader-step-icon {
    background: #6366f1;
    color: white;
    box-shadow: 0 0 15px #6366f1;
}

.ai-loader-step.completed .ai-loader-step-icon {
    background: #10b981;
    color: white;
}

.ai-loader-step-text {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

.ai-loader-step.active    .ai-loader-step-text { color: white; }
.ai-loader-step.completed .ai-loader-step-text { color: #10b981; }

/* Progress Bar */
.ai-loader-progress-wrap {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    overflow: hidden;
    padding: 3px;
}

.ai-loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #818cf8, #a855f7);
    background-size: 200% 100%;
    width: 0%;
    border-radius: 100px;
    transition: width 0.4s cubic-bezier(0.1, 0.7, 1.0, 0.1);
    animation: aiLoaderShimmer 2s linear infinite;
}

@keyframes aiLoaderShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Note */
.ai-loader-note {
    margin-top: 32px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    font-style: italic;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .ai-loader-overlay {
        align-items: flex-start;
        padding-top: 16px;
    }

    .ai-loader-card {
        padding: 28px 18px;
        width: 96%;
        border-radius: 20px;
        margin: 0 auto;
    }

    .ai-loader-icon-container {
        width: 72px;
        height: 72px;
        font-size: 2.5rem;
        margin-bottom: 16px;
        border-radius: 20px;
    }

    .ai-loader-title {
        font-size: 1.35rem;
        margin-bottom: 20px;
    }

    .ai-loader-steps {
        gap: 8px;
        margin-bottom: 20px;
    }

    .ai-loader-step {
        padding: 10px 14px;
        gap: 12px;
        border-radius: 12px;
    }

    .ai-loader-step.active {
        transform: scale(1.01) translateX(4px);
    }

    .ai-loader-step-text {
        font-size: 0.92rem;
    }

    .ai-loader-step-icon {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .ai-loader-note {
        margin-top: 20px;
        font-size: 0.8rem;
    }
}
