/**
 * navigation-actions.css
 *
 * Estilos para acciones de navegación desde agentes
 * - Indicadores de navegación
 * - Highlights de elementos
 * - Animaciones de transición
 *
 * @version 1.0
 * @date 2025-11-07
 */

/* ==========================================
   NAVIGATION INDICATOR (indicador de carga)
   ========================================== */

.navigation-indicator {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transition: top 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navigation-indicator.visible {
    top: 20px;
}

.navigation-indicator::before {
    content: '🧭';
    font-size: 18px;
}

/* Animación de pulso */
.navigation-indicator::after {
    content: '';
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

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

/* ==========================================
   AGENT HIGHLIGHTED (elementos destacados)
   ========================================== */

.agent-highlighted {
    animation: agent-highlight-pulse 2s ease-in-out;
    position: relative;
    z-index: 100;
}

/* Efecto de brillo pulsante */
@keyframes agent-highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
        background-color: transparent;
    }
    50% {
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.3);
        background-color: rgba(102, 126, 234, 0.15);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
        background-color: transparent;
    }
}

/* Borde destacado */
.agent-highlighted {
    border: 2px solid #667eea !important;
    border-radius: 6px;
}

/* Para filas de tabla */
tr.agent-highlighted {
    background-color: rgba(102, 126, 234, 0.08) !important;
}

tr.agent-highlighted:hover {
    background-color: rgba(102, 126, 234, 0.15) !important;
}

/* Para tarjetas/cards */
.card.agent-highlighted {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* ==========================================
   NAVIGATED FROM AGENT (panel tras navegación)
   ========================================== */

.main-panel.navigated-from-agent {
    animation: fade-in-from-agent 0.5s ease-in-out;
}

@keyframes fade-in-from-agent {
    0% {
        opacity: 0.5;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   AGENT NAVIGATION BADGE (badge en sidebar)
   ========================================== */

.view-item.navigated-by-agent::after {
    content: '🤖';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    animation: bounce-gentle 1s ease-in-out 3;
}

@keyframes bounce-gentle {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
}

/* ==========================================
   FILTER APPLIED (indicador de filtro aplicado)
   ========================================== */

.filters-bar.agent-filters-applied::before {
    content: '🤖 Filtros aplicados por agente';
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 12px;
    animation: slide-in-left 0.4s ease;
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================
   AGENT ACTION NOTIFICATION (notificación)
   ========================================== */

.agent-action-notification {
    position: fixed;
    bottom: -100px;
    right: 24px;
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    transition: bottom 0.4s ease-out;
}

.agent-action-notification.visible {
    bottom: 24px;
}

.agent-action-notification .title {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-action-notification .title::before {
    content: '🤖';
    font-size: 18px;
}

.agent-action-notification .message {
    color: #666;
    font-size: 14px;
}

.agent-action-notification .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
}

.agent-action-notification .close-btn:hover {
    color: #333;
}

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

@media (max-width: 768px) {
    .navigation-indicator {
        font-size: 13px;
        padding: 10px 18px;
        max-width: 90%;
        text-align: center;
    }

    .agent-action-notification {
        right: 12px;
        bottom: -100px;
        min-width: auto;
        max-width: calc(100% - 24px);
    }

    .agent-action-notification.visible {
        bottom: 12px;
    }
}

/* ==========================================
   DARK MODE (opcional)
   ========================================== */

@media (prefers-color-scheme: dark) {
    .navigation-indicator {
        background: linear-gradient(135deg, #4a5ccc 0%, #5a3d7a 100%);
    }

    .agent-action-notification {
        background: #2d2d2d;
        border-left-color: #667eea;
    }

    .agent-action-notification .title {
        color: #e0e0e0;
    }

    .agent-action-notification .message {
        color: #b0b0b0;
    }

    .agent-highlighted {
        border-color: #8b9eea !important;
        box-shadow: 0 0 0 8px rgba(139, 158, 234, 0.2);
    }

    tr.agent-highlighted {
        background-color: rgba(139, 158, 234, 0.15) !important;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .navigation-indicator,
    .agent-highlighted,
    .main-panel.navigated-from-agent,
    .agent-action-notification {
        animation: none !important;
        transition: none !important;
    }

    .card.agent-highlighted {
        transform: none !important;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .agent-highlighted {
        border-width: 3px !important;
        border-color: #000 !important;
    }

    .navigation-indicator {
        border: 2px solid #fff;
    }
}
