/* Estilos generales */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navegación */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-brand i {
    margin-right: 0.5rem;
    color: #ffd700;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    font-weight: bold;
}

/* Botones */
.btn {
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* Examen específico */
.exam-container {
    max-width: 900px;
    margin: 0 auto;
}

.question-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 5px solid var(--secondary-color);
}

.question-text {
    font-size: 1.2rem;
    color: var(--dark-color);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Opciones */
.options-container {
    max-width: 800px;
}

.option-wrapper {
    transition: all 0.3s ease;
    border-radius: 10px;
    padding: 5px;
}

.option-wrapper:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateX(5px);
}

.option-wrapper.selected {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(46, 204, 113, 0.2) 100%);
    border: 2px solid var(--secondary-color);
}

.option-check {
    margin: 0;
}

.option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    line-height: 1.4;
    width: 100%;
    transition: all 0.2s ease;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
}

/* Input radio personalizado */
.form-check-input[type="radio"] {
    display: none;
}

.form-check-input[type="radio"]:checked + .option-label .option-letter {
    background: var(--success-color);
    transform: scale(1.1);
}

/* Timer */
.timer-display {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Progress bar */
.progress {
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.3);
}

.progress-bar {
    transition: width 0.6s ease;
    border-radius: 10px;
}

/* Pestañas de navegación */
.nav-tabs {
    border-bottom: 2px solid rgba(255,255,255,0.2);
    margin-bottom: 2rem;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 10px 10px 0 0;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    padding: 12px 20px;
    margin-right: 5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-tabs .nav-link:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: transparent;
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.nav-tabs .nav-link.active {
    background: white;
    color: var(--primary-color);
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    font-weight: 600;
}

.nav-tabs .nav-link.active:hover {
    transform: none;
    background: white;
    color: var(--primary-color);
}

.nav-tabs .nav-link i {
    margin-right: 8px;
}

/* Contenido de pestañas */
.tab-content {
    background: rgba(255,255,255,0.95);
    border-radius: 0 10px 10px 10px;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.tab-pane {
    padding: 2rem;
    min-height: 400px;
}

/* Resultados */
.result-container {
    max-width: 1000px;
    margin: 0 auto;
}

.tema-resultado {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.tema-resultado:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Preguntas incorrectas */
.accordion-button {
    border-radius: 10px 10px 0 0;
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e67e22 100%);
    color: white;
}

.accordion-body {
    background: rgba(255,255,255,0.95);
}

/* Resumen del examen */
.question-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.question-item {
    text-align: center;
}

.question-btn {
    width: 100%;
    min-height: 45px;
    font-weight: bold;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.question-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.question-btn:hover::before {
    left: 100%;
}

.question-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Administración */
.table-responsive {
    border-radius: 15px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Alertas */
.alert {
    border-radius: 15px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(46, 204, 113, 0.1) 100%);
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(230, 126, 34, 0.1) 100%);
    border-left: 4px solid var(--warning-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(192, 57, 43, 0.1) 100%);
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(52, 152, 219, 0.1) 100%);
    border-left: 4px solid var(--info-color);
}

/* Badges */
.badge {
    border-radius: 15px;
    padding: 8px 12px;
    font-weight: 600;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%) !important;
    margin-top: auto;
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        margin-bottom: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .option-label {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .option-letter {
        width: 30px;
        height: 30px;
        margin-right: 10px;
    }
    
    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }
    
    .question-btn {
        min-height: 40px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

/* Efectos especiales */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: confetti-fall 3s linear forwards;
    z-index: 9999;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Modo impresión */
@media print {
    body {
        background: white !important;
    }
    
    .navbar, .btn, footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .accordion-collapse {
        display: block !important;
    }
    
    .option-wrapper.selected {
        background: #e8f4f8 !important;
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Estilos para botones deshabilitados */
.btn:disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

.btn:disabled:hover {
    background: #6c757d !important;
    border-color: #6c757d !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Tooltip SOLO para botones deshabilitados */
.btn:disabled[title] {
    pointer-events: auto;
}

.btn:disabled[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.btn:disabled[title]:hover::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.8);
    z-index: 1000;
}

/* Prevenir tooltips en botones activos/habilitados */
.btn:not(:disabled)::after,
.btn:not(:disabled)::before {
    display: none !important;
    content: none !important;
}

.btn:not(:disabled)[title]:hover::after,
.btn:not(:disabled)[title]:hover::before {
    display: none !important;
    content: none !important;
}

/* Mejoras para botones de navegación */
.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    border: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    border: none;
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b02a37 0%, #8b1e2b 100%);
    border: none;
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    border: none;
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #545b62 0%, #3d4346 100%);
    border: none;
    color: white;
}

/* Panel de administración */
.admin-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 1rem;
}

.admin-panel h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Mejorar tarjetas en panel admin */
.admin-panel .card {
    background: rgba(255,255,255,0.98);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.admin-panel .card:hover {
    transform: none;
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.admin-panel .card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.admin-panel .card-body {
    padding: 1.5rem;
}

/* Tabla mejorada */
.admin-panel .table-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.admin-panel .table {
    margin-bottom: 0;
    background: white;
}

.admin-panel .table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.admin-panel .table tbody tr {
    transition: background-color 0.2s ease;
}

.admin-panel .table tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

/* Formularios en modales */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    border-radius: 15px 15px 0 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-title {
    font-weight: 600;
    color: var(--primary-color);
}

/* Badges personalizados */
.badge {
    font-size: 0.8em;
    padding: 0.5em 0.8em;
    border-radius: 20px;
}

/* Selectores mejorados */
.form-select:focus,
.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Botones del panel admin */
.admin-panel .btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.admin-panel .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Estilos para las preguntas en gestión */
#preguntas_lista .card {
    transition: all 0.3s ease;
}

#preguntas_lista .card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

#preguntas_lista .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
}

#preguntas_lista .badge {
    font-size: 0.9em;
    padding: 0.4em 0.7em;
}

/* Estilos para las opciones de respuesta */
#preguntas_lista .bg-success.bg-opacity-10 {
    background-color: rgba(25, 135, 84, 0.1) !important;
    border: 1px solid rgba(25, 135, 84, 0.3) !important;
}

