/* Estilos generales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f7f9fc;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 16px;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 15px auto;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-top: 0;
    font-size: 1.5rem;
}

/* Barra de navegación */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.navbar .container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 10px;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    padding: 5px 0;
    text-align: center;
}

.nav-links {
    display: flex;
    justify-content: space-around;
    width: 100%;
}

.nav-link {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 5px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.8rem;
    text-align: center;
    flex: 1;
    margin: 0 2px;
}

.nav-link i {
    margin-right: 3px;
    font-size: 0.9rem;
}

/* Test cards */
.test-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fdfdfd;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.test-card h2 {
    margin: 0 0 10px;
    font-size: 1.2em;
    color: #2c3e50;
    word-break: break-word;
}

.test-header-flex {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.test-header-flex h2 {
    margin: 0;
    font-size: 1.2em;
    color: #2c3e50;
    word-break: break-word;
}

.test-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.test-actions a {
    padding: 8px 12px;
    border-radius: 4px;
    background-color: #f0f0f0;
    text-decoration: none;
    color: #2980b9;
    font-weight: 500;
    text-align: center;
    font-size: 0.9rem;
}

.test-stats-header {
    display: flex;
    flex-direction: row;
    gap: 18px;
    font-size: 1.1em;
    align-items: center;
    color: #444;
    min-width: 180px;
    justify-content: flex-end;
}

.test-stats-header-badge {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    min-width: 220px;
    justify-content: flex-end;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.98em;
    font-weight: 500;
    background: #e9ecef;
    color: #333;
    margin-left: 2px;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    letter-spacing: 0.01em;
}
.badge.attempts {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #90caf9;
}
.badge.avg {
    background: #e8f5e9;
    color: #388e3c;
    border-color: #a5d6a7;
}
.badge.date {
    background: #fff3e0;
    color: #f57c00;
    border-color: #ffcc80;
}

.sidebar {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #ccc;
    text-align: center;
}

/* Preguntas y opciones */
.question-block {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.option-label {
    cursor: pointer;
    user-select: none;
    display: block;
    padding: 8px 0;
    font-size: 0.95rem;
}

/* Botones */
.submit-btn {
    background-color: #2980b9;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 5px 0;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #1b5f91;
}

.button {
    padding: 10px 15px;
    background-color: #2980b9;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    margin: 5px 0;
    text-align: center;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

.button:hover {
    background-color: #1b5f91;
}

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

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

.button-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Temporizador */
#timer {
    position: fixed;
    top: 60px;
    right: 10px;
    background-color: #f8f8f8;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-weight: bold;
    z-index: 1000;
    font-size: 0.9rem;
}

/* Tablas */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    font-size: 0.85rem;
}

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

th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Preguntas falladas */
.filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
    justify-content: center;
}

.filtro-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #e0e0e0;
    transition: all 0.3s;
    font-size: 0.85rem;
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.filtro-btn.active {
    background-color: #3498db;
    color: white;
}

.pregunta-container {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    font-size: 0.95rem;
}

.pregunta-text {
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 1rem;
}

.opcion {
    padding: 8px 10px;
    margin: 5px 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.metadata {
    margin-top: 12px;
    font-size: 0.85em;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
}

/* Botones de revisión mejorados */
.revisada-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    font-size: 0.85rem;
    justify-content: center;
    width: 100%;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.revisada-btn.revisada {
    background-color: #27ae60; /* Verde más intenso */
    color: white;
    border: 2px solid #219653; /* Borde más oscuro */
}

.revisada-btn.revisada:hover {
    background-color: #219653;
}

.revisada-btn.no-revisada {
    background-color: #f39c12; /* Naranja más intenso */
    color: white;
    border: 2px solid #e67e22; /* Borde más oscuro */
}

.revisada-btn.no-revisada:hover {
    background-color: #e67e22;
}

.estado-tag {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 8px;
}

/* Modal de detalles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 20% auto;
    padding: 15px;
    border: 1px solid #888;
    width: 95%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
}

.close {
    position: absolute;
    top: 5px;
    right: 10px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

/* Estilos para las opciones del modal */
#modalQuestionOptions .correct-option {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
}

#modalQuestionOptions .selected-option:not(.correct-option) {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
}

#modalQuestionOptions .option {
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Media queries para tablets */
@media (min-width: 600px) {
    .navbar .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }

    .nav-brand {
        padding: 0;
        text-align: left;
        flex: 1;
    }

    .nav-links {
        justify-content: flex-end;
        width: auto;
        gap: 10px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
        flex: none;
    }

    .button-container {
        flex-direction: row;
    }

    .button {
        width: auto;
    }

    .test-actions {
        flex-direction: row;
    }

    .test-actions a {
        width: auto;
    }

    .submit-btn {
        width: auto;
    }

    .filtro-btn {
        flex: none;
    }

    .revisada-btn {
        width: auto;
        padding: 8px 15px;
    }
}

/* Media queries para desktop */
@media (min-width: 900px) {
    body {
        font-size: 17px;
    }

    .container {
        padding: 20px 25px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .nav-link {
        font-size: 1rem;
        padding: 10px 15px;
    }

    .nav-brand {
        font-size: 1.4rem;
    }

    table {
        font-size: 0.95rem;
    }

    th, td {
        padding: 12px 15px;
    }

    .pregunta-container {
        padding: 15px;
    }

    .modal-content {
        padding: 20px;
    }
}

.tests-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Dashboard compacto */
.dashboard-compact {
    padding: 10px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #ffffff, #fbfdff);
    border: 1px solid #e6eef8;
    border-radius: 8px;
}
.dashboard-line {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}
.dashboard-text {
    font-weight: 700;
    color: #2c3e50;
    margin-right: 10px;
}
.dashboard-stats {
.dashboard-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1 1 auto;
    justify-content: flex-start;
    font-size: 0.95rem;
    color: #34495e;
}

/* Stat box (number above label) compact single row */
.compact-row { display: flex; gap: 14px; align-items: center; }
.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e9f0fb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.stat-number {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1f618d;
    line-height: 1;
}
.stat-label {
    font-size: 0.78rem;
    color: #6b7a8a;
    margin-top: 4px;
    text-align: center;
}
.dashboard-actions { flex: 0 0 auto; }
.dashboard-chart { width: 100%; }
.dashboard-chart canvas { max-width: 100%; height: 160px !important; }

@media (max-width: 700px) {
    .compact-row { overflow-x: auto; padding-bottom: 6px; }
    .stat-box { min-width: 100px; }
}

.test-card.test-flex {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.test-main {
    flex: 1 1 60%;
}

.test-stats {
    flex: 0 0 220px;
    text-align: right;
    font-size: 0.95em;
    color: #444;
    background: none;
    padding: 0 10px;
    border-left: 1px solid #eee;
    min-width: 150px;
}

.test-stats p {
    margin: 4px 0;
}

@media (max-width: 700px) {
    .test-card.test-flex {
        flex-direction: column;
        align-items: stretch;
    }
    .test-stats {
        border-left: none;
        border-top: 1px solid #eee;
        text-align: left;
        margin-top: 10px;
        padding: 10px 0 0 0;
    }
}
