/* Phase 17.5 — AI Processing Center */
.ai-processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: aiOverlayIn 0.25s ease;
}

.ai-processing-overlay.is-visible {
    display: flex;
}

body.ai-processing-active {
    overflow: hidden;
}

@keyframes aiOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ai-processing-panel {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    padding: 28px 28px 24px;
    animation: aiPanelIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes aiPanelIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-processing-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-processing-title .ai-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #487fff;
    animation: aiPulse 1.2s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

.ai-processing-question {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
    border-left: 3px solid #487fff;
    padding-left: 12px;
}

.ai-processing-divider {
    border: none;
    border-top: 1px dashed #e2e8f0;
    margin: 16px 0;
}

.ai-step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-step-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.875rem;
    color: #94a3b8;
    transition: color 0.2s;
}

.ai-step-item.is-active {
    color: #1e293b;
    font-weight: 600;
}

.ai-step-item.is-done {
    color: #16a34a;
}

.ai-step-icon {
    width: 20px;
    flex-shrink: 0;
    text-align: center;
    line-height: 1.4;
}

.ai-step-item.is-active .ai-step-icon {
    animation: aiStepBlink 1s ease-in-out infinite;
}

@keyframes aiStepBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.ai-auto-flow {
    margin: 12px 0;
}

.ai-auto-step {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 0;
    font-size: 0.875rem;
    background: #f8fafc;
    transition: border-color 0.2s, background 0.2s;
}

.ai-auto-step.is-active {
    border-color: #487fff;
    background: #eff6ff;
}

.ai-auto-step.is-done {
    border-color: #86efac;
    background: #f0fdf4;
}

.ai-auto-step-label {
    font-weight: 600;
    margin-bottom: 4px;
}

.ai-auto-step-status {
    color: #64748b;
    font-size: 0.8125rem;
}

.ai-auto-arrow {
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
    padding: 4px 0;
}

.ai-batch-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 12px 0;
}

.ai-batch-block {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #e2e8f0;
    transition: background 0.2s;
}

.ai-batch-block.is-done {
    background: #487fff;
}

.ai-batch-block.is-active {
    background: #487fff;
    animation: aiBatchPulse 0.8s ease-in-out infinite;
}

@keyframes aiBatchPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.ai-batch-stats {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.7;
}

.ai-processing-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 16px;
    text-align: center;
}

.ai-processing-actions {
    margin-top: 12px;
    text-align: center;
}

/* Toast */
.ai-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10060;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.ai-toast {
    pointer-events: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 16px 18px;
    border-left: 4px solid #16a34a;
    animation: aiToastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    font-size: 0.875rem;
    width: 360px;
    max-width: calc(100vw - 48px);
    box-sizing: border-box;
}

.ai-toast.is-error {
    border-left-color: #dc2626;
}

@keyframes aiToastIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

.ai-toast-title {
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-toast-body {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0;
}

.ai-toast-body dt {
    float: left;
    clear: left;
    width: 72px;
    color: #94a3b8;
    font-weight: 500;
}

.ai-toast-body dd {
    margin-left: 80px;
    margin-bottom: 2px;
    word-break: break-word;
}

.ai-toast-body dd.ai-toast-message {
    margin-left: 0;
    clear: both;
}

.ai-toast-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    clear: both;
}
