/*=============================================
    FORCE TEXT VISIBILITY IN DARK MODE
    Ensures ALL text is visible when switching themes
=============================================*/

/* Dark Mode Text Visibility - FORCE ALL TEXT TO BE VISIBLE */
[data-theme="dark"] {
    /* Global text color enforcement */
    color: #e0e0e0 !important;
}

/* Force visibility for ALL possible text elements in dark mode */
[data-theme="dark"] body,
[data-theme="dark"] p,
[data-theme="dark"] div,
[data-theme="dark"] span,
[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"] li,
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] label,
[data-theme="dark"] small,
[data-theme="dark"] strong,
[data-theme="dark"] em,
[data-theme="dark"] blockquote,
[data-theme="dark"] pre,
[data-theme="dark"] code {
    color: #e0e0e0 !important;
}

/* Force navbar and header text visibility */
[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar-brand,
[data-theme="dark"] .navbar-brand h2,
[data-theme="dark"] .navbar-nav,
[data-theme="dark"] .navbar-nav .nav-link,
[data-theme="dark"] .navbar-nav .nav-item,
[data-theme="dark"] .navbar-toggler,
[data-theme="dark"] .navbar-text {
    color: #e0e0e0 !important;
}

/* Force dropdown visibility */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .dropdown-item,
[data-theme="dark"] .dropdown-header,
[data-theme="dark"] .dropdown-divider {
    color: #e0e0e0 !important;
    background-color: rgba(30, 41, 59, 0.95) !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    color: #ffffff !important;
    background-color: rgba(99, 102, 241, 0.2) !important;
}

/* Force topbar text visibility */
[data-theme="dark"] .container-fluid small,
[data-theme="dark"] .container-fluid a,
[data-theme="dark"] .container-fluid i {
    color: #e0e0e0 !important;
}

/* Force link visibility (except buttons) */
[data-theme="dark"] a:not(.btn):not(.navbar-brand) {
    color: #93c5fd !important;
}

[data-theme="dark"] a:not(.btn):not(.navbar-brand):hover {
    color: #dbeafe !important;
}

/* Force card and content visibility */
[data-theme="dark"] .card,
[data-theme="dark"] .card-title,
[data-theme="dark"] .card-text,
[data-theme="dark"] .card-body,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
    color: #e0e0e0 !important;
    background-color: rgba(30, 41, 59, 0.7) !important;
}

/* Force footer text visibility */
[data-theme="dark"] .footer,
[data-theme="dark"] .footer p,
[data-theme="dark"] .footer h4,
[data-theme="dark"] .footer a,
[data-theme="dark"] .footer small {
    color: #cbd5e1 !important;
}

/* Force table text visibility */
[data-theme="dark"] table,
[data-theme="dark"] .table,
[data-theme="dark"] .table td,
[data-theme="dark"] .table th,
[data-theme="dark"] .table-dark,
[data-theme="dark"] .table-striped {
    color: #e0e0e0 !important;
    background-color: rgba(30, 41, 59, 0.5) !important;
}

/* Force form elements visibility */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-label,
[data-theme="dark"] .input-group-text,
[data-theme="dark"] .form-check-label {
    color: #e0e0e0 !important;
    background-color: rgba(30, 41, 59, 0.7) !important;
    border-color: rgba(100, 116, 139, 0.3) !important;
}

/* Force text classes visibility */
[data-theme="dark"] .text-dark,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .text-secondary,
[data-theme="dark"] .text-body,
[data-theme="dark"] .text-black-50 {
    color: #e0e0e0 !important;
}

/* Force any element with inline styles that might hide text */
[data-theme="dark"] *[style*="color: #000"],
[data-theme="dark"] *[style*="color: black"],
[data-theme="dark"] *[style*="color: rgb(0"],
[data-theme="dark"] *[style*="color:#000"],
[data-theme="dark"] *[style*="color:black"],
[data-theme="dark"] *[style*="color:rgb(0"] {
    color: #e0e0e0 !important;
}

/* Specific fixes for navbar brand */
[data-theme="dark"] .navbar-brand h2 {
    color: #6366f1 !important; /* Keep primary color for brand */
}

/* Specific fixes for primary colored text that should remain visible */
[data-theme="dark"] .text-primary {
    color: #93c5fd !important; /* Lighter blue for dark mode */
}

/* Fix for any remaining invisible text elements - ensure proper inheritance */
[data-theme="dark"] *:not(.btn):not(.badge):not(.alert) {
    color: inherit !important;
}

/* Force background colors to be dark in dark mode */
[data-theme="dark"] body {
    background-color: #1e293b !important;
}

[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-secondary {
    background-color: rgba(30, 41, 59, 0.8) !important;
}

/* Ensure spinner is visible in dark mode */
[data-theme="dark"] #spinner {
    background-color: #1e293b !important;
}

[data-theme="dark"] .spinner-grow {
    color: #6366f1 !important;
}

/* Ensure icons are visible */
[data-theme="dark"] i,
[data-theme="dark"] .fa,
[data-theme="dark"] .fas,
[data-theme="dark"] .far,
[data-theme="dark"] .fab {
    color: inherit !important;
}

/* Fix for carousel text */
[data-theme="dark"] .carousel-caption,
[data-theme="dark"] .carousel-caption h1,
[data-theme="dark"] .carousel-caption p {
    color: #ffffff !important;
}

/* Override any Bootstrap or custom styles that might interfere */
[data-theme="dark"] .navbar-light .navbar-nav .nav-link {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .navbar-light .navbar-nav .nav-link:hover,
[data-theme="dark"] .navbar-light .navbar-nav .nav-link:focus,
[data-theme="dark"] .navbar-light .navbar-nav .nav-link.active {
    color: #93c5fd !important;
}

[data-theme="dark"] .navbar-light .navbar-brand {
    color: #6366f1 !important;
}

[data-theme="dark"] .navbar-light .navbar-toggler {
    border-color: rgba(100, 116, 139, 0.3) !important;
}

[data-theme="dark"] .navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28224, 224, 224, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