#preguntas_lista .bg-light {
    border: 1px solid #e9ecef;
}

#preguntas_lista .text-success {
    color: #198754 !important;
}

/* Paginador personalizado */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    color: var(--secondary-color);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 0 3px;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    border-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pagination .page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    font-weight: 600;
}

/* Animación suave para scroll */
html {
    scroll-behavior: smooth;
}

/* Mejorar apariencia de los botones en las preguntas */
#preguntas_lista .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

#preguntas_lista .btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    border: none;
}

#preguntas_lista .btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
    border: none;
}

#preguntas_lista .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Pestañas de repaso de preguntas */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    color: #495057;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    margin-right: 0.5rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #2c3e50;
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: none;
}

.nav-tabs .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.nav-tabs .nav-link i {
    margin-right: 0.5rem;
}

/* Mejorar acordeones en las pestañas */
.tab-content .accordion-button {
    font-size: 0.95rem;
    padding: 1rem;
}

.tab-content .accordion-button:not(.collapsed) {
    background-color: #e7f3ff;
    color: #2c3e50;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.dark-mode-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sun-icon, .moon-icon {
    font-size: 1rem;
    transition: color 0.3s ease;
}

.sun-icon {
    color: #ffd700;
}

.moon-icon {
    color: #b8c6db;
}

/* Switch personalizado */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(184, 198, 219, 0.5);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e8e8e8;
}

body.dark-mode .navbar {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%) !important;
}

body.dark-mode .card {
    background: rgba(30, 30, 46, 0.95);
    color: #e8e8e8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .card-header {
    background: rgba(40, 40, 60, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}

body.dark-mode .hero-section {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

body.dark-mode .question-card {
    background: linear-gradient(145deg, rgba(30, 30, 46, 0.95) 0%, rgba(40, 40, 60, 0.95) 100%);
    border-left: 5px solid #4a90e2;
}

body.dark-mode .question-text {
    color: #e8e8e8;
}

body.dark-mode .option-wrapper:hover {
    background: rgba(74, 144, 226, 0.2);
}

body.dark-mode .option-wrapper.selected {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.3) 0%, rgba(46, 204, 113, 0.3) 100%);
    border: 2px solid #4a90e2;
}

body.dark-mode .option-label {
    color: #e8e8e8;
}

