/* Dark Mode CSS Variables - Uniform #1f2937 Background */
[data-bs-theme="dark"],
.theme-dark {
    /* Main Colors - Uniform Dark Background */
    --maincolor: #3b82f6;
    --backupcolor: #3b82f6;
    --graycolor: #1f2937;
    --navcolor: #1f2937;
    --darkcolor: #1f2937;
    --lightcolor: #1f2937;
    --headingcolor: #ffffff;
    --bodycolor: #ffffff;
    --mutedcolor: #9ca3af;
    --greencolor: #10b981;
    --redcolor: #ef4444;
    --featuredtag: #ef4444;
    --new: #ef4444;
    --primaryfont: 'Manrope', sans-serif;
    --formborder: #4b5563;
    --formbg: #1f2937;
    --form-color: #ffffff;
    --inversecolor: #ffffff;
    --footerbg: #1f2937;
    --footercolor: #ffffff;
    
    /* Uniform Background Variables */
    --bg-primary: #1f2937;
    --bg-secondary: #1f2937;
    --bg-tertiary: #1f2937;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #9ca3af;
    --border-color: #4b5563;
    --border-light: #6b7280;
    --card-bg: #1f2937;
    --input-bg: #1f2937;
    --hover-bg: #1f2937;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    /* Enhanced Border and Shadow Variables for Distinction */
    --card-border: 1px solid #4b5563;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --form-border: 1px solid #4b5563;
    --form-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --hover-border: 1px solid #6b7280;
    --hover-shadow: 0 6px 8px -2px rgba(0, 0, 0, 0.4), 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    
    /* Additional Variables */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Dark Mode Styles - Uniform Background */
[data-bs-theme="dark"] body,
.theme-dark body {
    background: #1f2937 !important;
    color: #ffffff !important;
}

/* Global Uniform Background */
[data-bs-theme="dark"] *,
.theme-dark * {
    border-color: #4b5563 !important;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .container,
[data-bs-theme="dark"] .container-fluid,
[data-bs-theme="dark"] .row,
[data-bs-theme="dark"] [class*="col-"],
[data-bs-theme="dark"] div,
.theme-dark body,
.theme-dark .container,
.theme-dark .container-fluid,
.theme-dark .row,
.theme-dark [class*="col-"],
.theme-dark div {
    background: #1f2937 !important;
    color: #ffffff !important;
}

/* Cards - Uniform Background with Border Distinction */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modern-card {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card:hover,
[data-bs-theme="dark"] .modern-card:hover {
    border: 1px solid #6b7280 !important;
    box-shadow: 0 6px 8px -2px rgba(0, 0, 0, 0.4), 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .modern-card-header {
    background: #1f2937 !important;
    border-bottom: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card-body,
[data-bs-theme="dark"] .modern-card-body {
    background: #1f2937 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card-footer,
[data-bs-theme="dark"] .modern-card-footer {
    background: #1f2937 !important;
    border-top: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

/* Forms - Uniform Background with Enhanced Borders */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] input[type="text"],
[data-bs-theme="dark"] input[type="email"],
[data-bs-theme="dark"] input[type="password"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] input[type="search"],
[data-bs-theme="dark"] input[type="tel"],
[data-bs-theme="dark"] input[type="url"],
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] input[type="datetime-local"],
[data-bs-theme="dark"] input[type="month"],
[data-bs-theme="dark"] input[type="week"],
[data-bs-theme="dark"] input[type="time"],
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] select {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] input:focus,
[data-bs-theme="dark"] textarea:focus,
[data-bs-theme="dark"] select:focus {
    background: #1f2937 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25) !important;
}

[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] input::placeholder,
[data-bs-theme="dark"] textarea::placeholder {
    color: #9ca3af !important;
}

[data-bs-theme="dark"] label,
[data-bs-theme="dark"] .form-label {
    color: #ffffff !important;
}

/* Navigation - Uniform Background */
[data-bs-theme="dark"] .header {
    background: #1f2937 !important;
    border-bottom: 1px solid #4b5563 !important;
}

[data-bs-theme="dark"] .header.header-light {
    background: #1f2937 !important;
}

[data-bs-theme="dark"] .nav-menu > li > a {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .nav-menu > li > a:hover,
[data-bs-theme="dark"] .nav-menu > li > a:focus {
    color: #3b82f6 !important;
}

/* Dropdowns - Uniform Background with Enhanced Borders */
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .nav-dropdown,
[data-bs-theme="dark"] .nav-submenu {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .dropdown-item,
[data-bs-theme="dark"] .nav-dropdown > li > a,
[data-bs-theme="dark"] .nav-submenu > li > a {
    color: #ffffff !important;
    background: transparent !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .nav-dropdown > li > a:hover,
[data-bs-theme="dark"] .nav-dropdown > li > a:focus,
[data-bs-theme="dark"] .nav-submenu > li > a:hover,
[data-bs-theme="dark"] .nav-submenu > li > a:focus {
    background: #1f2937 !important;
    color: #3b82f6 !important;
    border: 1px solid #6b7280 !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #4b5563 !important;
}

/* Typography - White Text */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] p,
[data-bs-theme="dark"] span,
[data-bs-theme="dark"] strong,
[data-bs-theme="dark"] small,
[data-bs-theme="dark"] li,
[data-bs-theme="dark"] a {
    color: #ffffff !important;
}

[data-bs-theme="dark"] a:hover {
    color: #3b82f6 !important;
}

[data-bs-theme="dark"] .text-primary {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #9ca3af !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .text-white {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .text-light {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .text-body {
    color: #ffffff !important;
}

/* Background Overrides */
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-body,
[data-bs-theme="dark"] .gray,
[data-bs-theme="dark"] .gray-simple {
    background: #1f2937 !important;
}

/* Tables - Uniform Background with Enhanced Borders */
[data-bs-theme="dark"] .table {
    color: #ffffff !important;
    background: #1f2937 !important;
}

[data-bs-theme="dark"] .table th {
    color: #ffffff !important;
    background: #1f2937 !important;
    border-color: #4b5563 !important;
}

[data-bs-theme="dark"] .table td {
    color: #ffffff !important;
    background: #1f2937 !important;
    border-color: #4b5563 !important;
}

[data-bs-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background: #1f2937 !important;
    border: 1px solid #6b7280 !important;
    box-shadow: 0 6px 8px -2px rgba(0, 0, 0, 0.4), 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

/* Buttons - Enhanced with Borders */
[data-bs-theme="dark"] .btn {
    border-color: #4b5563 !important;
}

[data-bs-theme="dark"] .btn-whites {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-whites:hover {
    background: #1f2937 !important;
    border: 1px solid #6b7280 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .btn-light {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-light:hover {
    background: #1f2937 !important;
    border: 1px solid #6b7280 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .btn-secondary {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-secondary:hover {
    background: #1f2937 !important;
    border: 1px solid #6b7280 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}

/* Additional Universal Dark Mode Styles */
[data-bs-theme="dark"] .modal-content {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .modal-header {
    background: #1f2937 !important;
    border-bottom: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .modal-body {
    background: #1f2937 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .modal-footer {
    background: #1f2937 !important;
    border-top: 1px solid #4b5563 !important;
}

[data-bs-theme="dark"] .alert {
    background: #1f2937 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .pagination > li > a,
[data-bs-theme="dark"] .pagination > li > span {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] footer {
    background: #1f2937 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .search-form,
[data-bs-theme="dark"] .search-container {
    background: #1f2937 !important;
}

[data-bs-theme="dark"] .input-group-text {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .list-group-item {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .accordion-item {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
}

[data-bs-theme="dark"] .accordion-button {
    background: #1f2937 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .accordion-body {
    background: #1f2937 !important;
    color: #ffffff !important;
    border-top: 1px solid #4b5563 !important;
}

[data-bs-theme="dark"] .form-check-input {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
}

[data-bs-theme="dark"] .form-check-label {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .file-upload-area {
    background: #1f2937 !important;
    border: 2px dashed #4b5563 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .subject-card,
[data-bs-theme="dark"] .stats-card,
[data-bs-theme="dark"] .profile-container,
[data-bs-theme="dark"] .content-area {
    background: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .hero_banner {
    background: #1f2937 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .sidebar {
    background: #1f2937 !important;
    border-right: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

/* Custom Scrollbar */
[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #1f2937;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-toggle:hover {
    background: #1f2937;
    border: 1px solid #6b7280;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    color: #3b82f6;
}

.theme-toggle.dropdown-item {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
}

.theme-toggle.dropdown-item:hover {
    background: #1f2937;
    border: 1px solid #6b7280;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* Borders */
[data-bs-theme="dark"] .border {
    border-color: #4b5563 !important;
}

/* Base body transition for smooth theme switching */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}
