/* Theme Switcher Styles */

.theme-switcher {
    position: relative;
}

.theme-toggle {
    color: #ffffff !important;
    padding: 0.5rem;
    border: none;
    background: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    color: #76c2ff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(180deg);
}

.theme-dropdown {
    min-width: 160px;
    border: 1px solid rgba(11, 75, 138, 0.3) !important;
    box-shadow: 0 4px 12px rgba(11, 75, 138, 0.25) !important;
    border-radius: 8px;
    padding: 0.5rem 0;
    background-color: #0b4b8a !important;
    color: #ffffff !important;
}

.theme-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.theme-dropdown .dropdown-item:hover {
    background-color: rgba(11, 75, 138, 0.1);
    color: #0b4b8a;
}

.theme-dropdown .dropdown-item.active {
    background-color: rgba(11, 75, 138, 0.15);
    color: #0b4b8a;
    font-weight: 500;
}

/* Force white text and icons in theme dropdown for all themes */
.theme-dropdown .dropdown-item {
    color: #ffffff !important;
}

.theme-dropdown .dropdown-item i {
    color: #ffffff !important;
    width: 16px;
    text-align: center;
}

/* Dark theme styles */
[data-bs-theme="dark"] .theme-toggle {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .theme-toggle:hover {
    color: #76c2ff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .theme-dropdown {
    background-color: #212529;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-bs-theme="dark"] .theme-dropdown .dropdown-item {
    color: #ffffff;
}

[data-bs-theme="dark"] .theme-dropdown .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #76c2ff;
}

[data-bs-theme="dark"] .theme-dropdown .dropdown-item.active {
    background-color: rgba(118, 194, 255, 0.2);
    color: #76c2ff;
}

/* Theme transition animations */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom dark theme variables - Enhanced */
[data-bs-theme="dark"] {
    --bs-body-bg: #0d1117;
    --bs-body-color: #e6edf3;
    --bs-emphasis-color: #f0f6fc;
    --bs-secondary-color: #7d8590;
    --bs-tertiary-color: #484f58;
    --bs-border-color: #30363d;
    --bs-border-color-translucent: rgba(240, 246, 252, 0.15);
    
    /* Force dark backgrounds */
    --bs-light: #161b22;
    --bs-white: #161b22;
    --bs-gray-100: #21262d;
    --bs-gray-200: #30363d;
    --bs-gray-300: #484f58;
}

/* Dark theme specific styles for our custom components */
[data-bs-theme="dark"] .hero {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%) !important;
}

[data-bs-theme="dark"] .hero-quote {
    background: rgba(22, 27, 34, 0.8) !important;
    border-left-color: #0b4b8a !important;
    color: #e6edf3 !important;
}

[data-bs-theme="dark"] .hero-quote .blockquote-footer {
    color: #7d8590 !important;
}

[data-bs-theme="dark"] .stats-section {
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%) !important;
}

[data-bs-theme="dark"] .stat-card {
    background: #0d1117 !important;
    border-color: rgba(11, 75, 138, 0.2) !important;
    color: #e6edf3 !important;
}

[data-bs-theme="dark"] .stat-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .news-section {
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%) !important;
}

[data-bs-theme="dark"] .news-card {
    background: #0d1117 !important;
    border-color: rgba(11, 75, 138, 0.2) !important;
    color: #e6edf3 !important;
}

[data-bs-theme="dark"] .news-card .card-title {
    color: #f0f6fc !important;
}

[data-bs-theme="dark"] .news-card .card-text {
    color: #7d8590 !important;
}

[data-bs-theme="dark"] .section-title {
    color: #0b4b8a !important;
}

[data-bs-theme="dark"] .section-subtitle {
    color: #7d8590 !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .theme-switcher {
        margin-right: 0.5rem;
    }
    
    .theme-toggle {
        width: 35px;
        height: 35px;
    }
    
    .theme-icon {
        font-size: 1rem;
    }
}

/* Animation for theme switching */
.theme-transition {
    transition: all 0.3s ease;
}

/* Ensure theme dropdown is always blue with white text */
[data-bs-theme="light"] .theme-dropdown,
[data-bs-theme="dark"] .theme-dropdown,
[data-bs-theme="auto"] .theme-dropdown {
    background-color: #0b4b8a !important;
    border-color: rgba(11, 75, 138, 0.3) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(11, 75, 138, 0.25) !important;
}

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

