@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,400;0,500;0,600;0,900;1,100;1,200&display=swap');
* {
    box-sizing: border-box;
    font-family: 'Barlow';
}

body {
    background-color: #314056;
    padding: 50px;
    color: #2e417b;
}


/* SECCION LOGIN */

.contenedor-login {
    max-width: 600px;
    width: 100%;
    margin: auto;
    background-color: #f1f2f8;
    border-radius: 30px;
    padding: 30px;
}

.contenedor-login h1 {
    text-align: center;
}

.contenedor-login .contenedor-form {
    background-color: #fff;
    padding: 20px;
    border-radius: 15px;
}

.contenedor-login .contenedor-form .fila {
    margin: 20px 0;
}

.contenedor-login .contenedor-form .fila label {
    display: block;
    margin-bottom: 10px;
}

.contenedor-login .contenedor-form .fila .entrada {
    display: flex;
    align-items: center;
}

.contenedor-login .contenedor-form .fila i {
    margin-right: 15px;
    font-size: 25px;
}

.contenedor-login .contenedor-form .fila input {
    width: 100%;
    padding: 10px;
    border: none;
    border: 1px solid #c0c0c0;
}

.contenedor-login .contenedor-form .btn {
    background: #2d40bf;
    font-size: 16px;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 15px;
    margin: 20px 0;
    transition: .5s;
    cursor: pointer;
}

.contenedor-login .contenedor-form .btn:hover {
    background-color: #4b62f5;
}


/* ESTILOS GENERALES */

hr {
    border: none;
    border-bottom: 1px solid #d6d6d6;
}

.contenedor {
    max-width: 1000px;
    width: 100%;
    margin: auto;
    background-color: #f1f2f8;
    padding: 20px;
    border-radius: 30px;
}

.contenedor .contenedor-info {
    display: flex;
}

.contenedor .contenedor-info .nav {
    width: 250px;
    border-right: 1px solid #d6d6d6;
}

.contenedor .contenedor-info .nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contenedor .contenedor-info .nav ul li {
    margin: 15px 0;
}

.contenedor .contenedor-info .nav ul li .icono {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #fff;
    color: #314056;
    border-radius: 15px;
    text-align: center;
    margin-right: 10px;
}

.contenedor .contenedor-info .nav ul li .icono i {
    line-height: 40px;
}

.contenedor .contenedor-info .nav ul li a {
    text-decoration: none;
    color: #31415a;
    font-size: 16px;
    font-weight: 600;
}

.contenedor .contenedor-info .nav ul li .selected {
    background-color: #2d40bf;
    color: #d6d6d6;
}

.contenedor .contenedor-info .panel {
    background-color: #fff;
    width: 100%;
    border-radius: 30px;
    margin-left: 20px;
    padding: 25px;
}


/* SECCION DASHBOARD (MODIFICADA) */

#dashboard {
    display: flex;
    flex-wrap: wrap;
}

#dashboard .card {
    text-align: center;
    padding: 5px;
    width: 140px;
    height: 170px;
    margin: 10px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
}

#dashboard .card .tema {
    color: #2e417b; /* <-- CAMBIO: Texto oscuro para contraste */
    text-transform: uppercase;
}

#dashboard .card .cantidad {
    font-size: 36px;
    font-weight: bold;
    color: #2e417b; /* <-- CAMBIO: Texto oscuro para contraste */
}

/* --- NUEVA REGLA AÑADIDA --- */
#dashboard .card span:last-child {
    color: #2e417b; /* <-- CAMBIO: Texto "Preguntas" a oscuro */
}


/* SECCION NUEVA PREGUNTA */

#nuevaPregunta .fila {
    margin: 15px 0;
}

#nuevaPregunta label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

#nuevaPregunta #tema {
    width: 50%;
    padding: 10px;
    border: 1px solid #c0c0c0;
}

#nuevaPregunta .agregarTema i {
    display: inline-block;
    margin-left: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #2d40bf;
}

#nuevaPregunta .agregarTema i:hover {
    color: #2e417b;
}

/*#nuevaPregunta textarea {
    width: 100%;
    border: 1px solid #c0c0c0;
    padding: 15px;
    max-height: 80px;
}*/

