/**
 * 🎯 Generation Modal - Reusable modal for avatar generation
 * Used in: /search/simple and /search/manual_search
 */

/* Modal Overlay */
.generation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex !important;  /* Always flex for centering */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.generation-modal.is-open {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.8);
}

/* Modal Backdrop */
.generation-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Modal Content */
.generation-modal__content {
    position: relative;
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    z-index: 10001;
}

.generation-modal.is-open .generation-modal__content {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.generation-modal__header {
    margin-bottom: 24px;
}

.generation-modal__header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--ax-color-fg, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.generation-modal__header h3 i {
    width: 20px;
    height: 20px;
    color: var(--ax-color-primary, #3b82f6);
}

/* Modal Body */
.generation-modal__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Phase Display */
.phase-display {
    text-align: center;
    margin-bottom: 8px;
}

.phase-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ax-color-fg, #1a1a1a);
    margin: 0 0 8px 0;
}

.phase-description {
    font-size: 14px;
    color: var(--ax-color-muted, #666);
    margin: 0;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--ax-color-gray-100, #f1f5f9);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ax-color-primary, #3b82f6) 0%, var(--ax-color-primary-600, #2563eb) 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer animation for progress bar */
.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Stats Card */
.stats-card {
    display: flex;
    gap: 16px;
    padding: var(--ax-space-4);
    background: var(--ax-color-gray-50, #f8fafc);
    border-radius: 12px;
    border: 1px solid var(--ax-color-gray-200, #e2e8f0);
}

.stat-item {
    flex: 1;
    text-align: left;
}

.stat-item--right {
    text-align: right;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--ax-color-gray-500, #64748b);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--ax-color-gray-800, #1e293b);
}

.stat-value--highlight {
    color: var(--ax-color-primary, #3b82f6);
}

/* Status Steps */
.status-steps {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.status-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.status-step__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ax-color-gray-100, #f1f5f9);
    border: 2px solid var(--ax-color-gray-200, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ax-color-gray-400, #94a3b8);
    transition: all 0.3s ease;
}

.status-step__icon i {
    width: 20px;
    height: 20px;
}

.status-step__label {
    font-size: 12px;
    color: var(--ax-color-gray-400, #94a3b8);
    transition: color 0.3s ease;
    text-align: center;
}

/* Active Step */
.status-step.is-active .status-step__icon {
    background: var(--ax-color-primary, #3b82f6);
    border-color: var(--ax-color-primary, #3b82f6);
    color: white;
    animation: pulse 2s infinite;
}

.status-step.is-active .status-step__label {
    color: var(--ax-color-gray-800, #1e293b);
    font-weight: 500;
}

/* Completed Step */
.status-step.is-complete .status-step__icon {
    background: var(--ax-color-success, #10b981);
    border-color: var(--ax-color-success, #10b981);
    color: white;
}

.status-step.is-complete .status-step__label {
    color: var(--ax-color-success, #10b981);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

/* Error State */
.generation-modal__error {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: var(--ax-space-5);
}

.generation-modal__error h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ax-color-fg, #1a1a1a);
}

.generation-modal__error p {
    margin: 0;
    font-size: 14px;
    color: var(--ax-color-muted, #666);
    text-align: center;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .generation-modal__content {
        padding: var(--ax-space-6);
        max-width: 90%;
    }

    .status-steps {
        flex-direction: column;
        gap: 12px;
    }

    .status-step {
        flex-direction: row;
        justify-content: flex-start;
    }

    .status-step__label {
        text-align: left;
    }

    .stats-card {
        flex-direction: column;
        gap: 12px;
    }

    .stat-item--right {
        text-align: left;
    }
}
