﻿/* ========================================
   CORRECCIONES DE VISIBILIDAD - MODO CLARO
   ======================================== */

/* ========== VARIABLES ADICIONALES PARA MODO CLARO ========== */
:root {
    --text-light-primary: #1e293b;
    --text-light-secondary: #475569;
    --bg-light-card: #ffffff;
    --bg-light-hover: #f8f9fa;
}

/* ========== MEJORAS GENERALES DE TEXTO EN MODO CLARO ========== */
body.light-theme {
    color: var(--text-light-primary) !important;
}

    /* ========== HEADER ========== */
    body.light-theme .header-title {
        background: linear-gradient(135deg, #1e293b, #475569);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    /* ========== DROPDOWN DEL PERFIL ========== */
    body.light-theme .dropdown-user-details h3 {
        color: var(--text-light-primary) !important;
    }

    body.light-theme .dropdown-user-details p {
        color: var(--text-light-secondary) !important;
    }

    body.light-theme .dropdown-item {
        color: var(--text-light-primary) !important;
    }

        body.light-theme .dropdown-item:hover {
            background: var(--bg-light-hover) !important;
            color: var(--primary) !important;
        }

    /* ========== STAT CARDS ========== */
    body.light-theme .stat-card h3 {
        color: var(--text-light-primary) !important;
    }

    body.light-theme .stat-card p {
        color: var(--text-light-secondary) !important;
    }

    body.light-theme .stat-value {
        color: var(--text-light-primary) !important;
    }

    body.light-theme .stat-label {
        color: var(--text-light-secondary) !important;
    }

    /* ========== TABLAS ========== */
    body.light-theme .table-title {
        color: var(--text-light-primary) !important;
    }

    body.light-theme th {
        color: var(--text-light-secondary) !important;
    }

    body.light-theme td {
        color: var(--text-light-primary) !important;
    }

    body.light-theme .table-container td {
        color: var(--text-light-primary) !important;
    }

    /* ========== BADGES ========== */
    body.light-theme .badge-secondary {
        background: #e9ecef;
        color: var(--text-light-secondary) !important;
    }

    /* ========== FORMULARIOS ========== */
    body.light-theme .form-label,
    body.light-theme .filter-label,
    body.light-theme label {
        color: var(--text-light-primary) !important;
        font-weight: 600;
    }

    body.light-theme .form-control {
        background: #f8f9fa !important;
        color: var(--text-light-primary) !important;
        border-color: #d1d5db !important;
    }

        body.light-theme .form-control::placeholder {
            color: #9ca3af !important;
        }

    body.light-theme select.form-control {
        color: var(--text-light-primary) !important;
    }

        body.light-theme select.form-control option {
            color: var(--text-light-primary) !important;
            background: white !important;
        }

    body.light-theme textarea.form-control {
        color: var(--text-light-primary) !important;
    }

    /* ========== DETALLES ========== */
    body.light-theme .detail-label,
    body.light-theme .info-label {
        color: var(--text-light-secondary) !important;
    }

    body.light-theme .detail-value,
    body.light-theme .info-value {
        color: var(--text-light-primary) !important;
    }

    body.light-theme .profile-info .info-item {
        background: #f8f9fa !important;
    }

    /* ========== BÚSQUEDA ========== */
    body.light-theme .search-filters {
        background: white !important;
        border: 1px solid #dee2e6;
    }

    body.light-theme .search-box {
        background: #f8f9fa !important;
        border-color: #d1d5db !important;
    }

        body.light-theme .search-box input {
            color: var(--text-light-primary) !important;
        }

            body.light-theme .search-box input::placeholder {
                color: #9ca3af !important;
            }

    body.light-theme .search-icon {
        color: var(--text-light-secondary) !important;
    }

    body.light-theme .results-count {
        background: var(--primary);
        color: white !important;
    }

    /* ========== FILTROS DINÁMICOS ========== */
    body.light-theme .filtros-dinamicos {
        border-top-color: #dee2e6 !important;
    }

    body.light-theme .filter-section label {
        color: var(--text-light-primary) !important;
    }

    /* ========== EMPTY STATE ========== */
    body.light-theme .empty-state h3 {
        color: var(--text-light-primary) !important;
    }

    body.light-theme .empty-state p {
        color: var(--text-light-secondary) !important;
    }

    /* ========== MODALES ========== */
    body.light-theme .modal-content {
        background: white !important;
        color: var(--text-light-primary) !important;
        border: 1px solid #dee2e6;
    }

    body.light-theme .modal-title {
        color: var(--text-light-primary) !important;
    }

    body.light-theme .close-btn {
        color: var(--text-light-secondary) !important;
    }

        body.light-theme .close-btn:hover {
            background: #f8f9fa !important;
            color: var(--text-light-primary) !important;
        }

    /* ========== USER PROFILE ========== */
    body.light-theme .user-profile span {
        color: var(--text-light-primary) !important;
    }

    body.light-theme .user-avatar {
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white !important;
    }

    /* ========== NOTIFICACIONES ========== */
    body.light-theme .notification {
        background: white !important;
        color: var(--text-light-primary) !important;
        border: 1px solid #dee2e6;
    }

        body.light-theme .notification.success {
            border-left: 4px solid var(--success);
        }

        body.light-theme .notification.error {
            border-left: 4px solid var(--danger);
        }

        body.light-theme .notification.warning {
            border-left: 4px solid var(--warning);
        }

    /* ========== CARRUSEL ========== */
    body.light-theme .carousel-caption h5 {
        color: #1e293b !important;
        text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    }

    body.light-theme .carousel-caption p {
        color: #475569 !important;
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    }

    /* ========== VALIDATION ERRORS ========== */
    body.light-theme .avatar-error,
    body.light-theme .text-danger,
    body.light-theme .field-validation-error {
        color: #dc2626 !important;
    }

    /* ========== CONFIRMATION MODAL ========== */
    body.light-theme .confirmation-modal-content {
        background: white !important;
        border: 1px solid #dee2e6;
    }

    body.light-theme .confirmation-modal-title {
        color: var(--text-light-primary) !important;
    }

    body.light-theme .confirmation-modal-text {
        color: var(--text-light-secondary) !important;
    }

    body.light-theme .confirmation-btn-cancel {
        background: #f8f9fa !important;
        color: var(--text-light-primary) !important;
        border: 1px solid #dee2e6 !important;
    }

        body.light-theme .confirmation-btn-cancel:hover {
            background: #e9ecef !important;
            color: var(--text-light-primary) !important;
        }

    /* ========== SIDEBAR LIGHT THEME ========== */
    body.light-theme .sidebar {
        background: white !important;
        border-right: 1px solid #dee2e6 !important;
    }

    body.light-theme .logo-container {
        border-bottom-color: #dee2e6 !important;
    }

    body.light-theme .nav-item {
        color: var(--text-light-primary) !important;
    }

        body.light-theme .nav-item:hover {
            background: #f8f9fa !important;
            color: var(--primary) !important;
        }

        body.light-theme .nav-item.active {
            background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
            color: white !important;
        }

    body.light-theme .sidebar-footer {
        border-top-color: #dee2e6 !important;
    }

        body.light-theme .sidebar-footer .theme-toggle,
        body.light-theme .sidebar-footer .logout-btn {
            color: var(--text-light-primary) !important;
        }

            body.light-theme .sidebar-footer .theme-toggle:hover,
            body.light-theme .sidebar-footer .logout-btn:hover {
                background: #f8f9fa !important;
                color: var(--primary) !important;
            }

            body.light-theme .sidebar-footer .logout-btn:hover {
                background: rgba(239, 68, 68, 0.1) !important;
                color: var(--danger) !important;
            }

    /* ========== SCROLL BARS ========== */
    body.light-theme .table-responsive::-webkit-scrollbar-track {
        background: #f8f9fa;
    }

    body.light-theme .table-responsive::-webkit-scrollbar-thumb {
        background: #d1d5db;
    }

        body.light-theme .table-responsive::-webkit-scrollbar-thumb:hover {
            background: #9ca3af;
        }

    /* ========== LINKS ========== */
    body.light-theme a {
        color: var(--primary) !important;
    }

        body.light-theme a:hover {
            color: var(--primary-dark) !important;
        }

    /* ========== BREADCRUMBS Y NAVEGACIÓN ========== */
    body.light-theme .breadcrumb {
        color: var(--text-light-secondary) !important;
    }

    body.light-theme .breadcrumb-item.active {
        color: var(--text-light-primary) !important;
    }

    /* ========== TOOLTIPS ========== */
    body.light-theme .btn-icon::after,
    body.light-theme .btn-xs::after {
        background: rgba(30, 41, 59, 0.95) !important;
        color: white !important;
    }

    /* ========== INPUTS DE FECHA ========== */
    body.light-theme input[type="date"],
    body.light-theme input[type="datetime-local"],
    body.light-theme input[type="time"] {
        color: var(--text-light-primary) !important;
        background: #f8f9fa !important;
    }

    /* ========== SELECTS MÚLTIPLES ========== */
    body.light-theme select[multiple] option {
        color: var(--text-light-primary) !important;
        background: white !important;
    }

        body.light-theme select[multiple] option:checked {
            background: var(--primary) !important;
            color: white !important;
        }

    /* ========== CONTRASTE MEJORADO PARA ICONOS ========== */
    body.light-theme .nav-item-icon,
    body.light-theme .icon {
        opacity: 0.8;
    }

    body.light-theme .nav-item:hover .nav-item-icon,
    body.light-theme .nav-item:hover .icon {
        opacity: 1;
    }

    /* ========== DIVIDERS ========== */
    body.light-theme hr,
    body.light-theme .divider {
        border-color: #dee2e6 !important;
    }

    /* ========== CARDS ADICIONALES ========== */
    body.light-theme .card {
        background: white !important;
        border: 1px solid #dee2e6 !important;
        color: var(--text-light-primary) !important;
    }

    body.light-theme .card-header {
        background: #f8f9fa !important;
        color: var(--text-light-primary) !important;
        border-bottom: 1px solid #dee2e6 !important;
    }

    body.light-theme .card-body {
        color: var(--text-light-primary) !important;
    }

    /* ========== LISTA DE ITEMS ========== */
    body.light-theme .list-group-item {
        background: white !important;
        color: var(--text-light-primary) !important;
        border-color: #dee2e6 !important;
    }

        body.light-theme .list-group-item:hover {
            background: #f8f9fa !important;
        }

    /* ========== MEJORA DE CONTRASTE GENERAL ========== */
    body.light-theme p,
    body.light-theme span,
    body.light-theme div {
        color: inherit;
    }

    /* Asegurar que el texto heredado sea visible */
    body.light-theme * {
        color: inherit;
    }

    /* Override específico para elementos importantes */
    body.light-theme .main-content {
        color: var(--text-light-primary);
    }

    /* ========== FIX PARA CAMPOS DISABLED ========== */
    body.light-theme .form-control:disabled,
    body.light-theme .form-control[readonly] {
        background: #e9ecef !important;
        color: #6c757d !important;
    }

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 768px) {
    body.light-theme .header-title {
        font-size: 1.5rem;
    }

    body.light-theme .modal-content {
        padding: 1.5rem;
    }
}
