/**
 * tema-claro-global.css
 * 
 * Tema claro global para mejorar la visualización de la aplicación.
 * Este archivo define variables CSS y estilos base para asegurar
 * fondos claros con texto oscuro en toda la aplicación.
 */

:root {
    /* Colores de fondo - Tonos claros */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --bg-accent-light: #e8f4fc;
    --bg-success-light: #e8f5e9;
    --bg-warning-light: #fff8e1;
    --bg-error-light: #ffebee;
    --bg-info-light: #e3f2fd;
    
    /* Colores de texto - Tonos oscuros */
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;
    
    /* Colores de acento */
    --accent-primary: #3498db;
    --accent-secondary: #2ecc71;
    --accent-warning: #f39c12;
    --accent-error: #e74c3c;
    --accent-info: #17a2b8;
    
    /* Bordes */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* Sombras suaves */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ===== ESTILOS BASE ===== */

/* Cuerpo de la página */
body {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Contenedores principales */
.container,
.main-content,
.page-content {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Cards y paneles */
.card,
.panel,
.box,
.widget {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-light);
}

/* Headers de sección con fondos claros */
.section-header,
.card-header,
.panel-header {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* ===== TOOLTIPS ===== */
/* Tooltips con fondo claro en lugar de oscuro */
.tooltip .tooltip-text,
.tooltip-content,
[data-tooltip]::after {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-md);
}

.tooltip .tooltip-text::after {
    border-color: var(--bg-primary) transparent transparent transparent !important;
}

/* ===== MODALES ===== */
/* Overlay de modales más claro */
.modal-overlay,
.modal-backdrop,
.overlay {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(4px);
}

/* Contenido de modales */
.modal-content,
.modal-body,
.modal-dialog {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* ===== NOTIFICACIONES ===== */
/* Notificaciones con fondos claros */
.notification,
.alert,
.toast {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-left: 4px solid var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.notification.success,
.alert-success {
    background-color: var(--bg-success-light) !important;
    color: #155724 !important;
    border-left-color: var(--accent-secondary) !important;
}

.notification.error,
.alert-danger {
    background-color: var(--bg-error-light) !important;
    color: #721c24 !important;
    border-left-color: var(--accent-error) !important;
}

.notification.warning,
.alert-warning {
    background-color: var(--bg-warning-light) !important;
    color: #856404 !important;
    border-left-color: var(--accent-warning) !important;
}

.notification.info,
.alert-info {
    background-color: var(--bg-info-light) !important;
    color: #0c5460 !important;
    border-left-color: var(--accent-info) !important;
}

/* ===== LOADING Y OVERLAYS ===== */
/* Pantallas de carga con fondo claro */
.loading-overlay,
.loading-screen {
    background-color: rgba(248, 249, 250, 0.95) !important;
}

.loading-text,
.loading-message {
    color: var(--text-primary) !important;
}

/* ===== TABLAS ===== */
/* Encabezados de tabla con fondo claro */
table thead,
table th {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

table tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

table tbody tr:hover {
    background-color: var(--bg-accent-light);
}

/* ===== FORMULARIOS ===== */
/* Inputs y selects con fondo claro */
input,
textarea,
select,
.form-control {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-light);
}

input:focus,
textarea:focus,
select:focus,
.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ===== BOTONES ===== */
/* Botón base con gradiente para asegurar visibilidad */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

.btn:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%) !important;
    transform: translateY(-2px);
}

/* Botones primarios con buen contraste */
.btn-primary {
    background-color: var(--accent-primary) !important;
    color: #ffffff !important;
    border: none;
}

.btn-primary:hover {
    background-color: #2980b9 !important;
}

/* Botones secundarios/outline */
.btn-secondary,
.btn-outline {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium) !important;
}

.btn-secondary:hover,
.btn-outline:hover {
    background-color: var(--bg-tertiary) !important;
}

/* ===== CÓDIGO Y PRE ===== */
/* Bloques de código con fondo claro */
pre,
code,
.code-block {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-light);
}

