/* ═══════════════════════════════════════════════════════════
   Theme System - Dark Mode / Light Mode Support
   Task 26: Dark Mode / Light Mode Support
   ═══════════════════════════════════════════════════════════ */

/* ══════════════ Theme Transitions ══════════════ */
/* Global solution: Apply smooth transitions to ALL elements when transitioning */
/* This ensures everything changes together as one synchronized block */

/* Apply transitions to root and body first */
html.theme-transitioning,
html.theme-transitioning body {
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important,
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Apply transitions to ALL elements and pseudo-elements */
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important,
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important,
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important,
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important,
                fill 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important,
                stroke 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important,
                outline-color 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Force GPU acceleration for smoother, synchronized transitions */
html.theme-transitioning {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

html.theme-transitioning body {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Optimize repaints - batch all style recalculations */
html.theme-transitioning {
    contain: layout style;
}

/* Ensure images and media also transition smoothly */
html.theme-transitioning img,
html.theme-transitioning svg,
html.theme-transitioning video,
html.theme-transitioning iframe,
html.theme-transitioning canvas {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ══════════════ Light Mode (Default) ══════════════ */
:root {
    /* Primary Colors */
    --theme-primary: #D7263D; /* أحمر توتي */
    --theme-accent: #0D6EFD; /* أزرق ملكى (Bootstrap blue) */
    --theme-secondary: #FF7F50; /* كورال للتفاصيل البسيطة */
    
    /* Background Colors */
    --theme-bg-primary: #FFFFFF;
    --theme-bg-secondary: #FFF7F5; /* خلفية عاجى وردى */
    --theme-bg-tertiary: #F8F9FA;
    
    /* Text Colors */
    --theme-text-primary: #333333;
    --theme-text-secondary: #6C757D;
    --theme-text-muted: #868E96;
    
    /* Border Colors */
    --theme-border: #E9E9E9;
    --theme-border-light: #F0F0F0;
    --theme-border-dark: #DEE2E6;
    
    /* Shadow Colors */
    --theme-shadow-sm: rgba(0, 0, 0, 0.05);
    --theme-shadow-md: rgba(0, 0, 0, 0.1);
    --theme-shadow-lg: rgba(0, 0, 0, 0.15);
    
    /* Status Colors */
    --theme-success: #28A745;
    --theme-danger: #DC3545;
    --theme-warning: #FFC107;
    --theme-info: #17A2B8;
    
    /* Sky Colors (for specific UI elements) */
    --theme-sky-light: #E0F7FA;
    --theme-sky-medium: #B2EBF2;
    
    /* Overlay Colors */
    --theme-overlay: rgba(255, 255, 255, 0.6);
    --theme-backdrop: rgba(0, 0, 0, 0.5);
    
    /* Override Bootstrap's dropdown hover CSS variables - use red background like nav-link */
    --bs-dropdown-link-hover-bg: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    --bs-dropdown-link-hover-color: var(--primary) !important; /* Same as nav-link hover */
    --bs-tertiary-bg: rgba(215, 38, 61, 0.08) !important; /* Override tertiary-bg used by dropdown hover */
}

/* ══════════════ Dark Mode ══════════════ */
[data-theme="dark"] {
    /* Primary Colors - Adjusted for dark mode */
    --theme-primary: #FF6B7D; /* Lighter red for better contrast */
    --theme-accent: #4DABF7; /* Lighter blue */
    --theme-secondary: #FF9F6B; /* Lighter coral */
    
    /* Background Colors */
    --theme-bg-primary: #1A1A1A;
    --theme-bg-secondary: #242424;
    --theme-bg-tertiary: #2D2D2D;
    
    /* Text Colors */
    --theme-text-primary: #E9ECEF;
    --theme-text-secondary: #ADB5BD;
    --theme-text-muted: #868E96;
    
    /* Border Colors */
    --theme-border: #3A3A3A;
    --theme-border-light: #2D2D2D;
    --theme-border-dark: #4A4A4A;
    
    /* Shadow Colors - Darker shadows for dark mode */
    --theme-shadow-sm: rgba(0, 0, 0, 0.3);
    --theme-shadow-md: rgba(0, 0, 0, 0.4);
    --theme-shadow-lg: rgba(0, 0, 0, 0.5);
    
    /* Status Colors - Adjusted for dark mode */
    --theme-success: #51CF66;
    --theme-danger: #FF6B6B;
    --theme-warning: #FFD43B;
    --theme-info: #4DABF7;
    
    /* Sky Colors - Darker for dark mode */
    --theme-sky-light: #1E3A3F;
    --theme-sky-medium: #2D4A4F;
    
    /* Overlay Colors */
    --theme-overlay: rgba(0, 0, 0, 0.6);
    --theme-backdrop: rgba(0, 0, 0, 0.7);
    
    /* Override Bootstrap's dropdown hover CSS variables - use red background like nav-link */
    --bs-dropdown-link-hover-bg: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    --bs-dropdown-link-hover-color: var(--primary) !important; /* Same as nav-link hover */
    --bs-tertiary-bg: rgba(215, 38, 61, 0.08) !important; /* Override tertiary-bg used by dropdown hover */
}

/* Auto mode removed - only light and dark modes supported */

/* ══════════════ Smooth Transitions ══════════════ */
/* Apply smooth transitions for theme changes */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Disable transitions for specific elements to prevent performance issues */
*:focus,
*:active,
input,
textarea,
select,
button,
a,
img,
svg,
iframe,
video {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Disable transitions during initial page load to prevent flash */
body.loading * {
    transition: none !important;
}

/* ══════════════ Apply Theme Variables to Existing Styles ══════════════ */
body {
    background-color: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
}

/* Navbar */
.navbar {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

.navbar-light {
    background-color: var(--theme-bg-primary) !important;
}

.navbar .navbar-brand,
.navbar .nav-link {
    color: var(--theme-text-primary) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--theme-accent) !important;
}

.navbar .navbar-toggler {
    border-color: var(--theme-border);
}

.navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(33, 37, 41, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="dark"] .navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(233, 236, 239, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Ensure navbar text colors work in dark mode */
[data-theme="dark"] .navbar .navbar-brand,
[data-theme="dark"] .navbar .nav-link {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .navbar .text-primary {
    color: var(--theme-primary) !important;
}

/* Cards */
.card,
.form-section {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

.card-header {
    background-color: var(--theme-bg-secondary) !important;
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

.card-header.bg-light {
    background-color: var(--theme-bg-secondary) !important;
    color: var(--theme-text-primary);
}

.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-danger,
.card-header.bg-warning,
.card-header.bg-info {
    /* Keep original colors for colored headers */
}

.card-body {
    color: var(--theme-text-primary);
}

.card-text {
    color: var(--theme-text-secondary);
}

/* External Auth Buttons Section */
.form-section {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary);
}

.form-section.bg-white {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary);
}

.form-section h5,
.form-section .text-dark {
    color: var(--theme-text-primary) !important;
}

.form-section .text-muted {
    color: var(--theme-text-secondary) !important;
}

/* Footer */
.footer {
    background-color: var(--theme-bg-primary);
    border-color: var(--theme-border);
}

/* Profile Cards */
.profile-card {
    background-color: var(--theme-bg-primary);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

/* Text Colors */
.text-muted {
    color: var(--theme-text-muted) !important;
}

/* Borders */
.border-bottom {
    border-color: var(--theme-border) !important;
}

/* Shadows */
.card,
.form-section,
.navbar,
.footer {
    box-shadow: 0 2px 8px var(--theme-shadow-sm);
}

.profile-card:hover {
    box-shadow: 0 12px 28px var(--theme-shadow-md);
}

/* Overlays */
.loading-overlay {
    background: var(--theme-overlay);
}

/* Pagination */
.pagination-wrapper {
    background-color: var(--theme-bg-primary);
    border-top-color: var(--theme-border);
}

/* Modal */
.modal-content {
    background-color: var(--theme-bg-primary);
    color: var(--theme-text-primary);
}

.modal-header {
    border-bottom-color: var(--theme-border);
}

.modal-footer {
    border-top-color: var(--theme-border);
}

/* Form Controls */
.form-control,
.form-select {
    background-color: var(--theme-bg-primary);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--theme-bg-primary);
    border-color: var(--theme-accent);
    color: var(--theme-text-primary);
}

.form-control::placeholder {
    color: var(--theme-text-muted);
}

/* Buttons - Keep original colors but use theme variables where appropriate */
.btn-primary {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
    opacity: 0.9;
}

/* Dropdown */
.dropdown-menu {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 4px 12px var(--theme-shadow-md, rgba(0, 0, 0, 0.15)) !important;
}

/* CRITICAL: Override Bootstrap's CSS variable usage for dropdown hover - must come before .dropdown-item rules */
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Override var(--bs-dropdown-link-hover-bg) */
    color: var(--primary) !important; /* Override var(--bs-dropdown-link-hover-color) */
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Override var(--bs-dropdown-link-hover-bg) */
    color: var(--primary) !important; /* Override var(--bs-dropdown-link-hover-color) */
}

/* Force dark mode for dropdowns - HIGH SPECIFICITY */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .dropdown-menu.show,
[data-theme="dark"] .dropdown-menu[data-bs-popper],
[data-theme="dark"] .dropdown-menu[style*="position"],
[data-theme="dark"] .dropdown-menu[style*="background"] {
    background-color: #1A1A1A !important; /* Force dark background */
    border-color: #3A3A3A !important; /* Force dark border */
    color: #E9ECEF !important; /* Force light text */
}

.dropdown-item {
    color: var(--theme-text-primary) !important;
    background-color: transparent !important;
}

/* Light mode - Force dark text for non-active items (override any inline styles) */
.dropdown-item:not(.active):not(:hover):not(:focus) {
    color: var(--theme-text-primary) !important;
    background-color: transparent !important;
}

/* Light mode - Override inline styles that set light colors (like rgb(233, 236, 239)) */
.dropdown-item:not(.active)[style*="color"]:not(:hover):not(:focus) {
    color: var(--theme-text-primary) !important;
}

.dropdown-item:not(.active)[style*="rgb(233, 236, 239)"]:not(:hover):not(:focus) {
    color: var(--theme-text-primary) !important;
}

.dropdown-item:not(.active)[style*="E9ECEF"]:not(:hover):not(:focus) {
    color: var(--theme-text-primary) !important;
}

/* Light mode - Override icon colors in non-active items */
.dropdown-item:not(.active) i[style*="color"]:not(:hover):not(:focus) {
    color: var(--theme-text-primary) !important;
}

.dropdown-item:not(.active) i[style*="rgb(233, 236, 239)"]:not(:hover):not(:focus) {
    color: var(--theme-text-primary) !important;
}

.dropdown-item:not(.active) i[style*="E9ECEF"]:not(:hover):not(:focus) {
    color: var(--theme-text-primary) !important;
}

/* Dropdown item hover - same as nav-link - RED BACKGROUND for ALL items (active and non-active) */
.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:hover:not(.active),
.dropdown-item:focus:not(.active),
.dropdown-item.active:hover,
.dropdown-item.active:focus,
a.dropdown-item:hover,
a.dropdown-item:focus,
a.dropdown-item.active:hover,
a.dropdown-item.active:focus {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover - RED for ALL items */
    color: var(--primary) !important; /* Same as nav-link hover */
    text-decoration: none !important;
    background: rgba(215, 38, 61, 0.08) !important; /* Override background shorthand */
}

/* Force override Bootstrap's default white/light background on hover - ALL items */
.dropdown-item:hover[style*="background"],
.dropdown-item:focus[style*="background"],
.dropdown-item:hover[style*="background-color"],
.dropdown-item:focus[style*="background-color"],
.dropdown-item:hover[style*="transparent"],
.dropdown-item:focus[style*="transparent"],
.dropdown-item:hover[style*="rgb(233, 236, 239)"],
.dropdown-item:focus[style*="rgb(233, 236, 239)"],
.dropdown-item.active:hover[style*="background"],
.dropdown-item.active:focus[style*="background"],
.dropdown-item.active:hover[style*="background-color"],
.dropdown-item.active:focus[style*="background-color"],
.dropdown-item[data-hover-styled]:hover,
.dropdown-item[data-hover-styled]:focus,
.dropdown-item[data-hover-styled]:hover[style],
.dropdown-item[data-hover-styled]:focus[style],
a.dropdown-item[data-hover-styled]:hover,
a.dropdown-item[data-hover-styled]:focus,
a.dropdown-item[data-hover-styled]:hover[style],
a.dropdown-item[data-hover-styled]:focus[style] {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover - RED - Override inline !important */
    color: var(--primary) !important; /* Same as nav-link hover - Override inline !important */
    background: rgba(215, 38, 61, 0.08) !important; /* Override background shorthand */
}

/* Override icon colors with inline styles on hover */
.dropdown-item:hover i[style],
.dropdown-item:focus i[style],
.dropdown-item:hover i[style*="color"],
.dropdown-item:focus i[style*="color"],
.dropdown-item:hover i[style*="rgb(233, 236, 239)"],
.dropdown-item:focus i[style*="rgb(233, 236, 239)"],
.dropdown-item[data-hover-styled]:hover i,
.dropdown-item[data-hover-styled]:focus i {
    color: var(--primary) !important; /* Override inline icon color on hover */
}

/* Active item - show accent color when NOT hovered */
.dropdown-item.active {
    background-color: var(--theme-accent) !important;
    color: #fff !important;
}

/* Active item hover - show red like other items */
.dropdown-item.active:hover,
.dropdown-item.active:focus {
    background-color: rgba(215, 38, 61, 0.08) !important; /* RED hover like other items */
    color: var(--primary) !important; /* Same as nav-link hover */
}

.dropdown-divider {
    border-top-color: var(--theme-border) !important;
    margin: 0.5rem 0 !important;
}

/* Dark mode hover - same as nav-link hover - RED BACKGROUND for ALL items (active and non-active) */
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus,
[data-theme="dark"] .dropdown-item:hover:not(.active),
[data-theme="dark"] .dropdown-item:focus:not(.active),
[data-theme="dark"] .dropdown-item.active:hover,
[data-theme="dark"] .dropdown-item.active:focus,
[data-theme="dark"] a.dropdown-item:hover,
[data-theme="dark"] a.dropdown-item:focus,
[data-theme="dark"] a.dropdown-item.active:hover,
[data-theme="dark"] a.dropdown-item.active:focus {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover - RED for ALL items */
    color: var(--primary) !important; /* Same as nav-link hover */
    opacity: 1 !important;
    background: rgba(215, 38, 61, 0.08) !important; /* Override background shorthand */
}

[data-theme="dark"] .dropdown-item:active {
    background-color: var(--theme-accent) !important;
    color: #fff !important;
}

/* Override Bootstrap's default hover - Same as nav-link - ALL items */
[data-theme="dark"] .dropdown-item:hover[style*="background-color"],
[data-theme="dark"] .dropdown-item:focus[style*="background-color"],
[data-theme="dark"] .dropdown-item:hover[style*="transparent"],
[data-theme="dark"] .dropdown-item:focus[style*="transparent"],
[data-theme="dark"] .dropdown-item:hover[style*="rgb(233, 236, 239)"],
[data-theme="dark"] .dropdown-item:focus[style*="rgb(233, 236, 239)"],
[data-theme="dark"] .dropdown-item.active:hover[style*="background-color"],
[data-theme="dark"] .dropdown-item.active:focus[style*="background-color"],
[data-theme="dark"] .dropdown-item[data-hover-styled]:hover,
[data-theme="dark"] .dropdown-item[data-hover-styled]:focus,
[data-theme="dark"] .dropdown-item[data-hover-styled]:hover[style],
[data-theme="dark"] .dropdown-item[data-hover-styled]:focus[style],
[data-theme="dark"] a.dropdown-item[data-hover-styled]:hover,
[data-theme="dark"] a.dropdown-item[data-hover-styled]:focus,
[data-theme="dark"] a.dropdown-item[data-hover-styled]:hover[style],
[data-theme="dark"] a.dropdown-item[data-hover-styled]:focus[style] {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover - RED - Override inline !important */
    color: var(--primary) !important; /* Same as nav-link hover - Override inline !important */
    background: rgba(215, 38, 61, 0.08) !important; /* Override background shorthand */
}

/* Override icon colors with inline styles on hover - Dark mode */
[data-theme="dark"] .dropdown-item:hover i[style],
[data-theme="dark"] .dropdown-item:focus i[style],
[data-theme="dark"] .dropdown-item:hover i[style*="color"],
[data-theme="dark"] .dropdown-item:focus i[style*="color"],
[data-theme="dark"] .dropdown-item:hover i[style*="rgb(233, 236, 239)"],
[data-theme="dark"] .dropdown-item:focus i[style*="rgb(233, 236, 239)"],
[data-theme="dark"] .dropdown-item[data-hover-styled]:hover i,
[data-theme="dark"] .dropdown-item[data-hover-styled]:focus i {
    color: var(--primary) !important; /* Override inline icon color on hover */
}

/* Ensure icons in dropdown items are also visible on hover - same as nav-link */
[data-theme="dark"] .dropdown-item:hover i,
[data-theme="dark"] .dropdown-item:focus i {
    color: var(--primary) !important; /* Same as nav-link hover */
}
[data-theme="dark"] .dropdown-item:active i {
    color: #FFFFFF !important; /* Keep white for active state */
}

/* Force dark mode for all dropdown items in dark theme */
[data-theme="dark"] .dropdown-item {
    color: #E9ECEF !important; /* Light text for dark background */
    background-color: transparent !important;
}

/* Ensure non-active dropdown items are visible and have proper contrast */
[data-theme="dark"] .dropdown-item:not(.active) {
    color: #E9ECEF !important; /* Light text for non-active items */
    background-color: transparent !important;
}

[data-theme="dark"] .dropdown-item:not(.active):not(:hover):not(:focus):not(:active) {
    color: #E9ECEF !important; /* Light text for visibility */
    background-color: transparent !important;
}

/* Force reset for non-active items that might have hover state stuck */
[data-theme="dark"] .dropdown-item:not(.active):not(:hover):not(:focus) {
    color: #E9ECEF !important;
    background-color: transparent !important;
}

/* Override any inline styles for non-active items - HIGHEST PRIORITY */
[data-theme="dark"] .dropdown-item:not(.active):not(:hover):not(:focus) {
    color: #E9ECEF !important;
    background-color: transparent !important;
}

[data-theme="dark"] .dropdown-item:not(.active):not(:hover):not(:focus) i {
    color: #E9ECEF !important;
}

/* Force override inline styles */
[data-theme="dark"] .dropdown-item:not(.active)[style*="background-color"]:not(:hover):not(:focus) {
    background-color: transparent !important;
}

[data-theme="dark"] .dropdown-item:not(.active)[style*="color"]:not(:hover):not(:focus) {
    color: #E9ECEF !important;
}

/* CRITICAL: Override ANY background on hover - HIGHEST PRIORITY - Same as nav-link */
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
}

/* Override inline styles on hover - FORCE with maximum specificity - Same as nav-link */
[data-theme="dark"] .dropdown-item:hover[style*="background"],
[data-theme="dark"] .dropdown-item:focus[style*="background"],
[data-theme="dark"] .dropdown-item:hover[style*="background-color"],
[data-theme="dark"] .dropdown-item:focus[style*="background-color"],
[data-theme="dark"] .dropdown-item:hover[style*="rgb"],
[data-theme="dark"] .dropdown-item:focus[style*="rgb"] {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
}

/* Override specific rgb values - Same as nav-link */
[data-theme="dark"] .dropdown-item:hover[style*="rgb(58"],
[data-theme="dark"] .dropdown-item:focus[style*="rgb(58"],
[data-theme="dark"] .dropdown-item:hover[style*="rgb(74"],
[data-theme="dark"] .dropdown-item:focus[style*="rgb(74"] {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
}

/* Ultimate override - use attribute selector - Same as nav-link */
[data-theme="dark"] .dropdown-item[data-hover-styled]:hover,
[data-theme="dark"] .dropdown-item[data-hover-styled]:focus {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
}

[data-theme="dark"] .dropdown-item i {
    color: #E9ECEF !important; /* Light icons for dark background */
}

[data-theme="dark"] .dropdown-item:not(.active) i {
    color: #E9ECEF !important; /* Light icons for non-active items */
}

/* Ensure dropdown items in navbar use theme colors - HIGH SPECIFICITY */
.navbar .dropdown-menu,
.navbar .dropdown-menu.show,
.navbar .dropdown-menu[data-bs-popper],
.navbar .dropdown-menu[style*="position: fixed"],
.navbar .dropdown-menu[style*="position:fixed"] {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
    box-shadow: 0 4px 12px var(--theme-shadow-md, rgba(0, 0, 0, 0.15)) !important;
}

/* Dark mode specific overrides */
[data-theme="dark"] .navbar .dropdown-menu,
[data-theme="dark"] .navbar .dropdown-menu.show,
[data-theme="dark"] .navbar .dropdown-menu[data-bs-popper],
[data-theme="dark"] .navbar .dropdown-menu[style*="position: fixed"],
[data-theme="dark"] .navbar .dropdown-menu[style*="position:fixed"] {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

.navbar .dropdown-menu .dropdown-item,
.navbar .dropdown-menu.show .dropdown-item,
.navbar .dropdown-menu[data-bs-popper] .dropdown-item {
    color: var(--theme-text-primary) !important;
    background-color: transparent !important;
}

[data-theme="dark"] .navbar .dropdown-menu .dropdown-item,
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item {
    color: var(--theme-text-primary) !important;
    background-color: transparent !important;
}

/* Navbar dropdown items hover - same as nav-link - OVERRIDE Bootstrap white */
.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus,
.navbar .dropdown-menu.show .dropdown-item:hover,
.navbar .dropdown-menu.show .dropdown-item:focus,
.navbar .dropdown-menu .dropdown-item:hover:not(.active),
.navbar .dropdown-menu .dropdown-item:focus:not(.active),
.navbar .dropdown-menu.show .dropdown-item:hover:not(.active),
.navbar .dropdown-menu.show .dropdown-item:focus:not(.active) {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
    text-decoration: none !important;
}

/* Force override inline styles on navbar dropdown items */
.navbar .dropdown-menu .dropdown-item:hover[style*="background"],
.navbar .dropdown-menu .dropdown-item:focus[style*="background"],
.navbar .dropdown-menu.show .dropdown-item:hover[style*="background"],
.navbar .dropdown-menu.show .dropdown-item:focus[style*="background"],
.navbar .dropdown-menu .dropdown-item:hover[style*="background-color"],
.navbar .dropdown-menu .dropdown-item:focus[style*="background-color"],
.navbar .dropdown-menu.show .dropdown-item:hover[style*="background-color"],
.navbar .dropdown-menu.show .dropdown-item:focus[style*="background-color"] {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
}

/* Dark mode hover for navbar dropdown items - same as nav-link hover - OVERRIDE Bootstrap white */
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:hover,
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:focus,
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:hover,
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:focus,
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:hover:not(.active),
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:focus:not(.active),
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:hover:not(.active),
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:focus:not(.active) {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
    opacity: 1 !important;
}

/* Force override inline styles on dark mode navbar dropdown items */
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:hover[style*="background"],
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:focus[style*="background"],
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:hover[style*="background"],
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:focus[style*="background"],
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:hover[style*="background-color"],
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:focus[style*="background-color"],
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:hover[style*="background-color"],
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:focus[style*="background-color"] {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
}

/* Ensure non-active navbar dropdown items are visible in dark mode */
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:not(.active):not(:hover):not(:focus),
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:not(.active):not(:hover):not(:focus) {
    color: #E9ECEF !important; /* Light text for visibility */
    background-color: transparent !important;
}

/* Ensure icons in navbar dropdown items are visible on hover - same as nav-link */
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:hover i,
[data-theme="dark"] .navbar .dropdown-menu .dropdown-item:focus i,
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:hover i,
[data-theme="dark"] .navbar .dropdown-menu.show .dropdown-item:focus i {
    color: var(--primary) !important; /* Same as nav-link hover */
}

/* Language dropdown specific - override Bootstrap white background */
#languageDropdown + .dropdown-menu .dropdown-item:hover,
#languageDropdown + .dropdown-menu .dropdown-item:focus,
.dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:hover,
.dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:focus {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
    text-decoration: none !important;
}

/* Language dropdown dark mode - override Bootstrap white background */
[data-theme="dark"] #languageDropdown + .dropdown-menu .dropdown-item:hover,
[data-theme="dark"] #languageDropdown + .dropdown-menu .dropdown-item:focus,
[data-theme="dark"] .dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:focus {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
    opacity: 1 !important;
}

/* Force override inline styles on language dropdown items */
#languageDropdown + .dropdown-menu .dropdown-item:hover[style*="background"],
#languageDropdown + .dropdown-menu .dropdown-item:focus[style*="background"],
.dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:hover[style*="background"],
.dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:focus[style*="background"],
#languageDropdown + .dropdown-menu .dropdown-item:hover[style*="background-color"],
#languageDropdown + .dropdown-menu .dropdown-item:focus[style*="background-color"],
.dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:hover[style*="background-color"],
.dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:focus[style*="background-color"] {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
}

[data-theme="dark"] #languageDropdown + .dropdown-menu .dropdown-item:hover[style*="background"],
[data-theme="dark"] #languageDropdown + .dropdown-menu .dropdown-item:focus[style*="background"],
[data-theme="dark"] .dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:hover[style*="background"],
[data-theme="dark"] .dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:focus[style*="background"],
[data-theme="dark"] #languageDropdown + .dropdown-menu .dropdown-item:hover[style*="background-color"],
[data-theme="dark"] #languageDropdown + .dropdown-menu .dropdown-item:focus[style*="background-color"],
[data-theme="dark"] .dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:hover[style*="background-color"],
[data-theme="dark"] .dropdown-menu[aria-labelledby="languageDropdown"] .dropdown-item:focus[style*="background-color"] {
    background-color: rgba(215, 38, 61, 0.08) !important; /* Same as nav-link hover */
    color: var(--primary) !important; /* Same as nav-link hover */
}

.navbar .dropdown-menu .dropdown-item.active,
.navbar .dropdown-menu.show .dropdown-item.active {
    background-color: var(--theme-accent) !important;
    color: #fff !important;
}

.navbar .dropdown-menu .dropdown-item.active:hover,
.navbar .dropdown-menu .dropdown-item.active:focus,
.navbar .dropdown-menu.show .dropdown-item.active:hover,
.navbar .dropdown-menu.show .dropdown-item.active:focus {
    background-color: var(--theme-accent) !important;
    color: #fff !important;
}

/* Scrollbar */
::-webkit-scrollbar-thumb {
    background: var(--theme-border-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--theme-text-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--theme-bg-tertiary) !important;
    border: 1px solid var(--theme-border) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: var(--theme-text-primary) !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.theme-toggle:hover {
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: #fff !important;
    transform: scale(1.1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.theme-toggle:focus {
    outline: none !important;
    box-shadow: 0 0 0 0.2rem var(--theme-shadow-sm) !important;
}

.theme-toggle:active {
    transform: scale(0.95) !important;
}

.theme-toggle i {
    font-size: 1.1rem !important;
    transition: transform 0.3s ease !important;
    display: block !important;
}

.theme-toggle:hover i {
    transform: rotate(15deg) !important;
}

[data-theme="dark"] .theme-toggle i.bi-sun-fill {
    color: #FFD43B !important;
}

[data-theme="light"] .theme-toggle i.bi-moon-fill {
    color: var(--theme-text-primary) !important;
}

/* ══════════════ Bootstrap Components Theme Support ══════════════ */

/* Alerts */
.alert {
    background-color: var(--theme-bg-primary);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: var(--theme-success);
    color: var(--theme-success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: var(--theme-danger);
    color: var(--theme-danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: var(--theme-warning);
    color: var(--theme-warning);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-color: var(--theme-info);
    color: var(--theme-info);
}

/* Tables */
.table {
    color: var(--theme-text-primary);
    background-color: var(--theme-bg-primary);
}

.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: var(--theme-bg-tertiary);
}

.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
    background-color: var(--theme-bg-tertiary);
    color: var(--theme-text-primary);
}

.table-bordered {
    border-color: var(--theme-border);
}

.table-bordered > :not(caption) > * > * {
    border-color: var(--theme-border);
}

/* Table Header - Dark Mode Support */
[data-theme="dark"] .table-light,
[data-theme="dark"] thead.table-light {
    background-color: var(--theme-bg-secondary) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .table-light th,
[data-theme="dark"] thead.table-light th {
    background-color: var(--theme-bg-secondary) !important;
    color: var(--theme-text-primary) !important;
    border-color: var(--theme-border) !important;
}

[data-theme="dark"] .table-light a,
[data-theme="dark"] thead.table-light a {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .table-light a:hover,
[data-theme="dark"] thead.table-light a:hover {
    color: var(--theme-primary) !important;
}

/* List Groups */
.list-group-item {
    background-color: var(--theme-bg-primary);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

.list-group-item.active {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
    color: #fff;
}

.list-group-item:hover,
.list-group-item:focus {
    background-color: var(--theme-bg-tertiary);
    color: var(--theme-text-primary);
}

/* Badges */
.badge {
    background-color: var(--theme-secondary);
    color: #fff;
}

.badge.bg-primary {
    background-color: var(--theme-primary) !important;
}

.badge.bg-success {
    background-color: var(--theme-success) !important;
}

.badge.bg-danger {
    background-color: var(--theme-danger) !important;
}

.badge.bg-warning {
    background-color: var(--theme-warning) !important;
    color: var(--theme-text-primary);
}

.badge.bg-info {
    background-color: var(--theme-info) !important;
}

/* Input Groups */
.input-group-text {
    background-color: var(--theme-bg-tertiary);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

/* Breadcrumbs */
.breadcrumb {
    background-color: var(--theme-bg-tertiary);
}

.breadcrumb-item.active {
    color: var(--theme-text-muted);
}

/* Pagination */
.page-link {
    background-color: var(--theme-bg-primary);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

.page-link:hover {
    background-color: var(--theme-bg-tertiary);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

.page-item.active .page-link {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
    color: #fff;
}

.page-item.disabled .page-link {
    background-color: var(--theme-bg-primary);
    border-color: var(--theme-border);
    color: var(--theme-text-muted);
}

/* Code */
code {
    background-color: var(--theme-bg-tertiary);
    color: var(--theme-text-primary);
}

pre {
    background-color: var(--theme-bg-tertiary);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

/* Blockquotes */
blockquote {
    border-left-color: var(--theme-border);
    color: var(--theme-text-secondary);
}

/* Text Colors */
.text-muted {
    color: var(--theme-text-muted) !important;
}

.text-primary {
    color: var(--theme-primary) !important;
}

.text-success {
    color: var(--theme-success) !important;
}

.text-danger {
    color: var(--theme-danger) !important;
}

.text-warning {
    color: var(--theme-warning) !important;
}

.text-info {
    color: var(--theme-info) !important;
}

/* Background Colors */
.bg-light {
    background-color: var(--theme-bg-tertiary) !important;
}

.bg-dark {
    background-color: var(--theme-bg-secondary) !important;
    color: var(--theme-text-primary) !important;
}

/* Borders */
.border {
    border-color: var(--theme-border) !important;
}

.border-top {
    border-top-color: var(--theme-border) !important;
}

.border-bottom {
    border-bottom-color: var(--theme-border) !important;
}

.border-start {
    border-left-color: var(--theme-border) !important;
}

.border-end {
    border-right-color: var(--theme-border) !important;
}

/* ══════════════ SweetAlert2 Theme Support ══════════════ */
.swal2-popup {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

.swal2-title {
    color: var(--theme-text-primary) !important;
}

.swal2-content {
    color: var(--theme-text-secondary) !important;
}

.swal2-input,
.swal2-textarea,
.swal2-select {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 0.2rem var(--theme-shadow-sm) !important;
}

.swal2-confirm {
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
}

.swal2-cancel {
    background-color: var(--theme-bg-tertiary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

.swal2-close {
    color: var(--theme-text-muted) !important;
}

.swal2-close:hover {
    color: var(--theme-text-primary) !important;
}

/* Select2 inside SweetAlert2 */
.swal2-popup .select2-container--default .select2-selection--single,
.swal2-popup .select2-container--default .select2-selection--multiple {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

.swal2-popup .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--theme-text-primary) !important;
}

.swal2-popup .select2-dropdown {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
}

.swal2-popup .select2-results__option {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

.swal2-popup .select2-results__option--highlighted {
    background-color: var(--theme-bg-tertiary) !important;
    color: var(--theme-text-primary) !important;
}

.swal2-popup .select2-search__field {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

/* ═══════════════════════════════════════════════════════════
   Select2 Dark Mode Support
   ═══════════════════════════════════════════════════════════ */

/* Select2 Container - Dark Mode */
[data-theme="dark"] .select2-container,
[data-theme="dark"] .select2-container--bootstrap-5 {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

/* Select2 Selection Box - Dark Mode */
[data-theme="dark"] .select2-selection,
[data-theme="dark"] .select2-selection--single,
[data-theme="dark"] .select2-selection--multiple {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

/* Select2 Selection Rendered Text - Dark Mode */
[data-theme="dark"] .select2-selection__rendered {
    color: var(--theme-text-primary) !important;
}

/* Select2 Placeholder - Dark Mode */
[data-theme="dark"] .select2-selection__placeholder {
    color: var(--theme-text-muted) !important;
}

/* Select2 Dropdown Menu - Dark Mode */
[data-theme="dark"] .select2-dropdown,
[data-theme="dark"] .select2-dropdown--below,
[data-theme="dark"] .select2-dropdown--above {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

/* Select2 Results Container - Dark Mode */
[data-theme="dark"] .select2-results {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

/* Select2 Results Options - Dark Mode */
[data-theme="dark"] .select2-results__option {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

/* Select2 Results Option - Highlighted/Hover - Dark Mode */
[data-theme="dark"] .select2-results__option--highlighted,
[data-theme="dark"] .select2-results__option[aria-selected="true"] {
    background-color: var(--theme-bg-tertiary) !important;
    color: var(--theme-text-primary) !important;
}

/* Select2 Results Option - Selected - Dark Mode */
[data-theme="dark"] .select2-results__option--selected {
    background-color: var(--theme-accent) !important;
    color: #FFFFFF !important;
}

/* Select2 Search Field - Dark Mode */
[data-theme="dark"] .select2-search__field {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
    border-color: var(--theme-border) !important;
}

/* Select2 Search Field Focus - Dark Mode */
[data-theme="dark"] .select2-search__field:focus {
    border-color: var(--theme-accent) !important;
    outline: none !important;
}

/* Select2 Selection Arrow - Dark Mode */
[data-theme="dark"] .select2-selection__arrow b {
    border-color: var(--theme-text-primary) transparent transparent transparent !important;
}

/* Select2 Selection Clear Button - Dark Mode */
[data-theme="dark"] .select2-selection__clear {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .select2-selection__clear:hover {
    color: var(--theme-danger) !important;
}

/* Select2 Multiple Selection Tags - Dark Mode */
[data-theme="dark"] .select2-selection__choice {
    background-color: var(--theme-bg-tertiary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .select2-selection__choice__remove {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .select2-selection__choice__remove:hover {
    color: var(--theme-danger) !important;
}

/* Select2 Loading Spinner - Dark Mode */
[data-theme="dark"] .select2-results__option--loading {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-muted) !important;
}

/* Select2 No Results Message - Dark Mode */
[data-theme="dark"] .select2-results__option--no-results {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-muted) !important;
}

/* Select2 Disabled State - Dark Mode */
[data-theme="dark"] .select2-container--disabled .select2-selection,
[data-theme="dark"] .select2-container.select2-container--disabled .select2-selection {
    background-color: var(--theme-bg-tertiary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-muted) !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

[data-theme="dark"] .select2-container--disabled .select2-selection__rendered {
    color: var(--theme-text-muted) !important;
}

[data-theme="dark"] .select2-container--disabled .select2-selection__placeholder {
    color: var(--theme-text-muted) !important;
}

/* Select2 Focus State - Dark Mode */
[data-theme="dark"] .select2-container--focus .select2-selection,
[data-theme="dark"] .select2-container--open .select2-selection {
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(77, 171, 247, 0.25) !important;
}

/* ═══════════════════════════════════════════════════════════
   Wizard Card Dark Mode Support
   ═══════════════════════════════════════════════════════════ */

/* Wizard Card - Dark Mode */
[data-theme="dark"] .wizard-card {
    background: var(--theme-bg-primary) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    color: var(--theme-text-primary) !important;
}

/* Wizard Section - Dark Mode */
[data-theme="dark"] .wizard-section {
    background: var(--theme-bg-secondary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

/* Wizard Section Heading - Dark Mode */
[data-theme="dark"] .wizard-section h5 {
    color: var(--theme-primary) !important;
    border-bottom-color: var(--theme-border) !important;
}

/* Info Block - Dark Mode */
[data-theme="dark"] .info-block small {
    color: var(--theme-text-muted) !important;
}

[data-theme="dark"] .info-block strong {
    color: var(--theme-text-primary) !important;
}

/* Wizard Header - Dark Mode */
[data-theme="dark"] .wizard-header {
    color: var(--theme-text-primary) !important;
}

/* Wizard Name - Dark Mode */
[data-theme="dark"] .wizard-name {
    color: var(--theme-text-primary) !important;
}

/* Wizard Sub - Dark Mode */
[data-theme="dark"] .wizard-sub {
    color: var(--theme-text-secondary) !important;
}

/* Wizard Avatar - Dark Mode */
[data-theme="dark"] .wizard-avatar {
    border-color: var(--theme-border) !important;
}

/* Wizard Footer - Dark Mode */
[data-theme="dark"] .wizard-footer {
    color: var(--theme-text-secondary) !important;
    border-top-color: var(--theme-border) !important;
}

/* Wizard Actions - Dark Mode */
[data-theme="dark"] .wizard-actions .circle-btn {
    background-color: var(--theme-bg-tertiary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .wizard-actions .circle-btn:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4) !important;
    background-color: var(--theme-bg-secondary) !important;
}

/* Validation Report - Dark Mode */
[data-theme="dark"] .validation-report {
    background-color: var(--theme-bg-secondary) !important;
    color: var(--theme-text-primary) !important;
    border-color: var(--theme-border) !important;
    padding: 20px !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
}

.validation-report {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.6;
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border);
}

/* Admin Translations Validate Page - Dark Mode */
[data-theme="dark"] .card h5 {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .alert-warning strong {
    color: #ffc107 !important;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(25, 135, 84, 0.15) !important;
    border-color: rgba(25, 135, 84, 0.3) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .alert-success strong {
    color: #198754 !important;
}

[data-theme="dark"] .alert ul {
    color: var(--theme-text-secondary) !important;
}

/* Star Button - Dark Mode */
[data-theme="dark"] .wizard-actions .star-btn {
    background-color: var(--theme-bg-tertiary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .wizard-actions .star-btn:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4) !important;
    background-color: var(--theme-bg-secondary) !important;
}

/* Wizard Actions Text Colors - Dark Mode */
[data-theme="dark"] .wizard-actions .text-blue {
    color: var(--theme-accent) !important;
}

[data-theme="dark"] .wizard-actions .text-red {
    color: var(--theme-danger) !important;
}

[data-theme="dark"] .wizard-actions .text-danger {
    color: var(--theme-danger) !important;
}

/* Wizard Actions Small Text - Dark Mode */
[data-theme="dark"] .wizard-actions small {
    color: var(--theme-text-secondary) !important;
}

/* Last Seen Labels - Dark Mode */
[data-theme="dark"] .last-seen-label {
    color: var(--theme-text-secondary) !important;
}

[data-theme="dark"] .last-seen-online {
    color: var(--theme-success) !important;
}

[data-theme="dark"] .last-seen-offline {
    color: var(--theme-text-muted) !important;
}

/* Text Muted in Wizard Card - Dark Mode */
[data-theme="dark"] .wizard-card .text-muted {
    color: var(--theme-text-muted) !important;
}

/* Features Section (لماذا تختارنا) */
.features-section {
    background: linear-gradient(to bottom, var(--theme-bg-tertiary), var(--theme-bg-primary)) !important;
}

[data-theme="dark"] .features-section {
    background: linear-gradient(to bottom, var(--theme-bg-secondary), var(--theme-bg-primary)) !important;
}

.features-section .card {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary);
}

.features-section .card-text {
    color: var(--theme-text-secondary) !important;
}

.features-section .lead {
    color: var(--theme-text-secondary) !important;
}

/* Dropdown Menu */
.dropdown-menu {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
}

.dropdown-item {
    color: var(--theme-text-primary) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--theme-bg-tertiary) !important;
    color: var(--theme-text-primary) !important;
}

.dropdown-item.active {
    background-color: var(--theme-accent) !important;
    color: #fff !important;
}

/* Form Select Dropdowns */
.form-select {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

.form-select:focus {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-text-primary) !important;
}

.form-select option {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

/* Offcanvas */
.offcanvas {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

.offcanvas-header {
    border-bottom-color: var(--theme-border) !important;
}

.offcanvas-body {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

/* ═══════════════════════════════════════════════════════════
   Forum Pages Dark Mode Support
   ═══════════════════════════════════════════════════════════ */

/* Forum Card Headers - Dark Mode */
[data-theme="dark"] .card-header.bg-primary,
[data-theme="dark"] .card-header.bg-success,
[data-theme="dark"] .card-header.bg-danger,
[data-theme="dark"] .card-header.bg-warning,
[data-theme="dark"] .card-header.bg-info,
[data-theme="dark"] .card-header.bg-secondary {
    color: #FFFFFF !important;
}

/* Forum Category Cards - Dark Mode */
[data-theme="dark"] .card.border-0 {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
}

/* Forum Badges - Dark Mode */
[data-theme="dark"] .badge.bg-opacity-10,
[data-theme="dark"] .badge.bg-opacity-25 {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--theme-text-primary) !important;
}

/* Forum Links - Dark Mode */
[data-theme="dark"] .card-title a,
[data-theme="dark"] .card-body a {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .card-title a:hover,
[data-theme="dark"] .card-body a:hover {
    color: var(--theme-primary) !important;
}

/* Forum Buttons - Dark Mode */
[data-theme="dark"] .btn-outline-primary,
[data-theme="dark"] .btn-outline-danger,
[data-theme="dark"] .btn-outline-success,
[data-theme="dark"] .btn-outline-warning,
[data-theme="dark"] .btn-outline-info {
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .btn-outline-primary:hover,
[data-theme="dark"] .btn-outline-danger:hover,
[data-theme="dark"] .btn-outline-success:hover,
[data-theme="dark"] .btn-outline-warning:hover,
[data-theme="dark"] .btn-outline-info:hover {
    background-color: var(--theme-bg-tertiary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

/* Forum Topic/Reply Cards - Dark Mode */
[data-theme="dark"] .topic-card,
[data-theme="dark"] .reply-card {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

/* Forum Tables - Dark Mode */
[data-theme="dark"] .table {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: var(--theme-bg-tertiary) !important;
}

/* ═══════════════════════════════════════════════════════════
   Articles Pages Dark Mode Support
   ═══════════════════════════════════════════════════════════ */

/* Articles Card Headers - Dark Mode */
[data-theme="dark"] .card-header.bg-warning {
    background-color: #FFC107 !important;
    color: #000000 !important;
}

[data-theme="dark"] .card-header.bg-primary {
    background-color: var(--theme-primary) !important;
    color: #FFFFFF !important;
}

/* Articles Featured Section - Dark Mode */
[data-theme="dark"] .card.border-0.shadow-sm {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
}

/* Articles Links - Dark Mode */
[data-theme="dark"] .card-title a,
[data-theme="dark"] .card-body a {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .card-title a:hover,
[data-theme="dark"] .card-body a:hover {
    color: var(--theme-primary) !important;
}

/* Articles Badges - Dark Mode */
[data-theme="dark"] .badge.bg-primary,
[data-theme="dark"] .badge.bg-success,
[data-theme="dark"] .badge.bg-danger,
[data-theme="dark"] .badge.bg-warning,
[data-theme="dark"] .badge.bg-info {
    color: #FFFFFF !important;
}

/* Articles List Group - Dark Mode */
[data-theme="dark"] .list-group-item {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .list-group-item.active {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .list-group-item:hover:not(.active) {
    background-color: var(--theme-bg-tertiary) !important;
    color: var(--theme-text-primary) !important;
}

/* Articles Form Controls - Dark Mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-text-primary) !important;
}

/* ═══════════════════════════════════════════════════════════
   Recently Viewed Profiles Dark Mode Support
   ═══════════════════════════════════════════════════════════ */

/* Recently Viewed Cards - Dark Mode */
[data-theme="dark"] .card.shadow-sm {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
}

/* Recently Viewed Avatar Circle - Dark Mode */
[data-theme="dark"] .rounded-circle.bg-secondary {
    background-color: var(--theme-bg-tertiary) !important;
    border-color: var(--theme-border) !important;
}

[data-theme="dark"] .rounded-circle.bg-secondary .text-white {
    color: var(--theme-text-primary) !important;
}

/* Recently Viewed Links - Dark Mode */
[data-theme="dark"] .card-title a {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .card-title a:hover {
    color: var(--theme-primary) !important;
}

/* ═══════════════════════════════════════════════════════════
   Admin Seeders Dark Mode Support
   ═══════════════════════════════════════════════════════════ */

/* Admin Seeders Card Headers - Dark Mode */
[data-theme="dark"] .card-header.bg-warning {
    background-color: #FFC107 !important;
    color: #000000 !important;
}

[data-theme="dark"] .card-header.bg-primary,
[data-theme="dark"] .card-header.bg-success,
[data-theme="dark"] .card-header.bg-info,
[data-theme="dark"] .card-header.bg-secondary,
[data-theme="dark"] .card-header.bg-dark {
    color: #FFFFFF !important;
}

/* Admin Seeders Statistics Cards - Dark Mode */
[data-theme="dark"] .card.bg-primary,
[data-theme="dark"] .card.bg-success,
[data-theme="dark"] .card.bg-info,
[data-theme="dark"] .card.bg-secondary {
    background-color: var(--theme-bg-secondary) !important;
    border-color: var(--theme-border) !important;
}

[data-theme="dark"] .card.bg-primary .card-title,
[data-theme="dark"] .card.bg-success .card-title,
[data-theme="dark"] .card.bg-info .card-title,
[data-theme="dark"] .card.bg-secondary .card-title {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .card.bg-primary .card-text,
[data-theme="dark"] .card.bg-success .card-text,
[data-theme="dark"] .card.bg-info .card-text,
[data-theme="dark"] .card.bg-secondary .card-text {
    color: var(--theme-text-primary) !important;
}

/* Admin Seeders Form Controls - Dark Mode */
[data-theme="dark"] .form-control[type="number"] {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .form-control[type="number"]:focus {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-text-primary) !important;
}

/* Admin Seeders Buttons - Dark Mode */
[data-theme="dark"] .btn-warning {
    background-color: #FFC107 !important;
    border-color: #FFC107 !important;
    color: #000000 !important;
}

[data-theme="dark"] .btn-warning:hover {
    background-color: #FFB300 !important;
    border-color: #FFB300 !important;
    color: #000000 !important;
}

/* ═══════════════════════════════════════════════════════════
   Quill Editor Dark Mode Support
   ═══════════════════════════════════════════════════════════ */

/* Quill Editor Container - Dark Mode */
[data-theme="dark"] .ql-container {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
    border-color: var(--theme-border) !important;
}

[data-theme="dark"] .ql-editor {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .ql-editor.ql-blank::before {
    color: var(--theme-text-muted) !important;
}

/* Quill Toolbar - Dark Mode */
[data-theme="dark"] .ql-toolbar {
    background-color: var(--theme-bg-secondary) !important;
    border-color: var(--theme-border) !important;
}

[data-theme="dark"] .ql-toolbar .ql-stroke {
    stroke: var(--theme-text-primary) !important;
}

[data-theme="dark"] .ql-toolbar .ql-fill {
    fill: var(--theme-text-primary) !important;
}

[data-theme="dark"] .ql-toolbar button:hover,
[data-theme="dark"] .ql-toolbar button:focus,
[data-theme="dark"] .ql-toolbar button.ql-active {
    background-color: var(--theme-bg-tertiary) !important;
}

[data-theme="dark"] .ql-toolbar button:hover .ql-stroke,
[data-theme="dark"] .ql-toolbar button:focus .ql-stroke,
[data-theme="dark"] .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--theme-primary) !important;
}

[data-theme="dark"] .ql-toolbar button:hover .ql-fill,
[data-theme="dark"] .ql-toolbar button:focus .ql-fill,
[data-theme="dark"] .ql-toolbar button.ql-active .ql-fill {
    fill: var(--theme-primary) !important;
}

/* Quill Snow Theme - Dark Mode */
[data-theme="dark"] .ql-snow .ql-picker {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .ql-snow .ql-picker-options {
    background-color: var(--theme-bg-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .ql-snow .ql-picker-item {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .ql-snow .ql-picker-item:hover,
[data-theme="dark"] .ql-snow .ql-picker-item.ql-selected {
    background-color: var(--theme-bg-tertiary) !important;
    color: var(--theme-text-primary) !important;
}

/* ═══════════════════════════════════════════════════════════
   General Dark Mode Enhancements
   ═══════════════════════════════════════════════════════════ */

/* Text Dark in Light Mode - Override for Dark Mode */
[data-theme="dark"] .text-dark {
    color: var(--theme-text-primary) !important;
}

/* Background White in Light Mode - Override for Dark Mode */
[data-theme="dark"] .bg-white {
    background-color: var(--theme-bg-primary) !important;
}

/* Shadow Enhancements for Dark Mode */
[data-theme="dark"] .shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.6) !important;
}

/* Border Enhancements for Dark Mode */
[data-theme="dark"] .border-0 {
    border-color: var(--theme-border) !important;
}

/* Image Opacity in Dark Mode */
[data-theme="dark"] img {
    opacity: 0.9;
}

[data-theme="dark"] img:hover {
    opacity: 1;
}

