/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Utilitarios */
.hidden {
    display: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    text-align: center;
    color: white;
}

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

.header-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Secciones principales */
.section {
    padding: 60px 0;
    min-height: 500px;
}

/* Sección de Bienvenida */
.welcome-card {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
}

.welcome-header {
    margin-bottom: 30px;
}

.welcome-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.welcome-header h2 {
    font-size: 2.2rem;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 10px;
}

.welcome-description {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 40px;
    line-height: 1.8;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item i {
    font-size: 1.5rem;
    color: #667eea;
}

.feature-item span {
    font-weight: 500;
    color: #2d3748;
}

.instruction-text {
    margin-top: 20px;
    color: #718096;
    font-size: 0.9rem;
}

.instruction-text i {
    margin-right: 5px;
    color: #667eea;
}

/* Botones */
.primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(102, 126, 234, 0.4);
}

.primary-button i {
    margin-right: 10px;
}

.secondary-button {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.action-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(16, 185, 129, 0.4);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.dashboard-header h2 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 600;
}

.dashboard-header i {
    margin-right: 10px;
    color: #667eea;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #059669;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-content p {
    color: #718096;
    font-weight: 500;
}

.monitoring-status {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.monitoring-status p {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 500;
}

.monitoring-status i {
    margin-right: 10px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Spinner */
.spinner {
    text-align: center;
    padding: 20px;
}

.spinner-ring {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sección de Gráficos */
.charts-header {
    text-align: center;
    margin-bottom: 50px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.charts-header h2 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.charts-header i {
    margin-right: 10px;
    color: #667eea;
}

.charts-header p {
    color: #718096;
    font-size: 1.1rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-wrapper {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    border: 1px solid #e0e0e0;

    /* --- NUEVOS ESTILOS PARA LA CARGA --- */
    opacity: 0; /* Inicialmente invisible */
    transform: translateY(20px); /* Ligeramente desplazado hacia abajo */
    transition: opacity 2s ease-out, transform 2s ease-out; /* Transición más larga para el efecto */
}

/* Clase para mostrar el gráfico */
.chart-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

.chart-wrapper:hover {
    transform: translateY(-5px);
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.chart-canvas {
    max-height: 300px;
}

/* Sección de Análisis */
.analysis-header {
    text-align: center;
    margin-bottom: 50px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.analysis-header h2 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.analysis-header i {
    margin-right: 10px;
    color: #f59e0b;
}

.analysis-header p {
    color: #718096;
    font-size: 1.1rem;
}

.insights-wrapper {
    margin-bottom: 40px;
}

.insights-grid {
    display: grid;
    gap: 25px;
}

.insight-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #667eea;
    transition: transform 0.3s ease;
}

.insight-card:hover {
    transform: translateX(5px);
}

.insight-card.warning {
    border-left-color: #f59e0b;
}

.insight-card.success {
    border-left-color: #10b981;
}

.insight-card.error {
    border-left-color: #ef4444;
}

.insight-card.info {
    border-left-color: #3b82f6;
}

.insight-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #4a5568;
}

.insight-content strong {
    color: #2d3748;
    font-weight: 600;
}

.analysis-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Sección Final */
.final-message-card {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 20px;
}

.final-message-card h2 {
    color: #2d3748;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.final-message-card p {
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.7;
}

.final-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .welcome-card {
        padding: 30px 20px;
    }
    
    .welcome-header h2 {
        font-size: 1.8rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-wrapper {
        padding: 20px;
    }
    
    .action-buttons,
    .analysis-actions,
    .final-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .primary-button,
    .secondary-button,
    .action-button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 40px 0;
    }
    
    .welcome-features {
        grid-template-columns: 1fr;
    }
    
    .feature-item {
        justify-content: center;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
}

/* Animaciones adicionales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section:not(.hidden) {
    animation: fadeInUp 0.6s ease-out;
}

/* Estilos para elementos específicos de Chart.js */
.chart-canvas {
    max-height: 400px !important;
}

/* Mejoras para accesibilidad */
button:focus,
.primary-button:focus,
.secondary-button:focus,
.action-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Estilos para mensajes de estado */
.status-message {
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-weight: 500;
}

.status-message.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.status-message.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.status-message.warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.status-message.info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Estilos para el subencabezado dentro de analysis-results */
.analysis-subheader {
    margin-top: 2.5rem; /* Más espacio arriba para separar de los insights */
    margin-bottom: 1.5rem;
    text-align: center;
    color: #2c3e50; /* Azul oscuro/Gris para el texto principal */
    border-bottom: 2px solid #e0cffc;
    padding-bottom: 1rem;
}

.analysis-subheader h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #2c3e50; /* Azul oscuro/Gris para el título */
}

.analysis-subheader h3 i {
    color: #3498db; /* Azul vibrante para el icono */
    font-size: 1.8rem;
}

.analysis-subheader p {
    font-size: 1rem;
    color: #34495e; /* Azul más suave para el subtítulo */
    max-width: 700px;
    margin: 0 auto;
}

/* Estilo para las tarjetas de sugerencia (diferente a los insights normales) */
.insight-card.suggestion-card {
    background-color: #f8f0ff; /* Lavanda claro */
    border-left: 6px solid #8b5cf6; /* Borde morado más vibrante */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    font-size: 1.05rem;
}

.insight-card.suggestion-card span {
    color: #8b5cf6; /* Color del icono para sugerencias */
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Ajustes para los insights existentes si quieres diferenciarlos más */
.insight-card {
    background-color: #ffffff;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-radius: 6px;
    color: #444;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.insight-card span {
    color: #3b82f6;
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Colores para tipos específicos de insights/sugerencias */
.insight-card.warning {
    border-left-color: #f59e0b;
}
.insight-card.warning span {
    color: #f59e0b;
}

.insight-card.success {
    border-left-color: #10b981;
}
.insight-card.success span {
    color: #10b981;
}

.insight-card.error {
    border-left-color: #ef4444;
}
.insight-card.error span {
    color: #ef4444;
}

/* Mensajes de información/carga */
.info-message {
    background-color: #e0f2fe;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    color: #2563eb;
    font-weight: 500;
    text-align: center;
}

/* Spinner para insights y sugerencias */
.insight-card.loading {
    background-color: #f3f4f6;
    color: #6b7280;
    text-align: center;
    font-style: italic;
    border: 1px dashed #d1d5db;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.insight-card.loading::before {
    content: '\f110';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    animation: spin 1s linear infinite;
}

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

/* --- Nuevos estilos para el CONTENEDOR de las sugerencias pedagógicas --- */
#pedagogical-suggestions-section {
    background-color: #ffffff; /* Fondo blanco para esta sección */
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-top: 40px;
    margin-bottom: 60px;
    opacity: 0; /* Para la animación de aparición */
    transform: translateY(20px); /* Para la animación de aparición */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

#pedagogical-suggestions-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.pedagogical-suggestions-header {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50; /* Azul oscuro/Gris para el texto principal */
}

.pedagogical-suggestions-header h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: #2c3e50; /* Azul oscuro/Gris para el título */
}

.pedagogical-suggestions-header h3 i {
    font-size: 2.2rem;
    color: #3498db; /* Azul vibrante para el icono */
}

.pedagogical-suggestions-header p {
    font-size: 1.1rem;
    color: #34495e; /* Azul más suave para la descripción */
    max-width: 800px;
    margin: 0 auto;
}

.suggestions-grid {
    display: grid;
    gap: 20px;
}

/* Estilo para el nuevo botón de mostrar sugerencias */
.show-suggestions-button {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%); /* Verde azulado profesional */
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(26, 188, 156, 0.3); /* Sombra acorde al nuevo color */
    display: block;
    margin: 40px auto 20px auto;
    text-align: center;
}

.show-suggestions-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(26, 188, 156, 0.4);
}

.show-suggestions-button i {
    margin-right: 10px;
}