body.dark-mode .nav-tabs .nav-link {
    background: rgba(30, 30, 46, 0.8);
    color: rgba(232, 232, 232, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-tabs .nav-link:hover {
    background: rgba(40, 40, 60, 0.9);
    color: #e8e8e8;
}

body.dark-mode .nav-tabs .nav-link.active {
    background: #4a90e2;
    color: white;
}

body.dark-mode .tab-content {
    background: rgba(30, 30, 46, 0.95);
    color: #e8e8e8;
}

body.dark-mode .tab-pane {
    background: transparent;
}

body.dark-mode .table {
    background: rgba(30, 30, 46, 0.95);
    color: #e8e8e8;
}

body.dark-mode .table thead th {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    color: #e8e8e8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .table tbody tr:hover {
    background: rgba(74, 144, 226, 0.1);
}

body.dark-mode .modal-content {
    background: rgba(30, 30, 46, 0.98);
    color: #e8e8e8;
}

body.dark-mode .modal-header {
    background: rgba(40, 40, 60, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .modal-title {
    color: #e8e8e8;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: rgba(40, 40, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e8e8e8;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background: rgba(40, 40, 60, 0.9);
    border-color: #4a90e2;
    color: #e8e8e8;
}

body.dark-mode .form-control::placeholder {
    color: rgba(232, 232, 232, 0.5);
}

body.dark-mode .dropdown-menu {
    background: rgba(30, 30, 46, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .dropdown-item {
    color: #e8e8e8;
}

body.dark-mode .dropdown-item:hover {
    background: rgba(74, 144, 226, 0.2);
    color: #e8e8e8;
}

body.dark-mode .dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .accordion-button {
    background: rgba(40, 40, 60, 0.8);
    color: #e8e8e8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .accordion-button:not(.collapsed) {
    background: rgba(74, 144, 226, 0.3);
    color: #e8e8e8;
}

body.dark-mode .accordion-body {
    background: rgba(30, 30, 46, 0.95);
    color: #e8e8e8;
}

/* Contraste específico para el repaso post-examen */
body.dark-mode #preguntasTabsContent .accordion-item {
    background: rgba(30, 30, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.dark-mode #preguntasTabsContent .accordion-button {
    background: rgba(40, 40, 60, 0.9);
    color: #f2f4f8;
}

body.dark-mode #preguntasTabsContent .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(56, 94, 150, 0.95) 0%, rgba(43, 72, 115, 0.95) 100%) !important;
    color: #ffffff !important;
}

body.dark-mode #preguntasTabsContent .accordion-button strong,
body.dark-mode #preguntasTabsContent .accordion-button i {
    color: inherit;
}

body.dark-mode #preguntasTabsContent .accordion-body li.bg-light,
body.dark-mode #preguntasTabsContent .accordion-body .bg-light {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f0f2f6 !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

body.dark-mode #preguntas_container #preguntas_lista .bg-light {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f0f2f6 !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

body.dark-mode #preguntas_container #preguntas_lista .bg-success.bg-opacity-10.border-success {
    color: #f0f2f6 !important;
    border-color: rgba(39, 174, 96, 0.7) !important;
}

body.dark-mode .alert {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .alert-success {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2) 0%, rgba(46, 204, 113, 0.2) 100%);
    border-left: 4px solid var(--success-color);
    color: #e8e8e8;
}

body.dark-mode .alert-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.2) 0%, rgba(230, 126, 34, 0.2) 100%);
    border-left: 4px solid var(--warning-color);
    color: #e8e8e8;
}

body.dark-mode .alert-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2) 0%, rgba(192, 57, 43, 0.2) 100%);
    border-left: 4px solid var(--danger-color);
    color: #e8e8e8;
}

body.dark-mode .alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.2) 0%, rgba(52, 152, 219, 0.2) 100%);
    border-left: 4px solid var(--info-color);
    color: #e8e8e8;
}

body.dark-mode .admin-panel {
    background: linear-gradient(135deg, rgba(15, 52, 96, 0.3) 0%, rgba(22, 33, 62, 0.3) 100%);
}

body.dark-mode .admin-panel h1 {
    color: #e8e8e8;
}

body.dark-mode .admin-panel .card {
    background: rgba(30, 30, 46, 0.98);
    color: #e8e8e8;
}

