/* Override all gray text colors to black for better visibility */
.text-gray-100,
.text-gray-200,
.text-gray-300,
.text-gray-400,
.text-gray-500,
.text-gray-600,
.text-gray-700,
.text-gray-800,
.text-gray-900 {
    color: #000 !important;
}

/* Override hover states for gray text */
.hover\:text-gray-400:hover,
.hover\:text-gray-500:hover,
.hover\:text-gray-600:hover,
.hover\:text-gray-700:hover {
    color: #000 !important;
}

/* Override active states for gray text */
.active\:text-gray-500:active,
.active\:text-gray-700:active {
    color: #000 !important;
}

/* Override any remaining gray hex colors for text elements */
body, p, span, div, td, th, label, button, input, textarea, select, h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
}

/* Specific overrides for auth pages */
.text-center, .form-check-label, .card-body h2, .card-body p {
    color: #000 !important;
}

/* Override gray text colors in auth pages */
.text-gray-500, .text-gray-600, .text-gray-700 {
    color: #000 !important;
}

/* Exception for specific UI elements that should remain colored */
.text-white,
.text-blue-500,
.text-blue-600,
.text-green-500,
.text-green-600,
.text-red-500,
.text-red-600,
.text-yellow-500,
.text-yellow-600,
.text-indigo-500,
.text-indigo-600,
.text-purple-500,
.text-purple-600,
.text-orange-500,
.text-orange-600 {
    color: revert !important;
}

/* Exception for links that should remain blue */
a:not(.nav-link):not(.btn) {
    color: #3b82f6 !important;
}

/* Exception for success/error messages */
.alert-success, .text-success {
    color: #16a34a !important;
}

.alert-danger, .text-danger {
    color: #dc2626 !important;
}

.alert-warning, .text-warning {
    color: #d97706 !important;
}

.alert-info, .text-info {
    color: #0ea5e9 !important;
}

/* Remove underlines and blue hover effects from all links */
a {
    text-decoration: none !important;
    color: inherit !important;
}

a:hover {
    text-decoration: none !important;
    color: inherit !important;
}

a:focus {
    text-decoration: none !important;
    color: inherit !important;
}

a:visited {
    text-decoration: none !important;
    color: inherit !important;
}

a:active {
    text-decoration: none !important;
    color: inherit !important;
}

/* Override specific link styles */
.nav-link {
    text-decoration: none !important;
}

.nav-link:hover {
    text-decoration: none !important;
}

.dropdown-item {
    text-decoration: none !important;
}

.dropdown-item:hover {
    text-decoration: none !important;
}

/* Prevent blue link colors in navigation */
.navbar-brand {
    text-decoration: none !important;
}

.navbar-brand:hover {
    text-decoration: none !important;
}

/* Remove underlines from all button-style links */
.btn {
    text-decoration: none !important;
}

.btn:hover {
    text-decoration: none !important;
}

/* Fix container-fluid and prevent horizontal overflow */
.container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

.page-body .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.page-header .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

/* Fix row negative margins that cause overflow */
.row {
    margin-left: -6px !important;
    margin-right: -6px !important;
}

.row > * {
    padding-left: 6px !important;
    padding-right: 6px !important;
}

/* Ensure page wrapper doesn't add extra width */
.page-wrapper {
    max-width: 100vw;
    overflow: visible !important;
}

.page {
    max-width: 100vw;
    overflow: visible !important;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
    overflow-y: auto !important;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Navbar and dropdown menu fixes - remove all scrollbars */
.page {
    overflow: visible !important;
    position: relative !important;
}

.page-wrapper {
    overflow: visible !important;
}

header.navbar-expand-md {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    position: relative !important;
    z-index: 1040 !important;
}

.navbar {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    position: relative !important;
}

.navbar-collapse {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    position: relative !important;
}

.navbar-nav {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    position: relative !important;
}

.nav-item.dropdown {
    position: relative !important;
}

/* Override Bootstrap's navbar-nav-scroll that causes internal scrollbar */
.navbar-nav-scroll {
    max-height: none !important;
    overflow-y: visible !important;
    overflow: visible !important;
}

.collapse.navbar-collapse {
    overflow: visible !important;
    max-height: none !important;
}

.collapse.navbar-collapse.show,
.collapse.navbar-collapse.collapsing {
    overflow: visible !important;
    max-height: none !important;
}

#navbar-menu {
    overflow: visible !important;
    max-height: none !important;
}

/* Allow dropdown menus to expand without scrollbars */
.dropdown-menu {
    max-height: 80vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: absolute !important;
    z-index: 1050 !important;
}

.dropdown-menu-columns {
    display: flex !important;
    gap: 1rem !important;
}

.dropdown-menu-column {
    max-height: 75vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 !important;
    min-width: 200px !important;
}

/* Smooth loading transitions to prevent page shaking */
.opacity-50 {
    opacity: 0.5 !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease-in-out !important;
}