#nuevaPregunta .opcion {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#nuevaPregunta .opcion label {
    width: 10%;
    display: inline;
}

#nuevaPregunta .opcion input {
    width: 90%;
    padding: 10px;
    margin-left: 15px;
    border: 1px solid #c0c0c0;
}

#nuevaPregunta .correcta {
    width: 10%;
    padding: 6px;
    border: 1px solid #c0c0c0;
    margin-left: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

#nuevaPregunta .btn-guardar {
    background: #2d40bf;
    font-size: 16px;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 15px;
    margin: 5px 0;
    transition: .5s;
    cursor: pointer;
}

/* --- CLASES DE GRADIENTE (MODIFICADAS) --- */

.gradiente1 {
    background: linear-gradient(to bottom, #7cafe9, #fed5ee);
}

.gradiente2 {
    background: linear-gradient(to bottom, #fea498, #ffd99c);
}

.gradiente3 {
    background: linear-gradient(to bottom, #9adcbf, #fef2b3);
}

/* --- NUEVAS CLASES DE GRADIENTE AÑADIDAS --- */

/* Se eliminó "color: #fff;" de todas las clases nuevas para que hereden el color oscuro */
.gradiente4 {
    background: linear-gradient(to bottom, #5d8ee7, #a4c5f9);
}

.gradiente5 {
    background: linear-gradient(to bottom, #9b59b6, #d294e3);
}

.gradiente6 {
    background: linear-gradient(to bottom, #2ecc71, #8fe0b3);
}

.gradiente7 {
    background: linear-gradient(to bottom, #3498db, #87ceeb);
}

.gradiente8 {
    background: linear-gradient(to bottom, #e74c3c, #f1a9a0);
}


/* Ventana Modal de Noticias */


/* The Modal (background) */

.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1;
    /* Sit on top */
    padding-top: 100px;
    /* Location of the box */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    /* Fallback color */
    background-color: rgba(0, 0, 0, 0.6);
    /* Black w/ opacity */
    z-index: 99;
}


/* Modal Content */

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 500px;
    height: auto;
    position: relative;
}

.modal-content label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    border: 1px solid #c0c0c0;
}

.modal-content .btn {
    background: #2d40bf;
    font-size: 16px;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 15px;
    margin: 20px 0;
    transition: .5s;
    cursor: pointer;
}


/* The Close Button */

.close {
    position: absolute;
    right: -50px;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    border: 2px solid #fff;
    height: 45px;
    width: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.close:focus {
    text-decoration: none;
    cursor: pointer;
}


/* SECCION LISTADO DE PREGUNTAS */

#listadoPreguntas .contenedor-pregunta {
    border: 1px solid #c0c0c0;
    padding: 10px;
    margin-bottom: 15px;
}

#listadoPreguntas .contenedor-pregunta header {
    display: flex;
    justify-content: space-between;
}

#listadoPreguntas .contenedor-pregunta header .tema {
    display: block;
    background: #7cafe9;
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
}

#listadoPreguntas .contenedor-pregunta header .opciones i {
    display: inline-block;
    margin-right: 10px;
    cursor: pointer;
}

#listadoPreguntas .contenedor-pregunta .pregunta {
    font-size: 20px;
    font-style: italic;
}

#listadoPreguntas .contenedor-pregunta .opcion {
    margin-bottom: 10px;
}

#listadoPreguntas .contenedor-pregunta .caja {
    display: inline-block;
    text-align: center;
    line-height: 30px;
    width: 30px;
    height: 100px;
    border: 1px solid #888;
    font-weight: bold;
}

.pintarVerde {
    background-color: greenyellow;
}


/* SECCION CONFIGURACION */

#configuracion .fila {
    margin: 15px 0;
}

#configuracion label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

#configuracion input {
    width: 100%;
    padding: 10px;
    border: 1px solid #c0c0c0;
}

#configuracion .btn-actualizar {
    width: auto;
    display: inline;
    background: #2d40bf;
    font-size: 16px;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 15px;
    margin: 5px 0;
    cursor: pointer;
}

.form-eliminar {
    padding: 5px;
}