body.dark-mode .admin-panel .card-header {
    background: rgba(40, 40, 60, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}

body.dark-mode .admin-panel .table thead th {
    background: linear-gradient(135deg, rgba(40, 40, 60, 0.9) 0%, rgba(30, 30, 46, 0.9) 100%);
    color: #e8e8e8;
}

body.dark-mode .sun-icon {
    color: #ffd700;
}

body.dark-mode .moon-icon {
    color: #4a90e2;
}

/* Dark mode para temarios resumen */
body.dark-mode .temario-enhanced .panel {
    background: rgba(40, 40, 60, 0.8);
    border-left-color: #4a90e2;
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced .zona {
    background: rgba(50, 50, 70, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced .box-warning {
    background: rgba(243, 156, 18, 0.2);
    border-left-color: #f39c12;
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced .box-info {
    background: rgba(23, 162, 184, 0.2);
    border-left-color: #17a2b8;
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced .concepto-tabla th {
    background: #4a90e2;
    color: white;
}

body.dark-mode .temario-enhanced .table {
    background: rgba(40, 40, 60, 0.8);
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced .table td,
body.dark-mode .temario-enhanced .table th {
    border-color: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced .table tbody tr:hover {
    background: rgba(74, 144, 226, 0.1);
}

body.dark-mode .temario-enhanced h3,
body.dark-mode .temario-enhanced h4,
body.dark-mode .temario-enhanced h5 {
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced p,
body.dark-mode .temario-enhanced li,
body.dark-mode .temario-enhanced td {
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced a {
    color: #4a90e2;
}

body.dark-mode .temario-enhanced a:hover {
    color: #6ba3e5;
}

body.dark-mode .temario-enhanced .text-muted {
    color: rgba(232, 232, 232, 0.6) !important;
}

body.dark-mode .temario-enhanced .small {
    color: rgba(232, 232, 232, 0.8);
}

/* Dark mode para clases adicionales de temarios resumen */
body.dark-mode .temario-enhanced .panel-index {
    background: rgba(40, 40, 60, 0.8);
    border-left-color: #4a90e2;
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced .def-item {
    background: rgba(50, 50, 70, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}

body.dark-mode .temario-enhanced .box-danger {
    background: rgba(220, 53, 69, 0.2);
    border-left-color: #dc3545;
    color: #e8e8e8;
}

/* Dark mode para tablas pequeñas en temarios */
body.dark-mode .temario-enhanced table.small th,
body.dark-mode .temario-enhanced table.small td {
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode para mini-iconos */
body.dark-mode .temario-enhanced .mini-icon {
    color: rgba(232, 232, 232, 0.8);
}

/* Dark mode para enlaces en temarios */
body.dark-mode .temario-enhanced a {
    color: #4a90e2;
    text-decoration: none;
}

body.dark-mode .temario-enhanced a:hover {
    color: #6ba3e5;
    text-decoration: underline;
}

/* Dark mode para página de examen */
body.dark-mode .card-header.bg-light {
    background: rgba(40, 40, 60, 0.8) !important;
    color: #e8e8e8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .card-header h4 {
    color: #e8e8e8;
}

body.dark-mode .card-header .text-primary {
    color: #4a90e2 !important;
}

/* Dark mode para badges en examen */
body.dark-mode .badge.bg-primary {
    background: #4a90e2 !important;
    color: white !important;
}

body.dark-mode .text-muted {
    color: rgba(232, 232, 232, 0.6) !important;
}

body.dark-mode .text-warning {
    color: #f39c12 !important;
}

body.dark-mode .timer-display {
    color: #e8e8e8;
}

/* Dark mode para progress bar en examen */
body.dark-mode .progress {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .progress-bar.bg-success {
    background: #27ae60 !important;
}

/* Dark mode para página de información de examen (/nuevo_examen) */
body.dark-mode .card.bg-light {
    background: rgba(40, 40, 60, 0.8) !important;
    color: #e8e8e8;
}

body.dark-mode .list-group-item.bg-light {
    background: rgba(50, 50, 70, 0.6) !important;
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .list-group-item {
    background: rgba(40, 40, 60, 0.8) !important;
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Corregir texto en criterios de aprobación */
body.dark-mode .bg-warning.bg-opacity-10 {
    background: rgba(243, 156, 18, 0.2) !important;
}

body.dark-mode .text-dark {
    color: #e8e8e8 !important;
}

/* Badges en modo oscuro */
body.dark-mode .badge.bg-warning.text-dark {
    background: #f39c12 !important;
    color: #000000 !important;
}

body.dark-mode .badge.bg-primary {
    background: #4a90e2 !important;
    color: white !important;
}

body.dark-mode .badge.bg-success {
    background: #27ae60 !important;
    color: white !important;
}

body.dark-mode .badge.bg-info {
    background: #17a2b8 !important;
    color: white !important;
}

/* Iconos en modo oscuro */
body.dark-mode .text-primary {
    color: #4a90e2 !important;
}

body.dark-mode .text-warning {
    color: #f39c12 !important;
}

body.dark-mode .text-success {
    color: #27ae60 !important;
}

body.dark-mode .text-danger {
    color: #e74c3c !important;
}

body.dark-mode .text-muted {
    color: rgba(232, 232, 232, 0.6) !important;
}

/* Dark mode para página principal (index.html) */
body.dark-mode .badge.bg-light.text-dark {
    background: rgba(40, 40, 60, 0.8) !important;
    color: #e8e8e8 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .card-header.bg-warning.text-dark {
    background: rgba(243, 156, 18, 0.8) !important;
    color: #000000 !important;
}

body.dark-mode .tema-card {
    background: rgba(40, 40, 60, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e8e8e8;
}

body.dark-mode .tema-card:hover {
    background: rgba(50, 50, 70, 0.9) !important;
    border-color: #f39c12;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .tema-card .card-title {
    color: #e8e8e8;
}

body.dark-mode .tema-card .text-primary {
    color: #4a90e2 !important;
}

body.dark-mode .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.3);
    color: #e8e8e8;
}

body.dark-mode .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #e8e8e8;
    color: #e8e8e8;
}

body.dark-mode .btn-outline-primary {
    border-color: #4a90e2;
    color: #4a90e2;
}

body.dark-mode .btn-outline-primary:hover {
    background: #4a90e2;
    border-color: #4a90e2;
    color: white;
}

/* Dark mode para hero section */
body.dark-mode .hero-section {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%) !important;
}

body.dark-mode .text-light {
    color: #e8e8e8 !important;
}

body.dark-mode .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: #e8e8e8;
}

body.dark-mode .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #e8e8e8;
    color: #e8e8e8;
}

/* Transiciones suaves para dark mode */
body, .card, .navbar, .hero-section, .question-card, .nav-tabs .nav-link, 
.tab-content, .table, .modal-content, .accordion-button, .alert, .admin-panel .card,
.temario-enhanced .panel, .temario-enhanced .zona, .temario-enhanced .box-warning,
.temario-enhanced .box-info, .temario-enhanced .table {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
}
/* ===== FIX: Tablas Striped en Modo Oscuro ===== */
/* Problema: Bootstrap 5.1.3 aplica background-color: rgba(0, 0, 0, 0.05) a las filas impares
   lo que es casi invisible sobre fondos oscuros */

/* Fix completo para tablas striped en modo oscuro */
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(74, 144, 226, 0.15) !important;
    color: #ffffff !important;
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) td,
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) th {
    color: #ffffff !important;
}

/* Para todas las filas de tablas en modo oscuro */
body.dark-mode .table td,
body.dark-mode .table th {
    color: #e8e8e8 !important;
}

/* Para tablas dentro de la clase temario-enhanced */
body.dark-mode .temario-enhanced .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(74, 144, 226, 0.12) !important;
}

body.dark-mode .temario-enhanced .table-striped > tbody > tr:nth-of-type(odd) td,
body.dark-mode .temario-enhanced .table-striped > tbody > tr:nth-of-type(odd) th {
    color: #ffffff !important;
}

/* Para todas las tablas en temarios */
body.dark-mode .temario-enhanced .table td,
body.dark-mode .temario-enhanced .table th {
    color: #e8e8e8 !important;
}

/* Para filas pares también aseguramos buen contraste */
body.dark-mode .table-striped > tbody > tr:nth-of-type(even) {
    background-color: transparent !important;
}

body.dark-mode .temario-enhanced .table-striped > tbody > tr:nth-of-type(even) {
    background-color: transparent !important;
}
