/* Theme Improvements for Better Visibility and Modern Design */

/* ============================================
   SIDEBAR NAVIGATION TEXT FIX - CRITICAL
   ============================================ */

/* Light theme sidebar - Make text visible (dark text on light background) */
html.sidebar-light:not(.dark) .sidebar-left .nav-main li a {
    color: #333 !important;
}

html.sidebar-light:not(.dark) .sidebar-left .nav-main li a span {
    color: #333 !important;
}

html.sidebar-light:not(.dark) .sidebar-left .nav-main li a i {
    color: #186539 !important;
}

html.sidebar-light:not(.dark) .sidebar-left .nav-main li:hover > a,
html.sidebar-light:not(.dark) .sidebar-left .nav-main li.nav-active > a {
    color: #0088cc !important;
    background-color: #f0f7ff !important;
}

html.sidebar-light:not(.dark) .sidebar-left .nav-main li:hover > a i,
html.sidebar-light:not(.dark) .sidebar-left .nav-main li.nav-active > a i {
    color: #0088cc !important;
}

html.sidebar-light:not(.dark) .sidebar-left .nav-main li ul.nav-children li a {
    color: #555 !important;
}

html.sidebar-light:not(.dark) .sidebar-left .nav-main li ul.nav-children li:hover > a {
    color: #0088cc !important;
    background-color: #f5f9ff !important;
}

/* Sidebar header title */
html.sidebar-light:not(.dark) .sidebar-left .sidebar-header .sidebar-title {
    background: #0088cc !important;
    color: #fff !important;
}

/* ============================================
   POPUP / DROPDOWN MENUS TEXT FIX
   ============================================ */

/* Userbox dropdown - Make text visible */
.userbox .dropdown-menu {
    background: #fff !important;
}

.userbox .dropdown-menu ul > li:not(.user-p-box) a {
    color: #333 !important;
}

.userbox .dropdown-menu ul > li:not(.user-p-box) a i {
    color: #666 !important;
}

.userbox.open .dropdown-menu ul > li:not(.user-p-box) a:hover {
    background: #0088cc !important;
    color: #fff !important;
}

.userbox.open .dropdown-menu ul > li:not(.user-p-box) a:hover i {
    color: #fff !important;
}

/* User profile box text */
.dw-user-box h4,
.dw-user-box .u-text h4 {
    color: #333 !important;
}

.dw-user-box p,
.dw-user-box .u-text p {
    color: #666 !important;
}

.userbox .name {
    color: #333 !important;
}

.userbox .role {
    color: #666 !important;
}

/* Header dropdown menus */
.header .dropdown-menu {
    background: #fff !important;
}

.header .dropdown-menu li a {
    color: #333 !important;
}

.header .dropdown-menu li a:hover {
    background: #0088cc !important;
    color: #fff !important;
}

/* Menu icon grid (shortcut menu) */
.header .menu-icon-grid > a {
    color: #333 !important;
}

.header .menu-icon-grid > a:hover {
    background: #0088cc !important;
    color: #fff !important;
}

/* ============================================
   GENERAL DROPDOWN FIXES
   ============================================ */