/* ===== BADGES Y TAGS ===== */
/* Badges con fondos claros - excepto badges especiales con gradientes */
.badge:not(.collection-badge):not(.evaluation-badge):not(.competency-badge):not(.methodology-tag):not(.level-tag):not(.question-count):not(.entity-tag):not(.dimension-badge),
.tag:not(.collection-badge):not(.evaluation-badge):not(.competency-badge):not(.methodology-tag):not(.level-tag):not(.question-count):not(.entity-tag):not(.dimension-badge),
.label:not(.collection-badge):not(.evaluation-badge):not(.competency-badge):not(.methodology-tag):not(.level-tag):not(.question-count):not(.entity-tag):not(.dimension-badge) {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.badge-primary {
    background-color: var(--bg-info-light) !important;
    color: #0c5460 !important;
}

.badge-success {
    background-color: var(--bg-success-light) !important;
    color: #155724 !important;
}

.badge-warning {
    background-color: var(--bg-warning-light) !important;
    color: #856404 !important;
}

.badge-danger {
    background-color: var(--bg-error-light) !important;
    color: #721c24 !important;
}

/* ===== DROPDOWNS ===== */
/* Menús desplegables con fondo claro */
.dropdown-menu,
.dropdown-content {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
}

.dropdown-item:hover {
    background-color: var(--bg-accent-light) !important;
}

/* ===== SIDEBAR Y NAVEGACIÓN ===== */
/* Barras laterales con fondo claro */
.sidebar,
.nav-sidebar {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* ===== PROGRESS BARS ===== */
/* Barras de progreso con fondo claro */
.progress,
.progress-bar-container {
    background-color: var(--bg-tertiary) !important;
}

/* ===== TUTORIAL Y AYUDA ===== */
/* Overlays de tutoriales más claros */
.tutorial-overlay {
    background-color: rgba(248, 249, 250, 0.9) !important;
}

.tutorial-modal,
.tutorial-popup {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* ===== ESTADOS VACÍOS ===== */
/* Estados de "sin datos" con fondo claro */
.empty-state,
.no-data,
.no-results {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* ===== UTILITY CLASSES ===== */
/* Clases utilitarias para forzar tema claro */
.bg-light-force {
    background-color: var(--bg-primary) !important;
}

.bg-secondary-force {
    background-color: var(--bg-secondary) !important;
}

.text-dark-force {
    color: var(--text-primary) !important;
}

.text-secondary-force {
    color: var(--text-secondary) !important;
}

/* ===== SCROLL Y SCROLLBAR ===== */
/* Scrollbar con colores claros */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== SELECCIÓN DE TEXTO ===== */
::selection {
    background-color: rgba(52, 152, 219, 0.2);
    color: var(--text-primary);
}

/* ===== PLACEHOLDERS ===== */
::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ===== LINKS ===== */
a {
    color: var(--accent-primary);
}

a:hover {
    color: #2980b9;
}

/* ===== OVERRIDE PARA GRADIENTES OSCUROS ===== */
/* Convierte gradientes oscuros a claros donde sea posible */
.dark-gradient,
[style*="linear-gradient"][style*="#1"],
[style*="linear-gradient"][style*="#2"],
[style*="linear-gradient"][style*="#3"] {
    color: var(--text-primary) !important;
}

/* ===== MEJORAS PARA MÓVIL ===== */
@media (max-width: 768px) {
    body {
        background: #f5f7fa !important;
        color: #1a1a1a !important;
    }
    
    /* Asegurar fondos blancos en elementos principales */
    .card,
    .container,
    .question-container,
    .option-item,
    .evaluation-card,
    .stat-card,
    .result-item {
        background: #ffffff !important;
        color: #1a1a1a !important;
    }
    
    /* Formularios legibles */
    input,
    select,
    textarea,
    .form-control {
        background: #ffffff !important;
        color: #1a1a1a !important;
        border-color: #d1d5db !important;
    }
    
    /* Títulos y textos siempre oscuros */
    h1, h2, h3, h4, h5, h6,
    p, span, label {
        color: #1a1a1a !important;
    }
    
    /* Excepciones: botones con fondo de color mantienen texto blanco */
    .btn-primary,
    .btn-success,
    .btn-danger,
    .btn-warning,
    [class*="btn-"]:not(.btn-outline):not(.btn-light) {
        color: #ffffff !important;
    }
    
    /* Headers y badges con color específico */
    /* Badge colors are defined earlier in the file */
}

/* ===== BOTONES CON CONTRASTE GARANTIZADO ===== */
/* 
 * Sistema de contraste automático para botones:
 * - Fondo oscuro = texto blanco
 * - Fondo claro = texto oscuro
 */

/* Botones primarios - Fondo oscuro, texto blanco */
.btn-primary,
button.btn-primary,
a.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    color: #ffffff !important;
    border: none !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9 0%, #1f6dad 100%) !important;
    color: #ffffff !important;
}

.btn-primary:disabled {
    background: #9ca3af !important;
    color: #ffffff !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Botones de éxito - Fondo verde, texto blanco */
.btn-success,
button.btn-success,
a.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
    color: #ffffff !important;
    border: none !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%) !important;
    color: #ffffff !important;
}

.btn-success:disabled {
    background: #9ca3af !important;
    color: #ffffff !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Botones secundarios - Fondo gris OSCURO, texto blanco */
.btn-secondary,
button.btn-secondary,
a.btn-secondary {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%) !important;
    color: #ffffff !important;
    border: none !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #495057 0%, #3d4349 100%) !important;
    color: #ffffff !important;
}

.btn-secondary:disabled {
    background: #adb5bd !important;
    color: #495057 !important;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Botones outline/light - Fondo claro, texto oscuro */
.btn-outline,
.btn-light,
.btn-outline-primary,
.btn-outline-secondary {
    background: #ffffff !important;
    color: #1a1a2e !important;
    border: 2px solid #d1d5db !important;
}

.btn-outline:hover,
.btn-light:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    background: #f3f4f6 !important;
    color: #1a1a2e !important;
    border-color: #9ca3af !important;
}

/* Botones de peligro/danger - Fondo rojo, texto blanco */
.btn-danger,
button.btn-danger,
a.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
    color: #ffffff !important;
}

/* Botones de advertencia - Fondo amarillo, texto OSCURO */
.btn-warning,
button.btn-warning,
a.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    color: #1a1a2e !important;
    border: none !important;
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%) !important;
    color: #1a1a2e !important;
}

/* Botones info - Fondo azul claro, texto oscuro */
.btn-info,
button.btn-info,
a.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

/* Estado disabled global para todos los botones */
button:disabled,
.btn:disabled,
[disabled] {
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* Asegurar que botones con fondo claro (beige, gris claro) tengan texto oscuro */
button[style*="background: #e"],
button[style*="background: #f"],
button[style*="background: #d"],
button[style*="background-color: #e"],
button[style*="background-color: #f"],
button[style*="background-color: #d"],
.btn[style*="background: #e"],
.btn[style*="background: #f"],
.btn[style*="background: #d"] {
    color: #1a1a2e !important;
}

/* Asegurar que botones con fondo oscuro tengan texto blanco */
button[style*="background: #1"],
button[style*="background: #2"],
button[style*="background: #3"],
button[style*="background: #4"],
button[style*="background: #5"],
button[style*="background-color: #1"],
button[style*="background-color: #2"],
button[style*="background-color: #3"],
button[style*="background-color: #4"],
button[style*="background-color: #5"] {
    color: #ffffff !important;
}
