/* Base Styles - Dark Theme Default */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
    animation: fadeIn 0.6s ease-in-out;
}

/* Light Mode Override */
body.light-mode {
    background-color: #f8f9fa;
    color: #212529;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* Make all text elements bolder */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    animation: slideInUp 0.8s ease-out;
}

p, span, div, td, th, li, a {
    font-weight: 500;
}

/* Enhanced Navbar Styles - Dark Theme Default */
.navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background: linear-gradient(135deg, #1e40af, #1e3a8a) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
    transition: all 0.3s ease, box-shadow 0.3s ease;
    animation: slideInUp 0.5s ease-out;
    overflow: visible !important;
    z-index: 1050;
    position: relative;
    border: none;
}

/* Light Mode Navbar Override */
body.light-mode .navbar {
    background: linear-gradient(135deg, #0d6efd, #0056b3) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

/* Fix dropdown positioning and visibility - Dark Theme */
.navbar .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    z-index: 1060 !important;
    display: none;
    min-width: 200px;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: #e0e0e0;
    text-align: left;
    list-style: none;
    background-color: #1e1e1e;
    background-clip: padding-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

/* Light Mode Dropdown Override */
body.light-mode .navbar .dropdown-menu {
    color: #212529;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.navbar .dropdown-menu.show {
    display: block !important;
}

/* Ensure dropdown is positioned correctly */
.navbar .dropdown {
    position: relative;
}

/* Fix for user dropdown positioning */
.navbar .dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
}

/* Container fixes to prevent overflow clipping */
.container-fluid {
    overflow: visible !important;
}

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

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

.navbar .nav-item.dropdown {
    overflow: visible !important;
    position: relative; /* Proper positioning for dropdown */
}

/* Enhanced dropdown item styling - Dark Theme */
.navbar .dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 500;
    color: #e0e0e0;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: all 0.3s ease;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    color: #fff;
    background-color: rgba(30, 64, 175, 0.1);
    transform: translateX(5px);
}

.navbar .dropdown-item.active,
.navbar .dropdown-item:active {
    color: #fff;
    text-decoration: none;
    background-color: #1e40af;
}

/* Light Mode Dropdown Items */
body.light-mode .navbar .dropdown-item {
    color: #212529;
}

body.light-mode .navbar .dropdown-item:hover,
body.light-mode .navbar .dropdown-item:focus {
    color: #1e2125;
    background-color: #f8f9fa;
}

body.light-mode .navbar .dropdown-item.active,
body.light-mode .navbar .dropdown-item:active {
    color: #fff;
    background-color: #0d6efd;
}

.navbar .nav-link.active {
    font-weight: 700;
    color: #60a5fa !important;
    position: relative;
}

.navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #60a5fa;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    animation: expandWidth 0.5s ease-out forwards;
}

/* Light Mode Active Link */
body.light-mode .navbar .nav-link.active {
    color: #fff !important;
}

body.light-mode .navbar .nav-link.active::after {
    background-color: #fff;
}

@keyframes expandWidth {
    from { width: 0; }
    to { width: 80%; }
}

.navbar .nav-link {
    color: #d1d5db;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.navbar .nav-link:hover {
    color: #60a5fa;
    font-weight: 600;
    transform: translateY(-2px);
}

/* Light Mode Nav Links */
body.light-mode .navbar .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

body.light-mode .navbar .nav-link:hover {
    color: #fff;
}

.navbar-brand {
    font-weight: 700;
    color: #fff !important;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
    color: #fff !important;
}

/* Light Mode Brand */
body.light-mode .navbar-brand {
    color: #fff !important;
}

.card {
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    border: none;
    background-color: #1e1e1e;
    color: #e0e0e0;
    transition: all 0.3s ease;
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
}

/* Light Mode Cards */
body.light-mode .card {
    background-color: #fff;
    color: #212529;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body.light-mode .card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #252525;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    font-weight: 700;
    transition: all 0.3s ease;
}

/* Light Mode Card Header */
body.light-mode .card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #212529;
}

.card-title {
    font-weight: 700;
    animation: slideInLeft 0.8s ease-out;
}

.card-text {
    font-weight: 500;
    animation: fadeIn 1s ease-out;
}