.form-eliminar i {
    color: #a41300;
    font-size: 20px;
}

.form-eliminar .btn-eliminar {
    border: none;
    background-color: #a41300;
    color: #fff;
    display: inline-block;
    padding: 5px 10px;
    cursor: pointer;
    margin: 10px 0;
}

.form-eliminar .btn-eliminar:hover {
    background-color: darkred;
}

/* --- ESTILOS PARA EL PANEL DEL DASHBOARD (DERECHA) --- */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-config {
    background-color: #4A63E7;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-config:hover {
    background-color: #3a4bb3;
}

.btn-config.active {
    background-color: #8C9EFF;
    color: #2b3a55;
}

/* --- CAMBIO: Cuadrícula de 3 columnas --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columnas */
    gap: 20px;
    padding-top: 20px;
}

/* --- CAMBIO: Botones más pequeños --- */
.dashboard-item {
    background-color: #f0f2f5;
    border-radius: 10px;
    padding: 15px; /* Reducido de 20px */
    text-align: center;
    text-decoration: none;
    color: #2b3a55;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 140px; /* Reducido de 150px */
}

.dashboard-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.dashboard-item i.fa-solid {
    font-size: 2.5em; /* Ligeramente reducido */
    margin-bottom: 10px;
    color: #4A63E7;
}

/* --- CAMBIO: h3 a h4 --- */
.dashboard-item h4 {
    margin: 5px 0 10px;
    color: #2b3a55;
    font-size: 1.1em; /* Ligeramente reducido */
}

.dashboard-item ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    text-align: left;
    width: 100%;
}

.dashboard-item ul li {
    background-color: #e0e2e6;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 3px;
    color: #555;
    font-size: 0.9em;
}

/* --- ESTILOS PARA EL MODO EDICIÓN Y DRAG/DROP --- */

.dashboard-item.oculto {
    display: none;
}

.toggle-vis {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.toggle-vis:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.panel.edit-mode .dashboard-item .toggle-vis {
    display: flex;
}

.panel.edit-mode .dashboard-item.oculto {
    display: flex; 
    opacity: 0.5;
    border: 2px dashed #999;
}

.panel.edit-mode .dashboard-item.oculto .toggle-vis {
    background-color: #FFC107;
    color: #2b3a55;
}

.panel.edit-mode .dashboard-item.oculto .toggle-vis:hover {
    background-color: #e0a800;
}

/* --- NUEVO: Estilos para Drag and Drop --- */

/* Cursor para "agarrar" en modo edición */
.panel.edit-mode .dashboard-item {
    cursor: grab;
}

/* Cursor mientras se "agarra" */
.panel.edit-mode .dashboard-item:active {
    cursor: grabbing;
}

/* Estilo del ítem "fantasma" que estás arrastrando */
.dragging-helper {
    background: #cce5ff; /* Un fondo azulado claro */
    border: 2px dashed #4A63E7;
    opacity: 0.7;
    border-radius: 10px;
}


/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .contenedor {
        flex-direction: column;
    }
    .nav-menu {
        width: 100%;
        border-radius: 15px 15px 0 0;
        padding-bottom: 0;
    }
    .nav-menu h2 {
        margin-bottom: 15px;
    }
    .nav-menu ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding-bottom: 15px;
    }
    .nav-menu ul li {
        margin: 5px;
    }
    .nav-menu ul li a {
        margin: 0;
        padding: 10px 15px;
        font-size: 0.9em;
    }
    .nav-menu ul li a i {
        margin-right: 10px;
        font-size: 1em;
    }
    .panel {
        border-radius: 0 0 15px 15px;
    }

    /* --- CAMBIO: 2 columnas en tablet --- */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .contenedor {
        max-width: 100%;
    }
    header h1 {
        font-size: 1.5em;
    }
    .panel {
        padding: 20px;
    }
    .panel h2 {
        font-size: 1.5em;
    }
    
    /* --- CAMBIO: 1 columna en móvil --- */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .dashboard-item {
        padding: 15px;
        min-height: 120px;
    }
    .dashboard-item i.fa-solid {
        font-size: 2.5em;
    }
    .dashboard-item h4 {
        font-size: 1em;
    }
}