/* Theme Toggle Styles - Inspired by Jeff Su */
.theme-toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 24px;
    font-size: 14px;
    background: var(--color-background);
    white-space: nowrap;
    min-width: 240px;
}

.theme-toggle-button {
    flex: 1;
    padding: 6px 12px;
    border-radius: 20px;
    color: var(--color-secondary);
    transition: all 0.15s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 450;
    line-height: 1;
    text-align: center;
    min-width: 60px;
    white-space: nowrap;
}

.theme-toggle-button:hover {
    color: var(--color-contrast);
    background: var(--color-background-100);
}

/* Highlight active theme button */
html[data-color-scheme="light"] .theme-toggle-button[value="light"],
html[data-color-scheme="dark"] .theme-toggle-button[value="dark"],
html:not([data-color-scheme]) .theme-toggle-button[value="system"] {
    background: var(--color-background-100);
    color: var(--color-contrast);
}

/* Styles for the theme toggle in the sidebar footer */
.sidebar-footer {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.sidebar-footer .theme-toggle-container {
    margin: 0;
    justify-content: center;
    width: 100%;
    max-width: 280px;
}

/* Popup footer theme toggle styles */
.popup-footer {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.popup-footer .theme-toggle-container {
    margin: 0;
    justify-content: center;
    width: 100%;
    max-width: 280px;
}

/* Header theme toggle styles */
.header-buttons .theme-toggle-container {
    margin: 0 var(--spacing-1);
}

@media (max-width: 767px) {
    .header-buttons .theme-toggle-container {
        display: none;
    }
}

/* Responsive adjustments */
@media (--breakpoint-lg) {
    .sidebar .button-member {
        display: none;
    }

    .sidebar-footer {
        padding: 1.5rem;
    }

    .theme-toggle-container {
        min-width: 220px;
    }
}
