/* ========================================
   Theme Switcher Button Styles
   ======================================== */

.theme-switcher-wrapper {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.theme-toggle-btn:active {
    transform: translateY(0);
}

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

/* Hide inactive icons based on theme */
html:not(.dark) .dark-icon,
html.dark .light-icon {
    display: none;
}

/* System icon shows only in system mode */
html:not([data-theme]) .system-icon,
html[data-theme="system"] .system-icon {
    display: inline-flex;
}

html[data-theme="light"] .system-icon,
html[data-theme="dark"] .system-icon {
    display: none;
}

.theme-label {
    font-size: 13px;
    white-space: nowrap;
}

/* Dark mode styles for the switcher itself */
html.dark .theme-toggle-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 2px 10px rgba(245, 87, 108, 0.3);
}

html.dark .theme-toggle-btn:hover {
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .theme-toggle-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .theme-icon {
        width: 18px;
        height: 18px;
    }
    
    .theme-label {
        font-size: 11px;
    }
}

@media (max-width: 767px) {
    .theme-switcher-wrapper {
        margin: 5px 0;
    }
}

/* ========================================
   Topbar Theme Switcher Styles (Next to Language Selector)
   ======================================== */

/* General styles for all navbar locations */
.topbar-area .topbar-theme-switcher,
.info-bar-area .topbar-theme-switcher,
.nav-right-content .topbar-theme-switcher,
.right-content .topbar-theme-switcher,
.left-content .topbar-theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 15px;
    position: relative;
}

.topbar-area .theme-btn,
.info-bar-area .theme-btn,
.nav-right-content .theme-btn,
.right-content .theme-btn,
.left-content .theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1.5px solid #e2e2e2;
    border-radius: 50%;
    background: #ffffff;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    padding: 0;
}