.table {
    font-weight: 500;
    animation: slideInUp 0.8s ease-out;
    color: #e0e0e0;
    background-color: transparent;
}

.table tbody tr {
    transition: all 0.3s ease;
    background-color: #1e1e1e;
}

.table tbody tr:hover {
    transform: scale(1.01);
    background-color: rgba(30, 64, 175, 0.1) !important;
}

.table thead th {
    background-color: #252525;
    border-bottom: 2px solid #333;
    font-weight: 700;
    color: #e0e0e0;
    transition: background-color 0.3s ease;
}

.table tbody td {
    font-weight: 500;
    transition: all 0.3s ease;
    color: #e0e0e0;
    background-color: #1e1e1e;
    border-color: #333;
}

/* Light Mode Tables */
body.light-mode .table {
    color: #212529;
}

body.light-mode .table tbody tr {
    background-color: #fff;
}

body.light-mode .table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05) !important;
}

body.light-mode .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #212529;
}

body.light-mode .table tbody td {
    color: #212529;
    background-color: #fff;
    border-color: #dee2e6;
}

/* General Button Styles */
.btn {
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

/* Default Dark Theme Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    border-color: #1e40af;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    border-color: #1d4ed8;
    color: #fff;
}

.btn-outline-primary {
    color: #60a5fa;
    border-color: #60a5fa;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: #1e40af;
    border-color: #1e40af;
    color: #fff;
}

/* Light Mode Button Overrides */
body.light-mode .btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
    border-color: #0d6efd;
}

body.light-mode .btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7, #0d6efd);
    border-color: #0b5ed7;
}

body.light-mode .btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

body.light-mode .btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.form-label {
    font-weight: 600;
    animation: slideInLeft 0.6s ease-out;
}

.form-control, .form-select {
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid #333;
    background-color: #252525;
    color: #e0e0e0;
    border-radius: 0.5rem;
}

.form-control:focus, .form-select:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 0.25rem rgba(30, 64, 175, 0.25);
    border-color: #1e40af;
    background-color: #252525;
    color: #e0e0e0;
}

/* Light Mode Forms */
body.light-mode .form-control,
body.light-mode .form-select {
    border: 1px solid #ced4da;
    background-color: #fff;
    color: #212529;
}

body.light-mode .form-control:focus,
body.light-mode .form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    border-color: #0d6efd;
    background-color: #fff;
    color: #212529;
}

.badge {
    font-weight: 600;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.badge:hover {
    transform: scale(1.1);
}

.stat-card {
    border-left: 4px solid #4e73df;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Colorful background fills for different card types */
.stat-card.border-start-primary {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    border-left-color: #0d6efd;
}

.stat-card.border-start-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1) 0%, rgba(108, 117, 125, 0.05) 100%);
    border-left-color: #6c757d;
}

.stat-card.border-start-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(13, 202, 240, 0.05) 100%);
    border-left-color: #0dcaf0;
}

.stat-card.border-start-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    border-left-color: #dc3545;
}

.stat-card.border-start-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%);
    border-left-color: #198754;
}

.stat-card.border-start-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border-left-color: #ffc107;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left-width: 6px;
}

/* Enhanced hover effects for colored cards */
.stat-card.border-start-primary:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15) 0%, rgba(13, 110, 253, 0.08) 100%);
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.2);
}

.stat-card.border-start-secondary:hover {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.15) 0%, rgba(108, 117, 125, 0.08) 100%);
    box-shadow: 0 10px 25px rgba(108, 117, 125, 0.2);
}

.stat-card.border-start-info:hover {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.15) 0%, rgba(13, 202, 240, 0.08) 100%);
    box-shadow: 0 10px 25px rgba(13, 202, 240, 0.2);
}

.stat-card.border-start-danger:hover {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15) 0%, rgba(220, 53, 69, 0.08) 100%);
    box-shadow: 0 10px 25px rgba(220, 53, 69, 0.2);
}

.stat-card.border-start-success:hover {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.15) 0%, rgba(25, 135, 84, 0.08) 100%);
    box-shadow: 0 10px 25px rgba(25, 135, 84, 0.2);
}

