/* ============================================================================
   ESTILOS MAX-PFC - Panel de Actividad Estilo Google ADK
   ============================================================================ */

/* Variables de color */
:root {
    --max-primary: #4285f4;
    --max-success: #34a853;
    --max-warning: #fbbc05;
    --max-error: #ea4335;
    --max-info: #4285f4;
    --max-bg-light: #f8f9fa;
    --max-bg-dark: #1a1a2e;
    --max-text: #202124;
    --max-text-muted: #5f6368;
    --max-border: #e8eaed;
}


/* ============================================================================
   PANEL DE ACTIVIDAD PRINCIPAL
   ============================================================================ */

.max-activity-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
    border: 1px solid var(--max-border);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    max-width: 100%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.max-activity-panel.activity-exit {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}


/* ============================================================================
   HEADER DEL PANEL
   ============================================================================ */

.activity-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--max-primary) 0%, #5a9cf8 100%);
    color: white;
    gap: 12px;
}

.activity-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 20px;
    height: 20px;
}

.activity-title {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.2px;
}

.activity-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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


/* ============================================================================
   LOG DE ACTIVIDAD
   ============================================================================ */

.activity-log {
    max-height: 200px;
    overflow-y: auto;
    padding: 12px 16px;
    background: #fafbfc;
}

.activity-log::-webkit-scrollbar {
    width: 6px;
}

.activity-log::-webkit-scrollbar-track {
    background: transparent;
}

.activity-log::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

.activity-log::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}


/* ============================================================================
   EVENTOS INDIVIDUALES
   ============================================================================ */

.activity-event {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: white;
    border-left: 3px solid var(--max-border);
    font-size: 13px;
    gap: 10px;
    animation: fadeInEvent 0.2s ease-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

@keyframes fadeInEvent {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-event:last-child {
    margin-bottom: 0;
}

.event-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.event-text {
    flex: 1;
    color: var(--max-text);
    line-height: 1.4;
}

.event-text code {
    background: #e8f0fe;
    color: var(--max-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Roboto Mono', 'Fira Code', monospace;
}

.event-text strong {
    color: var(--max-primary);
    font-weight: 600;
}

.event-time {
    font-size: 11px;
    color: var(--max-text-muted);
    flex-shrink: 0;
    font-family: 'Roboto Mono', monospace;
}


/* ============================================================================
   TIPOS DE EVENTOS (COLORES)
   ============================================================================ */

/* Inicio */
.activity-event-start {
    border-left-color: var(--max-primary);
    background: linear-gradient(90deg, #e8f0fe 0%, white 100%);
}

/* Éxito */
.activity-event-success {
    border-left-color: var(--max-success);
    background: linear-gradient(90deg, #e6f4ea 0%, white 100%);
}

/* Transferencia */
.activity-event-transfer {
    border-left-color: #9c27b0;
    background: linear-gradient(90deg, #f3e5f5 0%, white 100%);
}

/* Pensamiento */
.activity-event-thinking {
    border-left-color: var(--max-warning);
    background: linear-gradient(90deg, #fef7e0 0%, white 100%);
}

/* Herramienta */
.activity-event-tool {
    border-left-color: #00bcd4;
    background: linear-gradient(90deg, #e0f7fa 0%, white 100%);
}

/* Respuesta */
.activity-event-response {
    border-left-color: var(--max-info);
    background: linear-gradient(90deg, #e8f0fe 0%, white 100%);
}

/* Error */
.activity-event-error {
    border-left-color: var(--max-error);
    background: linear-gradient(90deg, #fce8e6 0%, white 100%);
}


/* ============================================================================
   ESTILOS STEPPER (ALTERNATIVO)
   ============================================================================ */

#max-stepper {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stepper-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 20px 0;
}

.stepper-progress::before {
    content: '';
    position: absolute;
    top: 35px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 12px;
    color: #666;
    text-align: center;
    max-width: 80px;
}

.step.active .step-icon {
    background: var(--max-primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.2);
    animation: pulse 1.5s ease-in-out infinite;
}

.step.active .step-label {
    color: var(--max-primary);
    font-weight: 600;
}

.step.completed .step-icon {
    background: var(--max-success);
    color: white;
}

.step.completed .step-label {
    color: var(--max-success);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(66, 133, 244, 0.1);
    }
}


/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .max-activity-panel {
        border-radius: 12px;
        margin: 10px 0 15px 0;
    }

    .activity-header {
        padding: 12px 16px;
    }

    .activity-icon {
        width: 32px;
        height: 32px;
    }

    .activity-title {
        font-size: 14px;
    }

    .activity-log {
        max-height: 150px;
        padding: 10px 12px;
    }

    .activity-event {
        padding: 6px 10px;
        font-size: 12px;
    }

    .event-time {
        display: none;
    }

    /* Stepper responsive */
    .stepper-progress {
        flex-direction: column;
        gap: 10px;
    }

    .stepper-progress::before {
        display: none;
    }

    .step {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }

    .step-icon {
        margin-right: 10px;
        margin-bottom: 0;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .step-label {
        text-align: left;
        max-width: none;
    }
}


/* ============================================================================
   MEJORAS VISUALES ADICIONALES
   ============================================================================ */

/* Mensajes del chat con mejor formato */
[data-kt-element="message-text"] {
    line-height: 1.6;
}

[data-kt-element="message-text"] code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9em;
}

[data-kt-element="message-text"] strong {
    color: #1a73e8;
}

/* Animación de entrada para mensajes */
.d-flex.justify-content-start.mb-10,
.d-flex.justify-content-end.mb-10 {
    animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}