/* =========================
   Statusbar
   ========================= */

.statusbar {
    position: fixed;
    box-sizing: border-box;
    left: 0;
    right: 0;
    bottom: 0;

    height: 42px;
    padding: 0 16px;

    display: flex;
    align-items: center;
    gap: 12px;

    background: rgba(15, 15, 15, 0.90);
    color: whitesmoke;

    border-top: 1px solid rgba(255, 255, 255, 0.15);

    z-index: 1000;
    box-sizing: border-box;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
}

/* Indicator dot (JS changes the background-color) */
.statusbar-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 12px;

    margin-right: 8px;

    background: greenyellow; /* default; overridden by JS */

    /* glow */
    box-shadow:
        0 0 6px currentColor,
        0 0 12px currentColor,
        inset 0 0 2px rgba(255, 255, 255, 0.6);

    /* make currentColor follow background-color */
    color: greenyellow;
}

/* Left lane: fixed/capped so buttons never "wiggle" */
.statusbar-value {
    display: inline-block;
    width: clamp(160px, 22vw, 280px); /* stable lane + responsive */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    font-weight: 600;
    letter-spacing: 0.2px;
    opacity: 0.95;
}

/* Buttons container: always centered in remaining space */
.statusbar-mode_buttons {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    white-space: nowrap;
    pointer-events: auto;
}

/* Buttons */
.statusbar-mode_button {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 245, 245, 0.95);

    padding: 6px 10px;
    border-radius: 8px;

    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;

    cursor: pointer;
    user-select: none;

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

.statusbar-mode_button:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.28);
}

.statusbar-mode_button:active {
    transform: translateY(1px);
}

/* Keyboard accessibility */
.statusbar-mode_button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.45);
    outline-offset: 2px;
}

/* Optional active state (toggle from JS) */
.statusbar-mode_button.is-active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.40);
    color: #fff;
}

/* Disabled state */
.statusbar-mode_button:disabled,
.statusbar-mode_button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;

    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.10);
    color: rgba(245, 245, 245, 0.70);
}

.statusbar-mode_button:disabled:hover,
.statusbar-mode_button[disabled]:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.10);
}

/* Version pinned right */
.statusbar-version {
    margin-left: auto;
    white-space: nowrap;

    font-size: 12px;
    font-weight: 600;
    opacity: 0.65;
    letter-spacing: 0.2px;
}

/* =========================
   Responsive tweaks
   ========================= */

@media (max-width: 720px) {
    .statusbar-mode_buttons {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none; /* Firefox */
    }
    .statusbar-mode_buttons::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
}

@media (max-width: 420px) {
    .statusbar-version {
        display: none;
    }
}