.stat-card.border-start-warning:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.08) 100%);
    box-shadow: 0 10px 25px rgba(255, 193, 7, 0.2);
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:active {
    transform: translateY(-4px) scale(1.01);
}

.stat-card h3, .stat-card p {
    font-weight: 600;
    transition: all 0.3s ease;
}

.stat-card:hover h3 {
    transform: scale(1.1);
}

.icon-circle {
    transition: all 0.3s ease;
}

.stat-card:hover .icon-circle {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.stat-value {
    transition: all 0.3s ease;
}

.stat-card:hover .stat-value {
    animation: bounce 0.6s ease;
}

main {
    position: relative;
    z-index: 1;
    animation: slideInUp 0.8s ease-out;
}

/* Staggered animation for dashboard cards */
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading animation */
.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Hover effects for interactive elements */
a:not(.btn) {
    transition: all 0.3s ease;
}

a:not(.btn):hover {
    color: #0d6efd !important;
    text-decoration: underline !important;
}

/* Page transition effects */
.page-enter {
    animation: slideInUp 0.6s ease-out;
}

.list-group-item {
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: rgba(0, 123, 255, 0.05) !important;
    transform: translateX(5px);
    border-left: 3px solid #0d6efd;
}

/* Toast animations */
.toast {
    animation: slideInUp 0.5s ease-out;
}

.toast.show {
    animation: slideInUp 0.5s ease-out;
}

.toast.hide {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* Dropdown animations */
.dropdown-menu {
    animation: fadeIn 0.3s ease-out;
}

.dropdown-item {
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    transform: translateX(5px);
}

/* Light Mode Override Styles */

body.light-mode {
    background-color: #f8f9fa;
    color: #212529;
}

body.light-mode .bg-light {
    background-color: #f8f9fa !important;
}

body.light-mode .navbar,
body.light-mode .card,
body.light-mode .modal-content,
body.light-mode .dropdown-menu {
    background-color: #fff;
    border-color: #dee2e6 !important;
}

body.light-mode .navbar-light .navbar-brand,
body.light-mode .navbar-light .nav-link,
body.light-mode .text-dark,
body.light-mode .dropdown-item,
body.light-mode .table,
body.light-mode .card-header,
body.light-mode .modal-title {
    color: #212529 !important;
}

body.light-mode .card-header {
    background-color: #fff;
    border-bottom-color: rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

body.light-mode .form-control,
body.light-mode .form-select {
    background-color: #fff;
    color: #212529;
    border-color: #ced4da;
}

body.light-mode .form-control:focus,
body.light-mode .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

body.light-mode .dropdown-item:hover,
body.light-mode .dropdown-item:focus {
    background-color: #f8f9fa;
}

/* Additional Light Mode Fixes */
body.light-mode .list-group-item {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

body.light-mode .list-group-item:hover {
    background-color: rgba(0, 123, 255, 0.05) !important;
}

body.light-mode .badge {
    color: #fff !important;
}

body.light-mode .badge.bg-light {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

body.light-mode .text-muted {
    color: #6c757d !important;
}

body.light-mode .border-top {
    border-color: #dee2e6 !important;
}

body.light-mode .btn-outline-secondary {
    color: #6c757d !important;
    border-color: #6c757d !important;
}

body.light-mode .btn-outline-secondary:hover {
    background-color: #6c757d !important;
    color: #fff !important;
}

body.light-mode .btn-close {
    filter: none;
}

/* Fix borders and dividers */
body.light-mode .border-bottom {
    border-color: #dee2e6 !important;
}

body.light-mode hr {
    border-color: #dee2e6 !important;
}

/* Fix any remaining white backgrounds */
body.light-mode .bg-white {
    background-color: #fff !important;
}

body.light-mode .text-white {
    color: #fff !important;
}

/* Fix icon circles in light mode */
body.light-mode .icon-circle {
    background-color: #f8f9fa !important;
}

/* Ensure all text is properly colored in light mode */
body.light-mode h1, body.light-mode h2, body.light-mode h3, body.light-mode h4, body.light-mode h5, body.light-mode h6,
body.light-mode p, body.light-mode span, body.light-mode div, body.light-mode td, body.light-mode th, body.light-mode li, body.light-mode a {
    color: #212529 !important;
}

/* Fix specific dashboard elements in light mode */
body.light-mode .stat-label {
    color: #6c757d !important;
}

body.light-mode .stat-value {
    color: #212529 !important;
}

/* Fix modal content in light mode */
body.light-mode .modal-content {
    background-color: #fff !important;
    color: #212529 !important;
}

body.light-mode .modal-header {
    background-color: #fff !important;
    border-bottom-color: #dee2e6 !important;
    color: #212529 !important;
}

body.light-mode .modal-body {
    background-color: #fff !important;
    color: #212529 !important;
}

body.light-mode .modal-footer {
    background-color: #fff !important;
    border-top-color: #dee2e6 !important;
    color: #212529 !important;
}

/* Fix close buttons in light mode */
body.light-mode .btn-close {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m.235.624l15.141 15.142-.707.707L-.472 1.331.235.624z'/%3e%3cpath d='m15.376.624l-15.141 15.142.707.707L15.883 1.331 15.376.624z'/%3e%3c/svg%3e") !important;
}

/* Fix input group text in light mode */
body.light-mode .input-group-text {
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
    color: #495057 !important;
}

/* Default Dark Theme Nav Tabs */
.nav-tabs {
    border-color: #333 !important;
}

.nav-tabs .nav-link {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #adb5bd !important;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
    background-color: #252525 !important;
    border-color: #333 #333 #252525 !important;
    color: #e0e0e0 !important;
}

.nav-tabs .nav-link:hover {
    background-color: #252525 !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

/* Fix nav tabs in light mode */
body.light-mode .nav-tabs {
    border-color: #dee2e6 !important;
}

body.light-mode .nav-tabs .nav-link {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}

body.light-mode .nav-tabs .nav-link.active {
    background-color: #fff !important;
    border-color: #dee2e6 #dee2e6 #fff !important;
    color: #495057 !important;
}

body.light-mode .nav-tabs .nav-link:hover {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}

/* Fix toast notifications in light mode */
body.light-mode .toast {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}

body.light-mode .toast-header {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}

body.light-mode .toast-body {
    background-color: #fff !important;
    color: #495057 !important;
}

/* Additional Dark Mode Fixes */
.dark-mode .list-group-item {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

.dark-mode .list-group-item:hover {
    background-color: #252525 !important;
}

.dark-mode .badge {
    color: #000 !important;
}

.dark-mode .badge.bg-light {
    background-color: #6c757d !important;
    color: #fff !important;
}

.dark-mode .text-muted {
    color: #adb5bd !important;
}

.dark-mode .border-top {
    border-color: #333 !important;
}

.dark-mode .btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

.dark-mode .btn-outline-primary:hover {
    background-color: #0d6efd;
    color: #fff;
}

.dark-mode .stat-card {
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

/* Dark mode colored backgrounds */
.dark-mode .stat-card.border-start-primary {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.2) 0%, rgba(13, 110, 253, 0.1) 100%) !important;
}

.dark-mode .stat-card.border-start-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.2) 0%, rgba(108, 117, 125, 0.1) 100%) !important;
}

.dark-mode .stat-card.border-start-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.2) 0%, rgba(13, 202, 240, 0.1) 100%) !important;
}

