/**
 * Frontend dark mode — sections, footer, social icons, cards
 * Loaded after page CSS so dark/light toggle covers the full landing page.
 */

[data-bs-theme="dark"] {
    color-scheme: dark;
}

/* ===== Body / surfaces ===== */
[data-bs-theme="dark"] .lms-body,
[data-bs-theme="dark"] body {
    background-color: #111827 !important;
    color: #f3f4f6 !important;
}

[data-bs-theme="dark"] .main-content {
    background: transparent !important;
    color: #f3f4f6;
}

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

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

[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.site-footer-social-link):not(.site-nav-social__link) {
    color: #6ee7b7;
}

/* ===== Navbar social icons (must stay visible) ===== */
[data-bs-theme="dark"] .lms-nav-light .site-nav-social {
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    border-left-color: rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .lms-nav-light .site-nav-social__link,
[data-bs-theme="dark"] .lms-nav-light .site-nav-social__link.is-placeholder {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #f9fafb !important;
    background: #374151 !important;
    border: 1px solid #4b5563 !important;
}

[data-bs-theme="dark"] .lms-nav-light .site-nav-social__link i {
    color: #f9fafb !important;
    opacity: 1 !important;
}

[data-bs-theme="dark"] .lms-nav-light .site-nav-social__link:hover,
[data-bs-theme="dark"] .lms-nav-light .site-nav-social__link:hover i {
    color: #fff !important;
    background: #28c76f !important;
    border-color: #28c76f !important;
}

/* ===== Footer ===== */
[data-bs-theme="dark"] .site-footer.site-footer-wide {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    border-top-color: #374151 !important;
}

[data-bs-theme="dark"] .site-footer-heading {
    color: #f9fafb !important;
}

[data-bs-theme="dark"] .site-footer-list a,
[data-bs-theme="dark"] .site-footer-copy,
[data-bs-theme="dark"] .site-footer-email,
[data-bs-theme="dark"] .site-footer-social-label,
[data-bs-theme="dark"] .site-footer-bottom {
    color: #d1d5db !important;
}

[data-bs-theme="dark"] .site-footer-list a:hover,
[data-bs-theme="dark"] .site-footer-email:hover {
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .site-footer-list--icons i {
    color: #34d399 !important;
}

[data-bs-theme="dark"] .site-footer-bottom,
[data-bs-theme="dark"] .site-footer-social {
    border-top-color: #374151 !important;
}

[data-bs-theme="dark"] .site-footer-social {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

[data-bs-theme="dark"] .site-footer-social-links {
    display: flex !important;
}

[data-bs-theme="dark"] .site-footer-social-link {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #f9fafb !important;
    background: #374151 !important;
    border-color: #4b5563 !important;
}

[data-bs-theme="dark"] .site-footer-social-link i {
    color: #f9fafb !important;
}

[data-bs-theme="dark"] .site-footer-social-link:hover {
    color: #fff !important;
    background: var(--site-footer-accent, #28c76f) !important;
    border-color: transparent !important;
}

[data-bs-theme="dark"] .site-footer-social-link:hover i {
    color: #fff !important;
}

/* ===== Homepage sections ===== */
[data-bs-theme="dark"] .home-hero-light {
    color: #f3f4f6 !important;
}

[data-bs-theme="dark"] .home-hero-brand {
    color: #f9fafb !important;
}

[data-bs-theme="dark"] .home-hero-bold {
    color: #6ee7b7 !important;
}

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

[data-bs-theme="dark"] .home-programs-title,
[data-bs-theme="dark"] .home-library-title,
[data-bs-theme="dark"] .home-mobile-cta-title,
[data-bs-theme="dark"] .section-title {
    color: #f9fafb !important;
}

[data-bs-theme="dark"] .home-hero-tagline,
[data-bs-theme="dark"] .home-programs-sub,
[data-bs-theme="dark"] .home-mobile-cta-text,
[data-bs-theme="dark"] .section-subtitle {
    color: #9ca3af !important;
}

[data-bs-theme="dark"] .home-programs,
[data-bs-theme="dark"] .home-library,
[data-bs-theme="dark"] .home-courses,
[data-bs-theme="dark"] .home-mobile-cta,
[data-bs-theme="dark"] .home-section,
[data-bs-theme="dark"] .home-contact,
[data-bs-theme="dark"] .contact-section {
    background: #111827 !important;
    color: #f3f4f6 !important;
}

[data-bs-theme="dark"] .home-program-card,
[data-bs-theme="dark"] .home-library-card,
[data-bs-theme="dark"] .course-card,
[data-bs-theme="dark"] .card {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
}

[data-bs-theme="dark"] .home-program-card-title,
[data-bs-theme="dark"] .home-library-label,
[data-bs-theme="dark"] .course-card-title {
    color: #f9fafb !important;
}

[data-bs-theme="dark"] .home-library-banner {
    background: #1f2937 !important;
    color: #f3f4f6 !important;
}

[data-bs-theme="dark"] .home-hero-green-bar {
    background: #14532d !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .home-hero-live-btn {
    background: #ffffff !important;
    border-color: #ffffff !important;
    color: #111827 !important;
}

/* Navbar dropdowns — must beat .site-navbar .nav-menu .dropdown-menu.dropdown-menu-custom */
[data-bs-theme="dark"] {
    --bs-dropdown-bg: #1f2937;
    --bs-dropdown-color: #f3f4f6;
    --bs-dropdown-border-color: #374151;
    --bs-dropdown-link-color: #e5e7eb;
    --bs-dropdown-link-hover-color: #ffffff;
    --bs-dropdown-link-hover-bg: #374151;
    --bs-dropdown-link-active-color: #ffffff;
    --bs-dropdown-link-active-bg: #374151;
    --bs-dropdown-header-color: #d1d5db;
    --bs-dropdown-divider-bg: #374151;
}

[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-custom,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-profile,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-hub,
[data-bs-theme="dark"] .site-navbar .dropdown-menu,
[data-bs-theme="dark"] .site-navbar .dropdown-menu.dropdown-menu-custom,
[data-bs-theme="dark"] .site-navbar .nav-menu .dropdown-menu.dropdown-menu-custom,
[data-bs-theme="dark"] .lms-nav-light .site-navbar .nav-menu .dropdown-menu.dropdown-menu-custom,
[data-bs-theme="dark"] .lms-nav-light .site-navbar-secondary .dropdown-menu-custom,
[data-bs-theme="dark"] .lms-nav-light .site-navbar-secondary .nav-menu .dropdown-menu.dropdown-menu-custom {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
    color: #f3f4f6 !important;
}

[data-bs-theme="dark"] .dropdown-item,
[data-bs-theme="dark"] .lms-nav-light .dropdown-item,
[data-bs-theme="dark"] .site-navbar .nav-menu .dropdown-item,
[data-bs-theme="dark"] .site-navbar .dropdown-menu-custom .dropdown-item,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-custom .dropdown-item,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-hub .dropdown-item,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-profile .dropdown-item,
[data-bs-theme="dark"] .lms-nav-light .site-navbar .nav-menu .dropdown-menu-custom .dropdown-item {
    color: #e5e7eb !important;
    background: transparent !important;
}

[data-bs-theme="dark"] .site-navbar .nav-menu .dropdown-item i,
[data-bs-theme="dark"] .site-navbar .dropdown-menu-custom .dropdown-item i,
[data-bs-theme="dark"] .lms-nav-light .dropdown-item i,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-custom .dropdown-item i,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-hub .dropdown-item i {
    color: #34d399 !important;
    opacity: 1 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .dropdown-item.active,
[data-bs-theme="dark"] .site-navbar .nav-menu .dropdown-item:hover,
[data-bs-theme="dark"] .site-navbar .dropdown-menu-custom .dropdown-item:hover,
[data-bs-theme="dark"] .lms-nav-light .dropdown-item:hover,
[data-bs-theme="dark"] .lms-nav-light .dropdown-item:focus,
[data-bs-theme="dark"] .lms-nav-light .dropdown-item.active,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-custom .dropdown-item:hover,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-custom .dropdown-item:focus,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-custom .dropdown-item.active,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-hub .dropdown-item:hover,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-hub .dropdown-item:focus {
    background: #374151 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .site-navbar .nav-menu .dropdown-item:hover i,
[data-bs-theme="dark"] .site-navbar .dropdown-menu-custom .dropdown-item:hover i,
[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-custom .dropdown-item:hover i {
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .lms-nav-light .dropdown-divider,
[data-bs-theme="dark"] .site-navbar .dropdown-menu-custom .dropdown-divider,
[data-bs-theme="dark"] .site-navbar .nav-menu .dropdown-menu-custom .dropdown-divider {
    border-top-color: #374151 !important;
    opacity: 1;
}

[data-bs-theme="dark"] .lms-nav-light .dropdown-header,
[data-bs-theme="dark"] .lms-nav-light .dropdown-header-custom,
[data-bs-theme="dark"] .lms-nav-light .dropdown-header-custom .text-muted,
[data-bs-theme="dark"] .lms-nav-light .dropdown-header-custom strong,
[data-bs-theme="dark"] .site-navbar .dropdown-header-custom {
    color: #d1d5db !important;
}

[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-profile .dropdown-item.text-danger,
[data-bs-theme="dark"] .site-navbar .dropdown-menu-profile .dropdown-item.text-danger {
    color: #fca5a5 !important;
}

[data-bs-theme="dark"] .lms-nav-light .dropdown-menu-profile .dropdown-item.text-danger:hover,
[data-bs-theme="dark"] .site-navbar .dropdown-menu-profile .dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #fecaca !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
}

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

/* Courses catalog page — keep whole page in sync with theme */
[data-bs-theme="dark"] .courses-catalog-page {
    background: #111827 !important;
    color: #f3f4f6 !important;
}

[data-bs-theme="light"] .courses-catalog-page .form-control,
[data-bs-theme="light"] .courses-catalog-page .form-select,
html:not([data-bs-theme="dark"]) .courses-catalog-page .form-control,
html:not([data-bs-theme="dark"]) .courses-catalog-page .form-select {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
}
