/* Estilos generales */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

/* Encabezado responsivo */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    position: relative;
}

.logo img {
    height: 40px;
}

.title {
    flex-grow: 1;
    margin-right: 60px;
    text-align: center;
}

.title h2 {
    font-size: 1.5rem;
}

/* Contenedor principal */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 20px;
}

/* Cuadrícula flexible */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    grid-auto-rows: 80px;
    gap: 10px;
    width: 100%;
    max-width: 600px;
    place-items: center;
    margin: 0 auto;
}

.button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 1.5em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: none;
}

.button:hover {
    transform: scale(1.05);
}

/* Página de preguntas */
.question-page {
    width: 90%;
    max-width: 800px;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.question-page #questionText {
    font-size: xx-large;
    margin-top: 20px;
}

.question-page #timer {
    text-align: center;
    margin: 10px 0px;
    font-weight: bold;
}

.question-page #options {
    text-align: center;
    margin-top: 20px;
}

.question-page #answerText {
    font-size: xx-large;
    margin-top: 20px;
}

.question-page img {
    max-width: 100%;
    height: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

.question-page button {
    margin: 10px;
    padding: 10px 20px;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.question-page #answerOptions button {
    background-color: transparent;
    border: 1px solid gray;
    color: #333333;
}

.question-page #answerOptions {
    margin-bottom: 10px;
}

.question-page #correctAnswer:hover {
    background-color: #d4edda;
    border: 1px solid #d4edda;
    color: #155724;
}

.question-page #wrongAnswer:hover {
    background-color: #f8d7da;
    border: 1px solid #f8d7da;
    color: #721c24;
}

.score-page #scoreOptions {
    text-align: center;
    margin-top: 20px;
}

/* Pie de página */
.footer {
    padding: 10px;
    text-align: center;
}

.footer p {
    margin: 3px 3px;
}

/* Contenedor del login */
.login-container {
    background-color: #f0f0f0;
}

/* Caja del formulario */
.login-box {
    background-color: white;
    padding: 25px 25px 60px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-top: 5px;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.login-box button {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.login-box button:hover {
    background-color: #0056b3;
}

.login-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 400px;
    margin: auto;
    justify-content: center;
}

.login-row .error-message {
    padding: 10px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    margin-bottom: 15px; /* Agrega margen inferior para separarlo del login-container */
    text-align: center; /* Centra el texto del mensaje de error */
    width: 100%; /* Ocupa el ancho completo del login-row */
    box-sizing: border-box; /* Incluye el padding en el ancho */
}

/* Responsividad */
@media (max-width: 480px) {
    .login-box {
        padding: 20px;
    }
    
    .login-box h2 {
        font-size: 1.2rem;
    }
    
    .form-group input {
        padding: 8px;
    }
    
    .login-box button {
        padding: 10px;
    }
}

/***********/
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    width: 100%;
    padding: 10px 20px;
    margin: 0 auto;
}

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

.dropdown {
    position: relative;
    display: inline-block;
}
  
.dropdown-toggle {
    background-color: transparent;
    color: #000000;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.dropdown-toggle:hover {
    background-color: #ddd;
}
  
.menu-icon {
    width: 24px;
    height: 24px;
    fill: #000000;
}
  
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #f9f9f9;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 3;
    list-style: none;
    padding: 6px 0px 6px;
    margin: 0;
    border-radius: 5px;
    display: none;
}
  
.dropdown-menu li a {
    color: #000000;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
}
  
.dropdown-menu li a:hover {
    background-color: #ddd;
}

.message-box {
    display: none;
    padding: 10px;
    background-color: #dff0d8;
    border: 1px solid #b2dba1;
    margin-bottom: 15px;
}

.form-container, .table-container {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

#addQuestionForm {
    margin: 0px auto 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#addQuestionForm .form-group textarea {
    width: 98%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-width: 1142.4px;
    height: 70px;
}

#addQuestionForm .form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-width: 350px;
}

#addUserSection {
    margin: 0px auto 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#addUserSection .form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-width: 350px;
}

#addUserSection .form-group #isAdmin {
    width: unset;
    margin-right: 10px;
}

#addQuestionForm .form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-width: 160px;
}

button {
    background-color: #007BFF;
    font-size: 1rem;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background-color: #0056b3;
}

.delete-button {
    background-color: #dc3545;
}

.delete-button:hover {
    background-color: #c82333;
}

.admin-actions {
    margin: 0px auto 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-container {
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Tablas responsivas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
}

tr:hover {
    background-color: #f5f5f5;
}

.admin-container tr td:nth-child(4) {
    min-width: 79px;
}

.admin-container tr td:last-child {
    min-width: 165px;
}

#scorePage tr td {
    min-width: 100px;
}

/* Estilos para el modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 50%;
    max-width: 600px;
}

.edit-users .modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 50%;
    max-width: 400px;
}

#editModal .form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-width: 582.4px;
    height: 70px;
}

#editModal .form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-width: 350px;
}

.edit-users .form-group input {
    max-width: 100% !important;
}

#editModal .form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-width: 160px;
}

#editModal .form-group #editIsAdmin {
    width: unset;
    margin-right: 10px;
}

.edit-question-form .form-group:nth-child(4) {
    display: flex;
    align-items: center;
    gap: 10px;
}

#deleteImageButton {
    background-color: #dc3545;
}

#deleteImageButton:hover {
    background-color: #c82333;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: red;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .logo img {
        height: 35px;
    }

    .title h2 {
        font-size: 1rem;
    }

    .title {
        margin-left: unset;
    }

    .title h2 {
        margin-top: 10px;
        font-size: 1rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .title {
        display: none;
    }

    .question-page {
        padding: 15px;
    }

    .footer p {
        font-size: 0.9rem;
    }
}