/* AppSwitcher – shared cross-app navigation dropdown
   Uses CSS variables from colors.css (loaded by all apps).
*/

.app-switcher {
    position: relative;
    display: inline-block;
}

.app-switcher-btn {
    background: var(--toolbar-button-bg, #0f172a);
    color: var(--toolbar-text, #e5e7eb);
    border: 1px solid var(--toolbar-border, #1e293b);
    border-radius: 6px;
    height: 34px;
    padding: 0 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition:
        background 0.15s,
        border-color 0.15s;
}

.app-switcher-btn:hover {
    background: var(--toolbar-button-hover, #1e293b);
    border-color: var(--border-light, #334155);
}

.app-switcher-chevron {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s;
}

.app-switcher.open .app-switcher-chevron {
    transform: rotate(180deg);
}

.app-switcher-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 200px;
    background: var(--panel, var(--toolbar-bg, #0f172a));
    border: 1px solid var(--toolbar-border, #1e293b);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    overflow: hidden;
    margin-top: 4px;
    padding: 4px 0;
}

/* Invisible bridge so the pointer can travel from the trigger button to
   the dropdown panel without crossing a "dead" zone that would trigger
   mouseleave and close the menu on hover-to-open. */
.app-switcher.open .app-switcher-dropdown::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
}

.app-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--toolbar-text, #e5e7eb);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
    cursor: pointer;
}

.app-switcher-item:hover,
.app-switcher-item.highlighted {
    background: var(--sidebar-hover, #1e293b);
}

.app-switcher-item.highlighted {
    outline: 2px solid var(--sidebar-active, #3b82f6);
    outline-offset: -2px;
}

.app-switcher-item.active {
    background: var(--sidebar-hover, #1e293b);
    font-weight: 600;
}

.app-switcher-item i:first-child {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.app-switcher-item span {
    flex: 1;
}

.app-switcher-check {
    color: var(--success-color, #10b981);
    font-size: 12px;
    flex-shrink: 0;
}
