/* ============================================
   MEJORAS MODO OSCURO - JOSIE POOT
   Corrección de textos y contraste
   ============================================ */

/* === TEXTOS PRINCIPALES === */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .text-2xl,
[data-theme="dark"] .text-3xl,
[data-theme="dark"] .text-4xl,
[data-theme="dark"] .font-bold,
[data-theme="dark"] .font-semibold,
[data-theme="dark"] strong {
    color: #F9FAFB !important;
}

/* Párrafos y texto general */
[data-theme="dark"] p:not(.badge):not([class*="notification-"]),
[data-theme="dark"] span:not(.badge):not([class*="ph-"]):not([class*="text-"]):not(.font-bold),
[data-theme="dark"] div:not(.badge):not([class*="bg-"]):not([id*="step-"]) {
    color: #D1D5DB !important;
}

[data-theme="dark"] .text-earth-dark {
    color: #E2D9D5 !important;
}

[data-theme="dark"] .text-earth-medium {
    color: #C5A065 !important;
}

/* Labels y descripciones */
[data-theme="dark"] label,
[data-theme="dark"] .form-label,
[data-theme="dark"] .text-xs.font-bold.tracking-widest {
    color: #E5E7EB !important;
}

/* === STAT CARDS === */
[data-theme="dark"] .stat-card {
    background: linear-gradient(135deg, #1F2937 0%, #2D3748 100%) !important;
    border-color: #4B5563 !important;
}

[data-theme="dark"] .stat-card h3,
[data-theme="dark"] .stat-card h4,
[data-theme="dark"] .stat-card .text-3xl,
[data-theme="dark"] .stat-card .text-4xl {
    color: #F9FAFB !important;
}

[data-theme="dark"] .stat-card p,
[data-theme="dark"] .stat-card small,
[data-theme="dark"] .stat-card .text-sm,
[data-theme="dark"] .stat-card .text-xs {
    color: #9CA3AF !important;
}

/* === CARDS === */
[data-theme="dark"] .card {
    background: #1F2937 !important;
    border-color: #374151 !important;
}

[data-theme="dark"] .card h2,
[data-theme="dark"] .card h3,
[data-theme="dark"] .card h4 {
    color: #F9FAFB !important;
}

[data-theme="dark"] .card p {
    color: #D1D5DB !important;
}

/* === TABLAS === */
[data-theme="dark"] .table {
    color: #D1D5DB !important;
}

[data-theme="dark"] .table thead {
    background: #374151 !important;
}

[data-theme="dark"] .table th {
    color: #9CA3AF !important;
    border-bottom-color: #4B5563 !important;
}

[data-theme="dark"] .table td {
    color: #D1D5DB !important;
    border-bottom-color: #374151 !important;
}

[data-theme="dark"] .table tbody tr:hover {
    background: #374151 !important;
}

/* === FORMULARIOS === */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #374151 !important;
    border-color: #4B5563 !important;
    color: #F9FAFB !important;
}

[data-theme="dark"] .form-input::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder,
[data-theme="dark"] .placeholder-gray-300::placeholder {
    color: #9CA3AF !important;
    opacity: 1 !important;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: #8D6E63 !important;
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.2) !important;
}

/* === BOTONES === */
[data-theme="dark"] .btn-secondary {
    background: #374151 !important;
    color: #E5E7EB !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #4B5563 !important;
}

/* === BADGES === */
[data-theme="dark"] .badge {
    border: 1px solid currentColor;
}

[data-theme="dark"] .badge-success {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34D399 !important;
}

[data-theme="dark"] .badge-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #FBBF24 !important;
}

[data-theme="dark"] .badge-error {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #F87171 !important;
}

[data-theme="dark"] .badge-info {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60A5FA !important;
}

[data-theme="dark"] .badge-primary {
    background: rgba(141, 110, 99, 0.2) !important;
    color: #C5A065 !important;
}

/* === LINKS === */
[data-theme="dark"] a:not(.btn) {
    color: #C5A065 !important;
}

[data-theme="dark"] a:not(.btn):hover {
    color: #D4AF37 !important;
}

/* === SIDEBAR === */
[data-theme="dark"] .sidebar {
    background: #1F2937 !important;
    border-right-color: #374151 !important;
}

[data-theme="dark"] .sidebar a {
    color: #9CA3AF !important;
}

[data-theme="dark"] .sidebar a:hover,
[data-theme="dark"] .sidebar a.active {
    background: #374151 !important;
    color: #F9FAFB !important;
}

/* === BREADCRUMBS === */
[data-theme="dark"] .breadcrumb {
    background: #1F2937 !important;
}

[data-theme="dark"] .breadcrumb-item {
    color: #9CA3AF !important;
}