.topbar-area .theme-btn:hover,
.info-bar-area .theme-btn:hover,
.nav-right-content .theme-btn:hover,
.right-content .theme-btn:hover,
.left-content .theme-btn:hover {
    border-color: var(--main-color-one);
    color: var(--main-color-one);
    transform: scale(1.1);
    background: rgba(102, 126, 234, 0.08);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.topbar-area .theme-btn.active,
.info-bar-area .theme-btn.active,
.nav-right-content .theme-btn.active,
.right-content .theme-btn.active,
.left-content .theme-btn.active {
    background: var(--main-color-one);
    border-color: var(--main-color-one);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

/* Dark mode styles for topbar theme switcher */
body.dark-mode-enabled .topbar-area .theme-btn,
body.dark-mode-enabled .info-bar-area .theme-btn,
body.dark-mode-enabled .nav-right-content .theme-btn,
body.dark-mode-enabled .right-content .theme-btn,
body.dark-mode-enabled .left-content .theme-btn {
    border-color: var(--dark-border);
    background: var(--dark-surface);
    color: var(--dark-text);
}

body.dark-mode-enabled .topbar-area .theme-btn:hover,
body.dark-mode-enabled .info-bar-area .theme-btn:hover,
body.dark-mode-enabled .nav-right-content .theme-btn:hover,
body.dark-mode-enabled .right-content .theme-btn:hover,
body.dark-mode-enabled .left-content .theme-btn:hover {
    border-color: var(--dark-accent);
    color: var(--dark-accent);
    background: rgba(74, 158, 255, 0.1);
    transform: scale(1.1);
}

body.dark-mode-enabled .topbar-area .theme-btn.active,
body.dark-mode-enabled .info-bar-area .theme-btn.active,
body.dark-mode-enabled .nav-right-content .theme-btn.active,
body.dark-mode-enabled .right-content .theme-btn.active,
body.dark-mode-enabled .left-content .theme-btn.active {
    background: var(--dark-accent);
    border-color: var(--dark-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

/* RTL support */
[dir="rtl"] .topbar-area .topbar-theme-switcher,
[dir="rtl"] .info-bar-area .topbar-theme-switcher,
[dir="rtl"] .nav-right-content .topbar-theme-switcher,
[dir="rtl"] .right-content .topbar-theme-switcher,
[dir="rtl"] .left-content .topbar-theme-switcher {
    margin-left: 0;
    margin-right: 15px;
    flex-direction: row-reverse;
}

/* Individual button colors for better visual distinction */
/* Light button (sun) */
.topbar-area .theme-btn.light-btn:hover,
.info-bar-area .theme-btn.light-btn:hover,
.nav-right-content .theme-btn.light-btn:hover,
.right-content .theme-btn.light-btn:hover,
.left-content .theme-btn.light-btn:hover {
    color: #f59e0b;
    border-color: #f59e0b;
}

.topbar-area .theme-btn.light-btn.active,
.info-bar-area .theme-btn.light-btn.active,
.nav-right-content .theme-btn.light-btn.active,
.right-content .theme-btn.light-btn.active,
.left-content .theme-btn.light-btn.active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* System button (desktop) */
.topbar-area .theme-btn.system-btn:hover,
.info-bar-area .theme-btn.system-btn:hover,
.nav-right-content .theme-btn.system-btn:hover,
.right-content .theme-btn.system-btn:hover,
.left-content .theme-btn.system-btn:hover {
    color: #8b5cf6;
    border-color: #8b5cf6;
}

.topbar-area .theme-btn.system-btn.active,
.info-bar-area .theme-btn.system-btn.active,
.nav-right-content .theme-btn.system-btn.active,
.right-content .theme-btn.system-btn.active,
.left-content .theme-btn.system-btn.active {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Dark button (moon) */
.topbar-area .theme-btn.dark-btn:hover,
.info-bar-area .theme-btn.dark-btn:hover,
.nav-right-content .theme-btn.dark-btn:hover,
.right-content .theme-btn.dark-btn:hover,
.left-content .theme-btn.dark-btn:hover {
    color: #4a9eff;
    border-color: #4a9eff;
}

.topbar-area .theme-btn.dark-btn.active,
.info-bar-area .theme-btn.dark-btn.active,
.nav-right-content .theme-btn.dark-btn.active,
.right-content .theme-btn.dark-btn.active,
.left-content .theme-btn.dark-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #4a9eff 100%);
    border-color: #4a9eff;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

/* Dark mode specific colors */
body.dark-mode-enabled .topbar-area .theme-btn.light-btn.active,
body.dark-mode-enabled .info-bar-area .theme-btn.light-btn.active,
body.dark-mode-enabled .nav-right-content .theme-btn.light-btn.active,
body.dark-mode-enabled .right-content .theme-btn.light-btn.active,
body.dark-mode-enabled .left-content .theme-btn.light-btn.active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

body.dark-mode-enabled .topbar-area .theme-btn.system-btn.active,
body.dark-mode-enabled .info-bar-area .theme-btn.system-btn.active,
body.dark-mode-enabled .nav-right-content .theme-btn.system-btn.active,
body.dark-mode-enabled .right-content .theme-btn.system-btn.active,
body.dark-mode-enabled .left-content .theme-btn.system-btn.active {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
}

body.dark-mode-enabled .topbar-area .theme-btn.dark-btn.active,
body.dark-mode-enabled .info-bar-area .theme-btn.dark-btn.active,
body.dark-mode-enabled .nav-right-content .theme-btn.dark-btn.active,
body.dark-mode-enabled .right-content .theme-btn.dark-btn.active,
body.dark-mode-enabled .left-content .theme-btn.dark-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #4a9eff 100%);
    border-color: #4a9eff;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.5);
}

/* Responsive adjustments for topbar */
@media (max-width: 991px) {
    .topbar-area .topbar-theme-switcher,
    .info-bar-area .topbar-theme-switcher,
    .nav-right-content .topbar-theme-switcher,
    .right-content .topbar-theme-switcher,
    .left-content .topbar-theme-switcher {
        margin-left: 10px;
        gap: 4px;
    }

    .topbar-area .theme-btn,
    .info-bar-area .theme-btn,
    .nav-right-content .theme-btn,
    .right-content .theme-btn,
    .left-content .theme-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
}

@media (max-width: 767px) {
    .topbar-area .topbar-theme-switcher,
    .info-bar-area .topbar-theme-switcher,
    .nav-right-content .topbar-theme-switcher,
    .right-content .topbar-theme-switcher,
    .left-content .topbar-theme-switcher {
        gap: 3px;
        margin-left: 8px;
    }

    .topbar-area .theme-btn,
    .info-bar-area .theme-btn,
    .nav-right-content .theme-btn,
    .right-content .theme-btn,
    .left-content .theme-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}
