/* AI Resilience Layer UI */

.attain-ai-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.attain-ai-progress-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ai-progress-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.5) inset;
    width: 90%;
    max-width: 440px;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.attain-ai-progress-overlay.active .ai-progress-card {
    transform: translateY(0);
}

.ai-loader-container {
    margin-bottom: 1.5rem;
}

.ai-pulsar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.ai-pulsar::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: ai-pulse 2s infinite;
    z-index: -1;
}

.ai-pulsar span {
    color: white;
    font-size: 32px;
}

@keyframes ai-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

.ai-progress-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-progress-card p {
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Retry Prompt Styles */
.ai-retry-prompt {
    display: none;
    text-align: left;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-retry-prompt.active {
    display: block;
}

.retry-warning-box {
    background: #fff7ed;
    border: 1px solid #ffedd5;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.retry-warning-box span {
    color: #f97316;
}

.retry-warning-text {
    font-size: 0.9rem;
    color: #9a3412;
    line-height: 1.4;
}

.ai-retry-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-retry-actions .attain-btn {
    width: 100%;
    justify-content: center;
}

.btn-model-answer {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.btn-model-answer:hover {
    background: #f1f5f9;
}

/* Dark Mode Support */
[data-theme="dark"] .ai-progress-card {
    background: #1e293b;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05) inset;
}

[data-theme="dark"] .ai-progress-card h3 {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
}

[data-theme="dark"] .ai-progress-card p {
    color: #94a3b8;
}

[data-theme="dark"] .ai-retry-prompt {
    border-top-color: #334155;
}

[data-theme="dark"] .retry-warning-box {
    background: rgba(251, 146, 60, 0.1);
    border-color: rgba(251, 146, 60, 0.2);
}

[data-theme="dark"] .btn-model-answer {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}
