/* ==========================================================================
   MATEMATOCAS - Biblioteca de Problemas Matemáticos
   Hoja de Estilos Principal (style.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CONFIGURACIÓN GENERAL Y TIPOGRAFÍA
   -------------------------------------------------------------------------- */
body {
    background-color: #f0f2f5; /* Fondo gris claro suave para descansar la vista */
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding-top: 65px;  /* Altura exacta de la barra fija superior */
    padding-bottom: 80px; /* Espacio inferior para la barra de navegación móvil */
    color: #333333;
}

/* Contenedor principal con margen equidistante respecto a la barra superior y laterales */
.main-content {
    padding: 1.25rem !important; /* 20px arriba, izquierda y derecha de forma totalmente equidistante */
}

/* Título de la aplicación en la cabecera (clicable para ir a inicio) */
.app-title {
    font-weight: 700;
    color: #198754; /* Verde corporativo de Andalucía / Educación */
    margin-left: 10px;
    font-size: 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s ease;
}

.app-title:hover {
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   2. BARRAS DE NAVEGACIÓN (SUPERIOR E INFERIOR)
   -------------------------------------------------------------------------- */
/* Barra superior blanca con sombra sutil */
.navbar-top {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    z-index: 1020;
}

/* Barra inferior móvil */
.navbar-bottom {
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    height: 65px;
    z-index: 1030;
}

/* Enlaces / Botones de la barra inferior */
.nav-link-bottom {
    color: #6c757d;
    text-align: center;
    font-size: 0.75rem;
    padding: 5px 0;
    flex-grow: 1;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-link-bottom i {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 2px;
}

/* Estado activo del botón de navegación */
.nav-link-bottom.active {
    color: #198754;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   3. ANIMACIONES Y CONTENEDORES
   -------------------------------------------------------------------------- */
/* Transición suave al cambiar de pestaña/sección */
.seccion {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tarjeta contenedora blanca para formularios y paneles */
.container-form {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* Centrado vertical dinámico para el panel de inicio en función de la altura del navegador */
.sec-inicio-centrada {
    min-height: calc(100vh - 170px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sec-inicio-centrada .container-form {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* --------------------------------------------------------------------------
   4. ELEMENTOS DE FORMULARIO Y CAMPOS AUTOMÁTICOS
   -------------------------------------------------------------------------- */
/* Campos autocalculados de solo lectura (Competencias, Saberes, Descriptores) */
.auto-field {
    background-color: #e9ecef !important;
    color: #495057;
    cursor: not-allowed;
}

/* Textareas automáticos con scroll y redimensionado vertical manual */
textarea.auto-field {
    resize: vertical;
    overflow-y: auto;
    min-height: 85px;
}

/* Listas con scroll para checkboxes (ej. múltiples saberes o descriptores) */
.checkbox-list {
    max-height: 160px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

.form-check {
    margin-bottom: 0.25rem;
}

/* --------------------------------------------------------------------------
   5. PANTALLA DE CARGA (SPINNER OVERLAY)
   -------------------------------------------------------------------------- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* --------------------------------------------------------------------------
   6. COLORES PARA TIPOS Y SUBTIPOS DE PROBLEMAS MATEMÁTICOS
   -------------------------------------------------------------------------- */
/* Tipo: Estructura Matemática (Naranja) */
.bg-tipo-matematico {
    background-color: #fd7e14 !important;
    color: #ffffff !important;
}
.text-tipo-matematico {
    color: #fd7e14 !important;
    font-weight: bold;
}

/* Tipo: Forma del Enunciado (Morado) */
.bg-tipo-enunciado {
    background-color: #6f42c1 !important;
    color: #ffffff !important;
}
.text-tipo-enunciado {
    color: #6f42c1 !important;
    font-weight: bold;
}

/* Tipo: Por la Pregunta (Azul) */
.bg-tipo-pregunta {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}
.text-tipo-pregunta {
    color: #0d6efd !important;
    font-weight: bold;
}

/* Tipo: Por los Datos (Verde) */
.bg-tipo-dato {
    background-color: #198754 !important;
    color: #ffffff !important;
}
.text-tipo-dato {
    color: #198754 !important;
    font-weight: bold;
}

/* Tipo: Retos Matemáticos (Rosa) */
.bg-tipo-reto {
    background-color: #f8bbd0 !important;
    color: #212529 !important;
}
.text-tipo-reto {
    color: #d81b60 !important;
    font-weight: bold;
}

/* --------------------------------------------------------------------------
   7. DETALLES VISUALES Y ANIMACIÓN DEL LOGO
   -------------------------------------------------------------------------- */
.logo-menu-icon {
    height: 32px;
    width: auto;
    display: block;
    transition: all 0.2s ease-in-out;
}

.logo-menu-icon:hover {
    transform: scale(1.15);
    opacity: 0.9;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   8. ESTILOS DE TARJETAS Y RESULTADOS DE PROBLEMAS
   -------------------------------------------------------------------------- */
.card-problema {
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    background: #ffffff;
}

.card-problema:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.enunciado-preview {
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.5;
}

/* Utilidad para ocultar elementos condicionalmente */
.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   9. ESTILOS DE DIRECTORIO DOCENTE Y MENSAJERÍA INTERNA
   -------------------------------------------------------------------------- */
.card-docente {
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid #e9ecef;
    background: #ffffff;
}

.card-docente:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.avatar-docente {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #e8f5e9;
    color: #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.msg-item {
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-left: 3px solid transparent;
}

.msg-item:hover {
    background-color: #f8f9fa;
}

.msg-item-unread {
    background-color: #f0fdf4 !important;
    border-left: 3px solid #2e7d32 !important;
    font-weight: 600;
}

.badge-unread-dot {
    width: 8px;
    height: 8px;
    background-color: #198754;
    border-radius: 50%;
    display: inline-block;
}

/* --------------------------------------------------------------------------
   10. AVATAR DE USUARIO EN NAVBAR Y ROL EQUIPO MATEMATOCAS
   -------------------------------------------------------------------------- */
.user-dropdown-toggle {
    cursor: pointer;
    text-decoration: none;
    outline: none;
    transition: transform 0.15s ease;
}

.user-dropdown-toggle:hover {
    transform: scale(1.03);
}

.user-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2e7d32, #198754);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.navbar-saludo-centro {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.bg-rol-equipo {
    background-color: #6f42c1 !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   11. LOGOS E IDENTIDAD VISUAL DE LA APLICACIÓN
   -------------------------------------------------------------------------- */
.app-logo-navbar {
    height: 34px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    aspect-ratio: auto;
    border-radius: 6px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.08));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.app-logo-navbar:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.12));
}

.app-logo-menu {
    height: 28px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.login-logo-img {
    max-height: 90px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.12));
    transition: transform 0.3s ease;
}

.login-logo-img:hover {
    transform: scale(1.05);
}

.hero-logo-panel {
    max-height: 155px;
    width: auto;
    max-width: 320px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.08));
    transition: transform 0.3s ease;
}

.hero-logo-panel:hover {
    transform: scale(1.03);
}

/* --------------------------------------------------------------------------
   12. TARJETAS DEL PANEL DE INICIO (DASHBOARD) Y CENTROS
   -------------------------------------------------------------------------- */
.card-dashboard {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.card-dashboard:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
    background-color: #ffffff !important;
}

/* Estado bloqueado para usuarios con rol Consultor */
.card-dashboard-disabled {
    opacity: 0.7;
    cursor: not-allowed !important;
    background-color: #f8f9fa !important;
    border: 1px dashed #ced4da !important;
}

.card-dashboard-disabled:hover {
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
    background-color: #f8f9fa !important;
}

.card-dashboard-disabled * {
    cursor: not-allowed !important;
}

.dashboard-icon-box {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.card-dashboard:hover .dashboard-icon-box {
    transform: scale(1.1);
}

.card-dashboard-logo:hover img {
    transform: scale(1.08);
    transition: transform 0.2s ease;
}

.centro-card-item {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 14px;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.centro-card-item:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-centro-web {
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-centro-web:hover {
    background-color: #0d6efd;
    color: #ffffff !important;
}

.centro-admin-card {
    border-left: 4px solid #0dcaf0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.centro-admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Botones e iconos de Redes Sociales de Centros Educativos */
.btn-centro-rrss {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-rrss-fb {
    color: #1877f2;
    background-color: rgba(24, 119, 242, 0.08);
}
.btn-rrss-fb:hover {
    background-color: #1877f2;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(24, 119, 242, 0.3);
}

.btn-rrss-ig {
    color: #e4405f;
    background-color: rgba(228, 64, 95, 0.08);
}
.btn-rrss-ig:hover {
    background-color: #e4405f;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(228, 64, 95, 0.3);
}

.btn-rrss-yt {
    color: #ff0000;
    background-color: rgba(255, 0, 0, 0.08);
}
.btn-rrss-yt:hover {
    background-color: #ff0000;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(255, 0, 0, 0.3);
}