.dropdown-menu {
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dropdown-menu > li > a {
    color: #333 !important;
    padding: 10px 15px;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    background-color: #0088cc !important;
    color: #fff !important;
}

/* ============================================
   SIDEBAR TITLE AND HEADER
   ============================================ */

.sidebar-left .sidebar-title {
    color: #fff !important;
}

.sidebar-left .sidebar-header {
    background: #0088cc;
}

/* Sidebar toggle icon */
.sidebar-left .sidebar-header .sidebar-toggle i {
    color: #fff !important;
}

.sidebar-left .sidebar-header .sidebar-toggle:hover i {
    color: #ffbd2e !important;
}

/* ============================================
   NAVBAR AND TOPBAR FIXES
   ============================================ */

.header-right .nav > li > a {
    color: #333;
}

/* Notification dropdowns */
.notification-menu .dropdown-menu,
.notifications .dropdown-menu {
    background: #fff !important;
}

.notification-menu .dropdown-menu li a,
.notifications .dropdown-menu li a {
    color: #333 !important;
}

/* ============================================
   FORM AND TABLE IMPROVEMENTS
   ============================================ */

/* Form labels */
label {
    color: #333;
    font-weight: 500;
}

/* Form control text */
.form-control {
    color: #333;
    background-color: #fff;
    border-color: #ddd;
}

.form-control:focus {
    border-color: #0088cc;
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

/* Select2 dropdowns */
.select2-container--bootstrap .select2-selection {
    color: #333 !important;
}

.select2-container--bootstrap .select2-results__option {
    color: #333 !important;
}

.select2-container--bootstrap .select2-results__option--highlighted {
    background-color: #0088cc !important;
    color: #fff !important;
}

/* ============================================
   MODAL AND POPUP FIXES
   ============================================ */

.modal-content {
    background: #fff;
}

.modal-header {
    background: #f8f9fa;
    border-bottom: 2px solid #0088cc;
}

.modal-title {
    color: #333 !important;
}

.modal-body {
    color: #333;
}

.modal-body label {
    color: #333 !important;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

/* ============================================
   DASHBOARD WIDGET IMPROVEMENTS
   ============================================ */

.dashboard-page .widget-col-in i {
    color: #0088cc;
    text-shadow: 0 2px 4px rgba(0, 136, 204, 0.2);
}

.dashboard-page .widget-col-in h3 {
    color: #0088cc;
    font-weight: 600;
}

.dashboard-page .widget-col-in h5 {
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-page .panel {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e5;
}

.dashboard-page section.panel {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e5;
}

/* Chart Container Styling */
.dashboard-page .panel-body {
    background: #fff;
}

/* Better text contrast */
.dashboard-page .text-muted {
    color: #666 !important;
}

.dashboard-page .text-primary {
    color: #0088cc !important;
}

/* Widget hover effect */
.dashboard-page .widget-col-in:hover {
    background-color: rgba(0, 136, 204, 0.02);
    transition: background-color 0.3s ease;
}

/* Improve panel borders */
.row.widget-row-in > div {
    border-color: rgba(0, 136, 204, 0.1);
}

/* ============================================
   CHART TITLES
   ============================================ */

.chart-title {
    color: #333 !important;
}

/* ============================================
   TABLE IMPROVEMENTS
   ============================================ */

.table > thead > tr > th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #0088cc;
}

.table > tbody > tr > td {
    color: #333;
}

/* ============================================
   PANEL IMPROVEMENTS
   ============================================ */

.panel-heading {
    background-color: #f8f9fa;
    border-bottom: 2px solid #0088cc;
}

.panel-title {
    color: #333 !important;
}

.panel-body {
    color: #333;
}

/* ============================================
   BUTTON IMPROVEMENTS
   ============================================ */

.btn-primary {
    background-color: #0088cc !important;
    border-color: #0088cc !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #006699 !important;
    border-color: #006699 !important;
}

/* ============================================
   NAVIGATION + ICONS
   ============================================ */

.nav-main > li > a > i {
    color: inherit;
}

/* Plus sign for expandable menus */
.sidebar-left .nav-main li.nav-parent > a:after {
    color: #999 !important;
}

html.sidebar-light:not(.dark) .sidebar-left .nav-main li.nav-parent > a:after {
    color: #999 !important;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

html.dark .dashboard-page .widget-col-in i {
    color: #66b3ff;
}

html.dark .dashboard-page .widget-col-in h3 {
    color: #66b3ff;
}

html.dark .dashboard-page .widget-col-in h5 {
    color: #ccc;
}

html.dark .box-top-line.line-color-primary {
    border-color: #66b3ff;
}

html.dark .chart-title:before {
    background-color: #66b3ff;
}

html.dark .chart-title {
    color: #ccc !important;
}

html.dark .page-header .page-title-icon {
    border-color: #66b3ff;
    color: #66b3ff;
}

html.dark .dashboard-page .text-primary {
    color: #66b3ff !important;
}

html.dark .dashboard-page .text-muted {
    color: #999 !important;
}

html.dark .panel-heading {
    background-color: #2a2a2a;
    border-bottom-color: #66b3ff;
}

html.dark .table > thead > tr > th {
    background-color: #2a2a2a;
    color: #ccc;
    border-bottom-color: #66b3ff;
}

/* ============================================
   LOGIN PAGE TEXT IMPROVEMENTS
   ============================================ */

.sign-area h2 {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sign-area .sign-hader h2 {
    font-weight: 600;
    margin-bottom: 10px;
}

.forgot-text {
    color: #fff;
}

.forgot-text a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    font-weight: 500;
}

.forgot-text a:hover {
    color: #fff;
}

.checkbox-replace .i-checks {
    color: #fff;
    font-weight: 500;
}

/* Login page form labels */
.sign-area .form-group label {
    color: #fff !important;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Error message styling */
span.error {
    color: #ff6b6b;
    font-size: 13px;
    display: block;
    margin-top: 5px;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
    .dashboard-page .widget-col-in {
        padding: 15px;
    }
    
    .dashboard-page .widget-col-in i {
        font-size: 28px;
    }
    
    .chart-title {
        font-size: 16px;
    }
}

/* ============================================
   FOOTER STYLING
   ============================================ */

.dashboard-page > div:last-child {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 4px;
}

html.dark .dashboard-page > div:last-child {
    background-color: #2a2a2a;
}

/* ============================================
   ADDITIONAL TEXT FIXES
   ============================================ */

/* Ensure all links in light theme are visible */
a {
    color: #0088cc;
}

a:hover {
    color: #006699;
}

/* Breadcrumb text */
.breadcrumb {
    background-color: transparent;
}

.breadcrumb > li,
.breadcrumb > li > a {
    color: #333;
}

.breadcrumb > .active {
    color: #666;
}

/* Alert boxes */
.alert {
    color: #333;
}

/* Page title */
.page-title {
    color: #fff !important;
}

/* Card and box titles */
h1, h2, h3, h4, h5, h6 {
    color: #333;
}

/* Content area text */
.content-body {
    color: #333;
}

/* DataTables text */
.dataTables_wrapper {
    color: #333;
}

.dataTables_info {
    color: #666 !important;
}

.dataTables_length label,
.dataTables_filter label {
    color: #333 !important;
}

/* Pagination */
.pagination > li > a,
.pagination > li > span {
    color: #0088cc;
}

.pagination > .active > a,
.pagination > .active > span {
    background-color: #0088cc;
    border-color: #0088cc;
}
