/* Platform switcher in the sidebar brand slot (and icon-only in the mobile top bar), the same control as Studio's
 * (src/components/PlatformSwitcher.tsx): the blue X, the product name and a chevron;
 * hover, focus or click drops a navy panel listing every Xagio platform.
 * The panel is position: fixed and placed by platform-switcher.js, because .sb is
 * overflow: hidden and would clip it. Navy in both themes, like the sidebar. */

.rd-platform {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    margin: -14px 0 12px;
}

/* A filled tile across the column (no outline, per Studio): the X icon and the
   name, then the chevron in its own slightly darker segment. */
.rd-platform-btn {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 48px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    outline: none;
    transition: background .15s;
}

.rd-platform-btn:hover {
    background: rgba(255, 255, 255, .11);
}

.rd-platform-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .4);
}

.rd-platform-brand {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0 16px 0 12px;
}

.rd-platform-brand img {
    width: auto;
    height: 28px;
}

.rd-platform-name {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1;
    white-space: nowrap;
}

.rd-platform-seg {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    background: rgba(0, 0, 0, .2);
}

.rd-platform-btn .rd-platform-chev {
    color: var(--rd-side-ink, #c9cfdd);
    font-size: 13px;
    transition: transform .15s;
}

.rd-platform-btn[aria-expanded="true"] .rd-platform-chev {
    transform: rotate(180deg);
}

.rd-platform-menu {
    position: fixed;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 236px;
    padding: 6px;
    border-radius: 12px;
    background: #111a32;
    box-shadow: 0 18px 40px rgba(9, 13, 28, .35);
    animation: rd-platform-in .15s ease-out;
}

.rd-platform-menu[hidden] {
    display: none;
}

@keyframes rd-platform-in {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: none; }
}

.rd-platform-caret {
    position: absolute;
    top: -7px;
    width: 12px;
    height: 12px;
    background: #111a32;
    transform: rotate(45deg);
}

.rd-platform-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #fff !important;
    text-decoration: none !important;
    outline: none;
    transition: background .15s;
}

.rd-platform-item:hover,
.rd-platform-item:focus-visible {
    background: rgba(255, 255, 255, .06);
}

.rd-platform-item[aria-current="page"] {
    background: linear-gradient(90deg, #6364f1, #111a32);
    box-shadow: 0 6px 14px rgba(99, 100, 241, .25);
}

.rd-platform-item img {
    flex-shrink: 0;
    width: auto;
    height: 20px;
}

.rd-platform-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.rd-platform-text strong {
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
}

.rd-platform-text small {
    overflow: hidden;
    color: #c9cfdd;
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-platform-item > i {
    flex-shrink: 0;
    color: #c9cfdd;
    font-size: 11px;
}

/* Marketplace icons are inline SVG (mk_icon), not Font Awesome. */
.rd-platform-btn .rd-platform-chev.ico {
    width: 15px;
    height: 15px;
}

.rd-platform-item > .ico {
    width: 13px;
    height: 13px;
    color: #c9cfdd;
    transform: rotate(-90deg);
}

/* In the sidebar head the tile fills the row (the drawer's close button sits after it). */
.sb-top:has(.rd-platform) {
    gap: 8px;
    padding: 8px 16px 12px;
}

.sb-top .rd-platform {
    flex: 1;
    min-width: 0;
    margin: 0;
}

/* The mobile top bar: the icon alone in a small tile, on the themed bar. */
.tb-platform {
    display: none;
    margin: 0;
}

.tb-platform .rd-platform-btn {
    width: 44px;
    height: 44px;
    justify-content: center;
    background: rgba(0, 0, 0, .05);
}

.tb-platform .rd-platform-btn:hover {
    background: rgba(0, 0, 0, .07);
}

html[data-theme="dark"] .tb-platform .rd-platform-btn {
    background: rgba(255, 255, 255, .08);
}

.tb-platform .rd-platform-brand {
    flex: none;
    justify-content: center;
    width: 100%;
    padding: 0;
}

.tb-platform .rd-platform-brand img {
    height: 24px;
}

.tb-platform .rd-platform-name,
.tb-platform .rd-platform-seg {
    display: none;
}

@media (max-width: 760px) {
    .tb-platform {
        display: flex;
    }
}

/* No outlines in the sidebar (Studio): fills instead of borders. */
.sb-admin-entry {
    border: 0 !important;
    background: rgba(255, 255, 255, .05);
}

.sb-admin-entry:hover {
    background: rgba(255, 255, 255, .09);
}

.sb-group-items {
    border-left: 0 !important;
}

.sb-find input[type="search"] {
    border: 0;
    background: rgba(255, 255, 255, .07);
}

.sb-find input[type="search"]:focus {
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 2px rgba(111, 108, 255, .45);
}

.sb-find kbd {
    border: 0;
    background: rgba(255, 255, 255, .08);
}

html[data-theme="dark"] .sb {
    border-right: 0;
}