[data-theme="dark"] .breadcrumb-item.active {
    color: #C5A065 !important;
}

/* === MODALES === */
[data-theme="dark"] .modal-content,
[data-theme="dark"] #login-modal div.bg-off-white,
[data-theme="dark"] #notification-modal div.bg-white,
[data-theme="dark"] #results-modal div.bg-off-white,
[data-theme="dark"] #logout-confirmation-modal div.bg-white {
    background: #111827 !important;
    color: #F9FAFB !important;
    border-color: #374151 !important;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #374151 !important;
}

[data-theme="dark"] .modal-footer {
    border-top-color: #374151 !important;
}

[data-theme="dark"] .modal-title,
[data-theme="dark"] .text-earth-dark,
[data-theme="dark"] h2.text-earth-dark,
[data-theme="dark"] h3.text-earth-dark {
    color: #F9FAFB !important;
}

/* === NOTIFICACIONES === */
[data-theme="dark"] .notification-success {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34D399 !important;
}

[data-theme="dark"] .notification-error {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #F87171 !important;
}

[data-theme="dark"] .notification-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #FBBF24 !important;
}

[data-theme="dark"] .notification-info {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60A5FA !important;
}

/* === SCROLLBAR === */
[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-track {
    background: #374151 !important;
}

[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #4B5563 !important;
}

[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #6B7280 !important;
}

/* === ACTIVIDAD RECIENTE === */
[data-theme="dark"] .activity-item {
    border-bottom-color: #374151 !important;
}

[data-theme="dark"] .activity-item:hover {
    background: #374151 !important;
}

/* === TEXTOS PEQUEÑOS === */
[data-theme="dark"] .text-sm,
[data-theme="dark"] .text-xs,
[data-theme="dark"] small {
    color: #9CA3AF !important;
}

/* === FONDOS ADICIONALES === */
[data-theme="dark"] .bg-gray-200 {
    background-color: #4B5563 !important;
}

[data-theme="dark"] .bg-gray-300 {
    background-color: #6B7280 !important;
}

/* === DROPDOWN === */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] select option {
    background: #374151 !important;
    color: #F9FAFB !important;
}

/* === SKELETON LOADER === */
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4B5563 50%, #374151 75%) !important;
    background-size: 200% 100%;
}

/* === CORRECCIONES ESPECÍFICAS === */
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800 {
    color: #F9FAFB !important;
}

[data-theme="dark"] .text-gray-700 {
    color: #E5E7EB !important;
}

[data-theme="dark"] .text-gray-600 {
    color: #D1D5DB !important;
}

[data-theme="dark"] .text-gray-500 {
    color: #9CA3AF !important;
}

[data-theme="dark"] .text-gray-400 {
    color: #6B7280 !important;
}

[data-theme="dark"] .text-gray-200 {
    color: #E5E7EB !important;
}

/* === COLORES DE FONDO === */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-off-white,
[data-theme="dark"] .bg-soft-bg,
[data-theme="dark"] .bg-\[\#FDFBF7\],
[data-theme="dark"] .bg-\[\#FDFBF7\] {
    background-color: #111827 !important;
}

[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-earth-light\/10,
[data-theme="dark"] .bg-earth-light\/30,
[data-theme="dark"] .bg-earth-light\/5,
[data-theme="dark"] .bg-off-white {
    background-color: #1F2937 !important;
}

[data-theme="dark"] .bg-gray-100 {
    background-color: #374151 !important;
}

/* === BORDES === */
[data-theme="dark"] .border,
[data-theme="dark"] .border-white,
[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-earth-light\/30 {
    border-color: #374151 !important;
}

/* === SOMBRAS === */
[data-theme="dark"] .shadow-lg,
[data-theme="dark"] .shadow-xl,
[data-theme="dark"] .shadow-2xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4) !important;
}

/* === ICONOS === */
[data-theme="dark"] .stat-icon,
[data-theme="dark"] i[class*="ph-"] {
    color: inherit !important;
}

/* === COMPONENTES ESPECÍFICOS === */
[data-theme="dark"] #search-helper {
    background-color: rgba(215, 204, 200, 0.1) !important;
}

[data-theme="dark"] #search-results {
    background-color: #1F2937 !important;
    border-color: #374151 !important;
}

[data-theme="dark"] #search-results .group\/item:hover {
    background-color: #374151 !important;
}

[data-theme="dark"] .bg-\[\#FDFBF7\] {
    background-color: #111827 !important;
}

[data-theme="dark"] .text-gray-400 {
    color: #9CA3AF !important;
}

[data-theme="dark"] .text-gray-500 {
    color: #E5E7EB !important;
}