.dark-mode .stat-card.border-start-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(220, 53, 69, 0.1) 100%) !important;
}

.dark-mode .stat-card.border-start-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.2) 0%, rgba(25, 135, 84, 0.1) 100%) !important;
}

.dark-mode .stat-card.border-start-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%) !important;
}

/* Dark mode hover effects */
.dark-mode .stat-card.border-start-primary:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.25) 0%, rgba(13, 110, 253, 0.15) 100%) !important;
}

.dark-mode .stat-card.border-start-secondary:hover {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.25) 0%, rgba(108, 117, 125, 0.15) 100%) !important;
}

.dark-mode .stat-card.border-start-info:hover {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.25) 0%, rgba(13, 202, 240, 0.15) 100%) !important;
}

.dark-mode .stat-card.border-start-danger:hover {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.25) 0%, rgba(220, 53, 69, 0.15) 100%) !important;
}

.dark-mode .stat-card.border-start-success:hover {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.25) 0%, rgba(25, 135, 84, 0.15) 100%) !important;
}

.dark-mode .stat-card.border-start-warning:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25) 0%, rgba(255, 193, 7, 0.15) 100%) !important;
}

.dark-mode .stat-card h3,
.dark-mode .stat-card p {
    color: #e0e0e0 !important;
}

.dark-mode small {
    color: #adb5bd !important;
}

