/* =========================================
GLOBAL SETTINGS DROPDOWN
========================================= */

.global-settings-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.global-settings-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
PANEL CONTAINER
========================================= */

.global-settings-panel {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;

    width: 320px;

    background: #FFFDF5;
    border: 1px solid var(--color-border);
    border-radius: 3px;

    padding: 24px 22px 22px 22px;

    z-index: 100;

    transition:
        background-color 180ms ease,
        border-color 180ms ease;
}

:root:not([data-theme="dark"]) .gs-theme-toggle-button.is-active {
    background: #FFFDF5;
}

:root[data-theme="dark"] .global-settings-panel {
    background: #000000;
}

.global-settings-panel[hidden] {
    display: none;
}

/* =========================================
PANEL HEADER
========================================= */

.global-settings-panel-header {
    margin-bottom: 12px;
}

.global-settings-panel-header-with-back {
    display: flex;
    align-items: center;
    gap: 10px;
}

.global-settings-panel-title {
    display: inline-flex;
    align-items: center;

    font-size: 14px;
    font-weight: 600;

    color: var(--color-text);
}

.global-settings-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    background: none;
    border: none;
    padding: 0;

    color: var(--color-text);
    cursor: pointer;
}

.global-settings-back-button svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* =========================================
PANEL CONTENT
========================================= */

.global-settings-panel-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* =========================================
OPTION ROW
========================================= */

.global-settings-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    width: 100%;

    background: none;
    border: none;
    padding: 8px 0;

    font: inherit;
    font-size: 14px;

    color: var(--color-muted-text);
    text-align: left;

    cursor: pointer;

    transition: color 180ms ease;
}

.global-settings-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    gap: 16px;
}

.global-settings-option-left {
    display: flex;
    align-items: center;
    min-width: 0;
}

.global-settings-option-right {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;
    margin-left: auto;
}

.global-settings-option-label {
    display: inline-flex;
    align-items: center;
}

.global-settings-option-value {
    font-size: 14px;
    color: var(--color-muted-text);
}

.global-settings-option-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 16px;
    height: 16px;

    color: var(--color-muted-text);
}

.global-settings-option-arrow svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* =========================================
THEME TOGGLE
========================================= */

.gs-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gs-theme-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: none;

    color: var(--color-muted-text);

    cursor: pointer;
    padding: 0;

    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        transform 120ms ease;
}

.gs-theme-toggle-button:hover {
    transform: translateY(-1px);
}

.gs-theme-toggle-button.is-active {
    color: var(--color-text);
    background: var(--color-surface);
}

.gs-theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 16px;
    height: 16px;
}

.gs-theme-toggle-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* =========================================
TRANSITIONS
========================================= */

.global-settings-panel [data-gs-panel-body] {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.global-settings-panel [data-gs-panel-body].is-transitioning {
    opacity: 0;
    transform: translateY(4px);
}

.global-settings-option-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 16px;
    height: 16px;

    color: var(--color-text);

    opacity: 1;
    transform: scale(1);
    transition:
        opacity 140ms ease,
        transform 140ms ease;
}

.global-settings-option-check svg {
    display: block;
    width: 16px;
    height: 16px;
}