[data-bs-theme="light"] .theme-dropdown .dropdown-item i,
[data-bs-theme="dark"] .theme-dropdown .dropdown-item i,
[data-bs-theme="auto"] .theme-dropdown .dropdown-item i {
    color: #ffffff !important;
}

[data-bs-theme="light"] .theme-dropdown .dropdown-item:hover,
[data-bs-theme="dark"] .theme-dropdown .dropdown-item:hover,
[data-bs-theme="auto"] .theme-dropdown .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .theme-dropdown .dropdown-item:hover i,
[data-bs-theme="dark"] .theme-dropdown .dropdown-item:hover i,
[data-bs-theme="auto"] .theme-dropdown .dropdown-item:hover i {
    color: #ffffff !important;
}

[data-bs-theme="light"] .theme-dropdown .dropdown-item.active,
[data-bs-theme="dark"] .theme-dropdown .dropdown-item.active,
[data-bs-theme="auto"] .theme-dropdown .dropdown-item.active {
    background-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

[data-bs-theme="light"] .theme-dropdown .dropdown-item.active i,
[data-bs-theme="dark"] .theme-dropdown .dropdown-item.active i,
[data-bs-theme="auto"] .theme-dropdown .dropdown-item.active i {
    color: #ffffff !important;
}

/* Additional specificity for theme text - ensure white color */
.theme-dropdown .dropdown-item.theme-option,
.theme-dropdown .dropdown-item.theme-option * {
    color: #ffffff !important;
}

.theme-dropdown .dropdown-item.theme-option:hover,
.theme-dropdown .dropdown-item.theme-option:hover * {
    color: #ffffff !important;
}

.theme-dropdown .dropdown-item.theme-option.active,
.theme-dropdown .dropdown-item.theme-option.active * {
    color: #ffffff !important;
}

/* Maximum specificity for all theme dropdown text */
ul.dropdown-menu.theme-dropdown li a.dropdown-item.theme-option,
ul.dropdown-menu.theme-dropdown li a.dropdown-item.theme-option i {
    color: #ffffff !important;
}

ul.dropdown-menu.theme-dropdown li a.dropdown-item.theme-option:hover,
ul.dropdown-menu.theme-dropdown li a.dropdown-item.theme-option:hover i {
    color: #ffffff !important;
}

ul.dropdown-menu.theme-dropdown li a.dropdown-item.theme-option.active,
ul.dropdown-menu.theme-dropdown li a.dropdown-item.theme-option.active i {
    color: #ffffff !important;
}

/* Theme switcher text color - ensure white text */
.header-actions div ul li a {
    color: #ffffff !important;
}

.header-actions div ul li a:hover {
    color: #ffffff !important;
}

.header-actions div ul li a.active {
    color: #ffffff !important;
}

/* More specific selectors for theme switcher */
.header-actions .theme-switcher ul li a,
.header-actions .theme-switcher ul li a * {
    color: #ffffff !important;
}

.header-actions .theme-switcher ul li a:hover,
.header-actions .theme-switcher ul li a:hover * {
    color: #ffffff !important;
}

.header-actions .theme-switcher ul li a.active,
.header-actions .theme-switcher ul li a.active * {
    color: #ffffff !important;
}

/* Maximum specificity for theme dropdown in header actions */
.header-actions .dropdown-menu.theme-dropdown li a.dropdown-item.theme-option,
.header-actions .dropdown-menu.theme-dropdown li a.dropdown-item.theme-option * {
    color: #ffffff !important;
}

.header-actions .dropdown-menu.theme-dropdown li a.dropdown-item.theme-option:hover,
.header-actions .dropdown-menu.theme-dropdown li a.dropdown-item.theme-option:hover * {
    color: #ffffff !important;
}

.header-actions .dropdown-menu.theme-dropdown li a.dropdown-item.theme-option.active,
.header-actions .dropdown-menu.theme-dropdown li a.dropdown-item.theme-option.active * {
    color: #ffffff !important;
}

/* Auto theme detection - now handled by dark-mode-fixes.css */
