/* Estilos generales */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.header {
    text-align: center;
    color: white;
    padding: 2rem 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.timestamp {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 0;
}

/* Contenedor de la red neuronal */
.neural-network-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    min-height: 400px;
    position: relative;
}

/* Capas de la red neuronal */
.neural-layer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    flex: 1;
    position: relative;
}

.layer-label {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Neuronas */
.neuron {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 3px solid transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.neuron.inactive {
    background: linear-gradient(145deg, #e6e6e6, #ffffff);
    color: #666;
    border-color: #ddd;
}

.neuron.inactive:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    border-color: #007bff;
    background: linear-gradient(145deg, #f0f8ff, #e6f3ff);
}

.neuron.active {
    background: linear-gradient(145deg, #28a745, #20c997);
    color: white;
    border-color: #1e7e34;
    animation: pulse 2s infinite;
}

.neuron.active:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
    }
    50% {
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.8);
    }
    100% {
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
    }
}

/* Tooltip de las neuronas */
.neuron-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.neuron:hover .neuron-tooltip {
    opacity: 1;
}

/* Conexiones entre capas */
.neural-layer:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -2rem;
    top: 50%;
    width: 4rem;
    height: 2px;
    background: linear-gradient(90deg, #007bff, #28a745);
    transform: translateY(-50%);
    z-index: 1;
}

/* Panel de control */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border: none;
    font-weight: bold;
}

/* Botones */
.btn {
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Barra de progreso */
.progress {
    border-radius: 25px;
    height: 25px;
    background: rgba(255, 255, 255, 0.3);
}

.progress-bar {
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Alimentos filtrados */
.filtered-foods-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.food-item {
    display: inline-block;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 0.3rem 0.6rem;
    margin: 0.2rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.food-item:hover {
    background: #007bff;
    color: white;
    transform: scale(1.05);
}

/* Resultados de predicción */
.prediction-correct {
    background: linear-gradient(145deg, #28a745, #20c997);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: bold;
    text-align: center;
}

.prediction-incorrect {
    background: linear-gradient(145deg, #dc3545, #c82333);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: bold;
    text-align: center;
}

/* Modal de activación de neurona */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-radius: 15px 15px 0 0;
    border: none;
}

.modal-footer {
    border-radius: 0 0 15px 15px;
    border: none;
}

/* Dropdowns en el modal */
.form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Información de neuronas activas */
#active-neurons-info {
    min-height: 100px;
}

.neuron-info-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

.neuron-info-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.neuron-info-header {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.neuron-info-details {
    font-size: 0.9rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .neural-network-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .neural-layer {
        flex-direction: row;
        gap: 1rem;
    }
    
    .neural-layer:not(:last-child)::after {
        right: 50%;
        top: auto;
        bottom: -2rem;
        width: 2px;
        height: 2rem;
        transform: translateX(-50%);
    }
    
    .neuron {
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
}

/* Animaciones adicionales */
.neuron.clickable {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Estados especiales */
.neuron.available {
    background: linear-gradient(145deg, #ffc107, #ffca2c);
    color: #333;
    border-color: #ffc107;
}

.neuron.available:hover {
    background: linear-gradient(145deg, #ffca2c, #ffd54f);
    transform: scale(1.15);
}

.neuron.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    color: #6c757d;
}

.neuron.disabled:hover {
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
} 