/**
 * Theme UI dropdown styles
 *
 * Shared by the client and admin sidebar theme menus. The dropdown is rendered
 * inside the inverse (always-dark) sidebar, so it uses inverse tokens for a
 * consistent appearance in both light and dark dashboard themes.
 */

/* Container anchors the absolute panel to the trigger. */
.theme-menu {
    position: relative;
}

/* Dropdown panel: opens upward from the bottom of the trigger so it stays
   visible when the trigger sits at the bottom of the sidebar. */
.theme-menu-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 0.5rem;
    z-index: 50;

    display: none;
    overflow: hidden;

    background-color: var(--color-inverse-panel, #1e293b);
    border: 1px solid var(--color-inverse-line, #475569);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35);
}

.theme-menu-panel.theme-menu-open {
    display: block;
    animation: themeMenuFadeIn 0.18s ease-out;
}

/* Individual theme option row. */
.theme-menu-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    color: var(--color-inverse-ink-secondary, #94a3b8);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-menu-option:hover,
.theme-menu-option:focus-visible {
    background-color: var(--color-inverse-subtle, #334155);
    color: var(--color-inverse-ink, #f8fafc);
    outline: none;
}

.theme-menu-option.active {
    color: var(--color-inverse-ink, #f8fafc);
    background-color: var(--color-accent, #3b82f6);
}

/* Checkmark shown on the currently active option. */
.theme-menu-check {
    margin-left: auto;
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--color-inverse-ink, #f8fafc);
    font-size: 0.625rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.theme-menu-option.active .theme-menu-check {
    opacity: 1;
}

/* Chevron rotation when the menu is open. */
.theme-menu-open .theme-menu-chevron {
    transform: rotate(180deg);
}

/* Fade-in animation for the upward-opening panel. */
@keyframes themeMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
