/* Estilos para las interacciones de la matriz */
.matrix-highlight,
.matrix-highlight-temp {
    position: relative;
    z-index: 2;
}

.matrix-highlight {
    animation: highlightPulse 1.5s infinite;
}

.matrix-highlight-temp {
    animation: highlightPulseTemp 0.5s forwards;
}

/* Efectos de selección y hover */
.matrix-cell {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
    position: relative;
}

.matrix-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2;
}

/* Celda activa */
.matrix-active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    z-index: 3;
    border: 2px solid var(--color-primary);
}

/* Contenido de las celdas */
.cell-content {
    text-align: center;
    padding: 1rem;
}

.scenario-icon {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}

.matrix-cell:hover .scenario-icon {
    transform: scale(1.1);
}

.matrix-cell h3 {
    font-weight: 600;
    margin: 0.5rem 0;
    color: var(--color-primary);
}

.matrix-cell p {
    opacity: 0.9;
    font-size: 0.95rem;
    margin: 0;
    color: var(--color-neutral);
}

/* Animaciones */
@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(26, 35, 126, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(26, 35, 126, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 35, 126, 0); }
}

@keyframes highlightPulseTemp {
    0% { background: transparent; }
    100% { background: rgba(26, 35, 126, 0.1); }
}

/* Estados específicos para cada escenario */
.matrix-cell[data-scenario="A"].matrix-active { background: rgba(39, 174, 96, 0.3); }
.matrix-cell[data-scenario="B"].matrix-active { background: rgba(231, 76, 60, 0.3); }
.matrix-cell[data-scenario="C"].matrix-active { background: rgba(52, 152, 219, 0.3); }
.matrix-cell[data-scenario="D"].matrix-active { background: rgba(243, 156, 18, 0.3); }
.matrix-cell[data-scenario="E"].matrix-active { background: rgba(155, 89, 182, 0.3); }
.matrix-cell[data-scenario="F"].matrix-active { background: rgba(192, 57, 43, 0.3); }

/* Elementos relacionados resaltados */
.row-label.matrix-highlight,
.ratio-cell.matrix-highlight,
.row-label.matrix-highlight-temp,
.ratio-cell.matrix-highlight-temp {
    background: rgba(26, 35, 126, 0.15);
    font-weight: bold;
    color: #1a237e;
}

/* Media queries para responsividad */
@media (max-width: 768px) {
    .matrix-cell {
        padding: 0.75rem;
    }

    .scenario-icon {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .matrix-cell h3 {
        font-size: 1rem;
        margin: 0.25rem 0;
    }

    .matrix-cell p {
        font-size: 0.85rem;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .matrix-cell,
    .scenario-icon,
    .matrix-highlight,
    .matrix-highlight-temp {
        transition: none;
        animation: none;
    }
}