/**
 * FORZAR MODO CLARO - Academia de Méritos
 * Deshabilita el modo oscuro del sistema en todos los formularios
 * Solo estilos de día para evitar conflictos
 */

/* === FORZAR ESQUEMA DE COLORES CLARO === */
:root {
    color-scheme: light only !important;
}

html {
    color-scheme: light only !important;
}

/* === CUANDO EL SISTEMA ESTÁ EN MODO OSCURO, FORZAR MODO CLARO === */
@media (prefers-color-scheme: dark) {
    
    /* Raíz y documento */
    :root, html {
        color-scheme: light only !important;
    }
    
    /* Body principal */
    body {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
    
    /* Contenedores principales */
    .container, .main-content, .content,
    .card, .panel, .box, .section,
    .modal-content, .popup-content, .overlay-content,
    .questionnaire-container, .form-container {
        background-color: #ffffff !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    /* Headers y navegación */
    .header, .navbar, .nav, header {
        color: inherit !important;
    }
    
    /* Títulos */
    h1, h2, h3, h4, h5, h6 {
        color: #212529 !important;
    }
    
    /* Texto */
    p, span, div, li, a, label, small {
        color: inherit !important;
    }
    
    /* Tablas */
    table, th, td, tr {
        background-color: #ffffff !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    /* Formularios */
    input, select, textarea, .form-control, .form-select {
        background-color: #ffffff !important;
        color: #212529 !important;
        border-color: #ced4da !important;
    }
    
    input::placeholder, textarea::placeholder {
        color: #6c757d !important;
    }
    
    /* Botones secundarios */
    .btn-secondary, .btn-outline, .btn-light {
        background-color: #f8f9fa !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    /* Dropdowns */
    .dropdown-menu, .dropdown-item {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    /* Tarjetas de competencias */
    .competencia-card, .question-card, .step-card {
        background-color: #ffffff !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    .competencia-card h3, .competencia-nombre {
        color: #212529 !important;
    }
    
    .competencia-card p, .competencia-definicion {
        color: #495057 !important;
    }
    
    /* Opciones de respuesta */
    .option, .option-wrapper, .option-label, .option-item {
        background-color: #ffffff !important;
        background: #ffffff !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    .option-text, .option span, .option-label span {
        color: #212529 !important;
    }
    
    /* Question container structured */
    .question-container, .question-container.structured {
        background-color: #ffffff !important;
        background: #ffffff !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    .question-container .question-title,
    .question-container .question-text,
    .question-container .question-number,
    .question-container h3 {
        color: #212529 !important;
    }
    
    .question-container p, .question-container span {
        color: #333333 !important;
    }
    
    /* Structured questionnaire */
    .structured-questionnaire {
        background: transparent !important;
    }
    
    /* Caso de estudio - mantener su gradiente original */
    .caso-estudio-container, .caso-estudio,
    #caso-estudio-container, #caso-estudio-principal {
        /* No sobrescribir - mantener estilos originales */
        color: inherit !important;
    }
    
    /* Historial */
    .historial-item, .history-item, .evaluation-item {
        background-color: #ffffff !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    /* AI Providers */
    .ai-provider, .provider-card {
        background-color: #ffffff !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    /* Tabs */
    .tab, .nav-tab, .tab-btn {
        background-color: #f8f9fa !important;
        color: #495057 !important;
        border-color: #dee2e6 !important;
    }
    
    .tab.active, .nav-tab.active, .tab-btn.active {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    /* Alertas - mantener colores originales */
    .alert-info {
        background-color: #cfe2ff !important;
        color: #084298 !important;
    }
    
    .alert-success {
        background-color: #d1e7dd !important;
        color: #0f5132 !important;
    }
    
    .alert-warning {
        background-color: #fff3cd !important;
        color: #664d03 !important;
    }
    
    .alert-danger {
        background-color: #f8d7da !important;
        color: #842029 !important;
    }
    
    /* Progress bars */
    .progress {
        background-color: #e9ecef !important;
    }
    
    /* Badges */
    .badge {
        color: inherit !important;
    }
    
    /* Modales */
    .modal-header, .modal-body, .modal-footer {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    /* Código */
    code, pre {
        background-color: #f8f9fa !important;
        color: #d63384 !important;
    }
    
    /* Scrollbar - mantener clara */
    ::-webkit-scrollbar-track {
        background: #f8f9fa !important;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #dee2e6 !important;
    }
    
    /* Topic cards y Analysis cards */
    .topic-card, .analysis-card, .cv-card {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    .topic-card *, .analysis-card *, .cv-card * {
        color: inherit !important;
    }
    
    .topic-title, .topic-name, .cv-name {
        color: #212529 !important;
    }
    
    .topic-content, .topic-content p {
        color: #495057 !important;
    }
    
    /* Analysis sections */
    .analysis-section {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    /* Loading, empty, error states */
    .loading-state, .empty-state, .error-state {
        background: #f8f9fa !important;
        background-color: #f8f9fa !important;
        color: #495057 !important;
    }
    
    /* ALL divs with dark backgrounds - force light */
    [style*="background: #2"], [style*="background:#2"],
    [style*="background: #1"], [style*="background:#1"],
    [style*="background: #3"], [style*="background:#3"],
    [style*="background-color: #2"], [style*="background-color:#2"],
    [style*="background-color: #1"], [style*="background-color:#1"],
    [style*="background-color: #3"], [style*="background-color:#3"] {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    /* Texts that might be light colored */
    [style*="color: #e"], [style*="color:#e"],
    [style*="color: #f"], [style*="color:#f"],
    [style*="color: white"], [style*="color:white"],
    [style*="color: #9"], [style*="color:#9"],
    [style*="color: #a"], [style*="color:#a"],
    [style*="color: #b"], [style*="color:#b"],
    [style*="color: #c"], [style*="color:#c"],
    [style*="color: #d"], [style*="color:#d"] {
        color: #212529 !important;
    }
}

/* === CORRECCIONES PARA MODO OSCURO EN MÓVIL === */
/* Solo aplicar cuando el sistema está en modo oscuro */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    /* Forzar colores legibles en todos los textos en móvil con modo oscuro */
    body, html {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
    
    /* Inputs y formularios siempre claros */
    input, select, textarea, .form-control {
        background-color: #ffffff !important;
        color: #212529 !important;
        border: 1px solid #ced4da !important;
        -webkit-text-fill-color: #212529 !important;
    }
    
    input::placeholder, textarea::placeholder {
        color: #6c757d !important;
        -webkit-text-fill-color: #6c757d !important;
        opacity: 1 !important;
    }
    
    /* Labels siempre visibles */
    label {
        color: #212529 !important;
    }
    
    /* Tarjetas de proveedor de IA */
    .ai-provider, .ai-provider-selector > div {
        background: #ffffff !important;
        color: #212529 !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .ai-provider.selected {
        border-color: #0d6efd !important;
        background: #e7f1ff !important;
    }
    
    /* Cajas de información */
    .info-box, .info-container {
        background-color: #e8f4fd !important;
        color: #0c5460 !important;
        border-color: #bee5eb !important;
    }
    
    /* Contenedor de carga */
    .loading-overlay, .loading-container {
        background: rgba(255, 255, 255, 0.95) !important;
        color: #212529 !important;
    }
    
    /* BOTÓN DE GOOGLE - FORZAR MODO CLARO */
    .btn-google {
        background-color: #ffffff !important;
        color: #333333 !important;
        border: 1px solid #dadce0 !important;
    }
    
    .btn-google:hover,
    .btn-google:focus,
    .btn-google:active {
        background-color: #f5f5f5 !important;
        color: #333333 !important;
    }
    
    /* Icono de Google */
    .btn-google .google-icon {
        background: none !important;
    }
    
    .btn-google .google-icon:before {
        background: conic-gradient(from 90deg, #4285f4 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75%) !important;
    }
    
    .btn-google .google-icon:after {
        background: white !important;
    }
}