/* 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;
}

.nav-link.dropdown-toggle::after {
    margin-left: 0.5rem !important;
    vertical-align: middle !important;
}

.dropdown-item {
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    padding: 0.5rem 1rem !important;
    gap: 0.75rem !important;
    white-space: nowrap !important;
    border-radius: 0.25rem !important;
    transition: background-color 0.15s ease-in-out !important;
}

.dropdown-item:hover {
    text-decoration: none !important;
    background-color: rgba(32, 107, 196, 0.06) !important;
}

.dropdown-item-icon {
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !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;
}

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

.navbar {
    position: relative !important;
    overflow: visible !important;
}

.navbar-collapse {
    position: relative !important;
    overflow: visible !important;
}

.navbar-nav {
    position: relative !important;
    overflow: visible !important;
}

/* Navbar dropdown positioning */
.nav-item.dropdown {
    position: relative !important;
}

/* Basic dropdown styling - let Bootstrap Popper handle positioning */
.navbar .dropdown-menu {
    max-height: 80vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 1050 !important;
    padding: 0.5rem 0 !important;
    border: 1px solid rgba(98, 105, 118, 0.16) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.dropdown-menu-columns {
    display: flex !important;
    gap: 2rem !important;
    min-width: 600px !important;
    padding: 0.5rem 1rem !important;
}

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

/* Dropdown menu header styling */
.dropdown-header {
    padding: 0.5rem 1rem !important;
    font-size: 0.625rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #6c757d !important;
    letter-spacing: 0.08em !important;
    margin-top: 0.5rem !important;
}

.dropdown-header:first-child {
    margin-top: 0 !important;
}

.dropdown-divider {
    margin: 0.75rem 0 !important;
    border-top: 1px solid rgba(98, 105, 118, 0.16) !important;
}

/* Badge styling in dropdown items */
.dropdown-item .badge {
    margin-left: auto !important;
    font-size: 0.625rem !important;
    padding: 0.25rem 0.5rem !important;
}

/* Ensure dropdown menus don't overflow viewport */
.dropdown-menu-end {
    right: 0 !important;
    left: auto !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;
}