.dark-mode .input-group-text {
    background-color: #252525 !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

/* Fix table headers in dark mode */
.dark-mode .table thead th {
    background-color: #252525 !important;
    color: #e0e0e0 !important;
    border-color: #333 !important;
}

.dark-mode .table-light {
    background-color: #252525 !important;
    color: #e0e0e0 !important;
}

/* Fix nav tabs in dark mode */
.dark-mode .nav-tabs {
    border-color: #333 !important;
}

.dark-mode .nav-tabs .nav-link {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #adb5bd !important;
}

.dark-mode .nav-tabs .nav-link.active {
    background-color: #252525 !important;
    border-color: #333 #333 #252525 !important;
    color: #e0e0e0 !important;
}

.dark-mode .nav-tabs .nav-link:hover {
    background-color: #252525 !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

/* Fix toast notifications in dark mode */
.dark-mode .toast {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

.dark-mode .toast-header {
    background-color: #252525 !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

.dark-mode .toast-body {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

/* Fix dropdown menus */
.dark-mode .dropdown-menu {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

.dark-mode .dropdown-item {
    color: #e0e0e0 !important;
}

.dark-mode .dropdown-item:hover,
.dark-mode .dropdown-item:focus {
    background-color: #252525 !important;
    color: #e0e0e0 !important;
}

.dark-mode .dropdown-item.active {
    background-color: #0d6efd !important;
    color: #fff !important;
}

/* Fix buttons in dark mode */
.dark-mode .btn-outline-secondary {
    color: #6c757d !important;
    border-color: #6c757d !important;
}

.dark-mode .btn-outline-secondary:hover {
    background-color: #6c757d !important;
    color: #fff !important;
}

/* Fix borders and dividers */
.dark-mode .border-bottom {
    border-color: #333 !important;
}

.dark-mode hr {
    border-color: #333 !important;
}

/* Fix any remaining white backgrounds */
.dark-mode .bg-white {
    background-color: #1e1e1e !important;
}

.dark-mode .text-white {
    color: #e0e0e0 !important;
}

/* Fix icon circles in dark mode */
.dark-mode .icon-circle {
    background-color: #252525 !important;
}

/* Ensure all text is properly colored */
.dark-mode h1, .dark-mode h2, .dark-mode h3, .dark-mode h4, .dark-mode h5, .dark-mode h6,
.dark-mode p, .dark-mode span, .dark-mode div, .dark-mode td, .dark-mode th, .dark-mode li, .dark-mode a {
    color: #e0e0e0 !important;
}

/* Fix specific dashboard elements */
.dark-mode .stat-label {
    color: #adb5bd !important;
}

.dark-mode .stat-value {
    color: #e0e0e0 !important;
}

/* Fix table body rows in dark mode */
.dark-mode .table tbody tr {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

.dark-mode .table tbody td {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #333 !important;
}

.dark-mode .table-hover tbody tr:hover td {
    background-color: #252525 !important;
    color: #e0e0e0 !important;
}

/* Fix alternating row colors */
.dark-mode .table-striped tbody tr:nth-of-type(odd) td {
    background-color: #252525 !important;
}

.dark-mode .table-striped tbody tr:nth-of-type(even) td {
    background-color: #1e1e1e !important;
}

/* Fix table borders */
.dark-mode .table td, .dark-mode .table th {
    border-color: #333 !important;
}

/* Login Page Centering - Dark Theme Default */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #121212 0%, #1e1e1e 100%);
}

.login-card {
    max-width: 400px;
    width: 100%;
    box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.5);
    border-radius: 1rem;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
    border: none;
    backdrop-filter: blur(10px);
    background-color: #1e1e1e;
}

.login-card .card-header {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: white;
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: none;
    position: relative;
}

.login-card .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
}

.login-card .card-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.login-card .card-body {
    padding: 2rem;
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.login-card .form-control {
    border-radius: 0.5rem;
    border: 2px solid #333;
    background-color: #252525;
    color: #e0e0e0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-card .form-control:focus {
    border-color: #1e40af;
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.25);
    transform: translateY(-2px);
    background-color: #252525;
    color: #e0e0e0;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-card .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(30, 64, 175, 0.4);
}

.login-card .btn-primary:active {
    transform: translateY(-1px);
}

.login-card .form-label {
    color: #e0e0e0;
    font-weight: 600;
}

/* Light Mode Login Styles */
body.light-mode .login-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

body.light-mode .login-card {
    background-color: #fff;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.1);
}

body.light-mode .login-card .card-body {
    background-color: #fff;
    color: #212529;
}

body.light-mode .login-card .card-header {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
}

body.light-mode .login-card .form-control {
    background-color: #fff;
    border-color: #e9ecef;
    color: #212529;
}

body.light-mode .login-card .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    background-color: #fff;
    color: #212529;
}

body.light-mode .login-card .form-label {
    color: #212529;
}

body.light-mode .login-card .btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
}

body.light-mode .login-card .btn-primary:hover {
    box-shadow: 0 0.5rem 1rem rgba(13, 110, 253, 0.3);
}

/* Responsive Design for Login */
@media (max-width: 576px) {
    .login-container {
        padding: 1rem 0.5rem;
    }
    
    .login-card {
        max-width: 100%;
        margin: 0;
    }
    
    .login-card .card-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .login-card .card-header h1 {
        font-size: 1.5rem;
    }
    
    .login-card .card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-card .card-body {
        padding: 1rem;
    }
    
    .login-card .card-header {
        padding: 1rem;
    }
}

/* Default Dark Theme Modal Styles */
.modal-content {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border: 1px solid #333 !important;
    z-index: 1060;
}

.modal-header {
    background-color: #252525 !important;
    border-bottom-color: #333 !important;
    color: #e0e0e0 !important;
}

.modal-body {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

.modal-footer {
    background-color: #252525 !important;
    border-top-color: #333 !important;
    color: #e0e0e0 !important;
}

.modal-title {
    color: #e0e0e0 !important;
}

/* Modal input focus fixes */
.modal .form-control {
    z-index: 1061 !important;
    position: relative;
}

.modal .form-control:focus {
    z-index: 1062 !important;
    outline: none !important;
    box-shadow: 0 0 0 0.25rem rgba(30, 64, 175, 0.25) !important;
    border-color: #1e40af !important;
}

.modal .form-select {
    z-index: 1061 !important;
    position: relative;
}

.modal .form-select:focus {
    z-index: 1062 !important;
    outline: none !important;
    box-shadow: 0 0 0 0.25rem rgba(30, 64, 175, 0.25) !important;
    border-color: #1e40af !important;
}

/* Ensure modal backdrop doesn't interfere with inputs */
.modal-backdrop {
    z-index: 1055 !important;
}

.modal {
    z-index: 1060 !important;
}

.modal.show {
    z-index: 1060 !important;
}

/* Prevent modal content from interfering with form interactions */
.modal-content {
    pointer-events: all !important;
    position: relative;
}

.modal-dialog {
    pointer-events: none;
}

.modal-dialog .modal-content {
    pointer-events: all;
}

/* Ensure form elements are fully interactive */
.modal .form-control,
.modal .form-select,
.modal .btn,
.modal label {
    pointer-events: all !important;
    user-select: text !important;
}

.modal input[type="email"] {
    pointer-events: all !important;
    cursor: text !important;
}

.modal select {
    pointer-events: all !important;
    cursor: pointer !important;
}

/* Default Dark Theme Close Button */
.btn-close {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='m.235.624l15.141 15.142-.707.707L-.472 1.331.235.624z'/%3e%3cpath d='m15.376.624l-15.141 15.142.707.707L15.883 1.331 15.376.624z'/%3e%3c/svg%3e") !important;
    filter: invert(1) brightness(100%);
}

/* Default Dark Theme Tab Content */
.tab-content {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border: 1px solid #333 !important;
    border-top: none !important;
    padding: 1rem !important;
}

/* Light Mode Tab Content Override */
body.light-mode .tab-content {
    background-color: #fff !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

/* Default Dark Theme Alert Styles */
.alert {
    background-color: #252525 !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

.alert-primary {
    background-color: rgba(30, 64, 175, 0.2) !important;
    border-color: #1e40af !important;
    color: #93c5fd !important;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.2) !important;
    border-color: #198754 !important;
    color: #86efac !important;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
    border-color: #ffc107 !important;
    color: #fde047 !important;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.2) !important;
    border-color: #dc3545 !important;
    color: #fca5a5 !important;
}

/* Light Mode Alert Overrides */
body.light-mode .alert {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
}

body.light-mode .alert-primary {
    background-color: #cfe2ff !important;
    border-color: #b6d4fe !important;
    color: #004085 !important;
}

body.light-mode .alert-success {
    background-color: #d1e7dd !important;
    border-color: #badbcc !important;
    color: #0f5132 !important;
}

body.light-mode .alert-warning {
    background-color: #fff3cd !important;
    border-color: #ffecb5 !important;
    color: #664d03 !important;
}

body.light-mode .alert-danger {
    background-color: #f8d7da !important;
    border-color: #f5c2c7 !important;
    color: #721c24 !important;
}

/* Print Styles */
@media print {
    .no-print, .no-print * {
        display: none !important;
    }
    
    .card, .table {
        border: 1px solid #dee2e6;
    }
}

/* Responsive animations */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Additional Dark Theme Fixes for Common Bootstrap Elements */

/* Ensure all Bootstrap default backgrounds are dark */
.bg-light {
    background-color: #252525 !important;
}

.text-dark {
    color: #e0e0e0 !important;
}

.text-muted {
    color: #adb5bd !important;
}

/* Fix pagination */
.pagination .page-link {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

.pagination .page-link:hover {
    background-color: #252525 !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

.pagination .page-item.active .page-link {
    background-color: #1e40af !important;
    border-color: #1e40af !important;
    color: #fff !important;
}

/* Fix breadcrumbs */
.breadcrumb {
    background-color: #252525 !important;
}

.breadcrumb-item a {
    color: #60a5fa !important;
}

.breadcrumb-item.active {
    color: #e0e0e0 !important;
}

/* Fix progress bars */
.progress {
    background-color: #333 !important;
}

/* Fix accordion */
.accordion-item {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

.accordion-button {
    background-color: #252525 !important;
    color: #e0e0e0 !important;
    border-color: #333 !important;
}

.accordion-button:not(.collapsed) {
    background-color: #1e40af !important;
    color: #fff !important;
}

.accordion-body {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

/* Fix list groups */
.list-group-item {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

.list-group-item:hover {
    background-color: #252525 !important;
}

.list-group-item.active {
    background-color: #1e40af !important;
    border-color: #1e40af !important;
    color: #fff !important;
}

/* Light Mode Overrides for all the above */
body.light-mode .bg-light {
    background-color: #f8f9fa !important;
}

body.light-mode .text-dark {
    color: #212529 !important;
}

body.light-mode .text-muted {
    color: #6c757d !important;
}

body.light-mode .pagination .page-link {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    color: #0d6efd !important;
}

body.light-mode .pagination .page-link:hover {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #0a58ca !important;
}

body.light-mode .pagination .page-item.active .page-link {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}

body.light-mode .breadcrumb {
    background-color: #f8f9fa !important;
}

body.light-mode .breadcrumb-item a {
    color: #0d6efd !important;
}

body.light-mode .breadcrumb-item.active {
    color: #6c757d !important;
}

body.light-mode .progress {
    background-color: #e9ecef !important;
}

body.light-mode .accordion-item {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
}

body.light-mode .accordion-button {
    background-color: #fff !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

body.light-mode .accordion-button:not(.collapsed) {
    background-color: #f8f9fa !important;
    color: #0c63e4 !important;
}

body.light-mode .accordion-body {
    background-color: #fff !important;
    color: #212529 !important;
}

body.light-mode .list-group-item {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

body.light-mode .list-group-item:hover {
    background-color: #f8f9fa !important;
}

body.light-mode .list-group-item.active {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}