/* ================================
   17 - AGENT LOADING STATES
   Progressive loading animation per i 5 agenti
   ================================ */

/* --- Agent Loading Container --- */
.agent-loading-container {
    padding: 1rem;
    animation: slideInFromRight 0.4s ease-out;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.agent-loading-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.agent-loading-header i {
    font-size: 1.2rem;
    color: var(--primary-sky);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.agent-loading-header span {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

/* --- Agent Cards List --- */
.agent-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* --- Agent Card --- */
.agent-card-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
    animation: agentCardSlide 0.4s ease-out backwards;
}

.agent-card-loading:nth-child(1) { animation-delay: 0.1s; }
.agent-card-loading:nth-child(2) { animation-delay: 0.2s; }
.agent-card-loading:nth-child(3) { animation-delay: 0.3s; }
.agent-card-loading:nth-child(4) { animation-delay: 0.4s; }
.agent-card-loading:nth-child(5) { animation-delay: 0.5s; }

@keyframes agentCardSlide {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Agent Card States */
.agent-card-loading.active {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.25);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.1);
}

.agent-card-loading.completed {
    background: rgba(61, 220, 132, 0.08);
    border-color: rgba(61, 220, 132, 0.25);
}

.agent-card-loading.completed .agent-card-icon {
    background: var(--primary-green);
    color: #fff;
}

.agent-card-loading.completed .agent-card-status {
    color: var(--primary-green);
}

/* --- Agent Icon --- */
.agent-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.3s;
}

/* Agent-specific colors */
.agent-card-loading.flights .agent-card-icon {
    background: rgba(0, 168, 232, 0.15);
    color: #00a8e8;
}
.agent-card-loading.hotels .agent-card-icon {
    background: rgba(61, 220, 132, 0.15);
    color: #3ddc84;
}
.agent-card-loading.activities .agent-card-icon {
    background: rgba(255, 107, 53, 0.15);
    color: #ff6b35;
}
.agent-card-loading.restaurants .agent-card-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}
.agent-card-loading.budget .agent-card-icon {
    background: rgba(124, 92, 231, 0.15);
    color: #7c5ce7;
}

/* Active state icon glow */
.agent-card-loading.active .agent-card-icon {
    animation: iconGlow 1.5s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0, 212, 255, 0); }
}

/* --- Agent Info --- */
.agent-card-info {
    flex: 1;
    min-width: 0;
}

.agent-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f8f9fa;
    margin-bottom: 2px;
}

.agent-card-status {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}

.agent-card-loading.active .agent-card-status {
    color: var(--primary-sky);
}

/* --- Agent Spinner / Checkmark --- */
.agent-card-indicator {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Spinner */
.agent-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-sky);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Checkmark */
.agent-checkmark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    animation: checkBounce 0.4s ease-out;
}

@keyframes checkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.agent-checkmark i {
    animation: checkPop 0.4s ease-out;
}

@keyframes checkPop {
    0% { transform: scale(0) rotate(-45deg); }
    50% { transform: scale(1.3) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* --- Assembling State --- */
.agent-assembling {
    text-align: center;
    padding: 1rem;
    animation: fadeInUp 0.4s ease-out;
}

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

.agent-assembling-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-sky) 0%, var(--primary-green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: assemblePulse 1s ease-in-out infinite;
}

@keyframes assemblePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(0, 212, 255, 0); }
}

.agent-assembling-icon i {
    font-size: 1.2rem;
    color: #fff;
    animation: rotateIcon 2s ease-in-out infinite;
}

@keyframes rotateIcon {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.agent-assembling-text {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

/* --- Final Reveal --- */
.agent-reveal {
    animation: revealFinal 0.6s ease-out;
}

@keyframes revealFinal {
    0% { opacity: 0; transform: scale(0.95); }
    50% { transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

/* --- Progress Bar (optional) --- */
.agent-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.agent-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-sky), var(--primary-green));
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progressShimmer 1.5s ease-in-out infinite;
    background-size: 200% 100%;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .agent-loading-container {
        padding: 0.75rem;
    }

    .agent-card-loading {
        padding: 10px 12px;
    }

    .agent-card-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .agent-card-name {
        font-size: 0.78rem;
    }

    .agent-card-status {
        font-size: 0.68rem;
    }
}