/* Reviactyl panel global stylesheet — ported 1:1 from resources/scripts/assets/css/GlobalStylesheet.ts */

/* NOTE: the colour/theme custom properties are injected inline by the layout
   (layouts/app.tmpl, layouts/auth.tmpl) from the Designify config. They must
   NOT be redefined here, otherwise this later-loaded stylesheet would override
   the runtime values. */

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background-color: rgb(var(--color-800));
    color: rgb(var(--color-200));
    letter-spacing: 0.015em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    letter-spacing: normal;
    font-family: "IBM Plex Sans", "Roboto", system-ui, sans-serif;
}

p {
    color: rgb(var(--color-200));
    line-height: 1.375;
}

form {
    margin: 0;
}

textarea, select, input, button, button:focus, button:focus-visible {
    outline: none;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    background: none;
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-thumb {
    border: solid 0 rgb(0 0 0 / 0%);
    border-right-width: 4px;
    border-left-width: 4px;
    -webkit-border-radius: 9px 4px;
    -webkit-box-shadow: inset 0 0 0 1px hsl(211, 10%, 53%), inset 0 0 0 4px hsl(209deg 18% 30%);
}

::-webkit-scrollbar-track-piece {
    margin: 4px 0;
}

::-webkit-scrollbar-thumb:horizontal {
    border-right-width: 0;
    border-left-width: 0;
    border-top-width: 4px;
    border-bottom-width: 4px;
    -webkit-border-radius: 4px 9px;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* HTMX page transition (mirrors the React CSSTransition "fade" classNames). */
.fade-enter {
    opacity: 0;
}

.fade-enter-active {
    opacity: 1;
    transition: opacity 150ms ease-in-out;
}

.htmx-swapping {
    opacity: 0;
    transition: opacity 150ms ease-in-out;
}

.htmx-settling {
    opacity: 1;
}

/* Sidebar active link uses the Color 50 text colour (design spec: all text uses Color 50). */
.side-nav-link.active {
    color: rgb(var(--color-50));
    fill: rgb(var(--color-50));
}

/* Sidebar group header. Deliberately only text: small, bold, uppercase — no
   icon, no rule — so it labels a block of links without competing with them. */
.side-nav-group {
    margin: 16px 0 4px;
    padding: 0 12px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgb(255 255 255 / 0.38);
    user-select: none;
}

/* The first header sits directly under the brand block. */
.side-nav-group:first-child {
    margin-top: 2px;
}

/* Progress bar for HTMX requests (bottom of RouterContainer). */
#htmx-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background-color: rgb(var(--color-primary));
    z-index: 100;
    transition: width 200ms ease;
    opacity: 0;
}

#htmx-progress.active {
    opacity: 1;
}

/* Scrolling still works everywhere, but no scrollbar is ever painted. */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Copy-on-click targets (server address, subdomains, allocation IPs). */
[data-copy] {
    cursor: pointer;
}

[data-copy]:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

[data-copy]:focus-visible {
    outline: 2px solid rgb(var(--color-primary));
    outline-offset: 2px;
    border-radius: 4px;
}

.copy-tip {
    position: fixed;
    z-index: 9999;
    transform: translate(-50%, -100%) scale(0.96);
    background: #18181b;
    border: 1px solid #3f3f46;
    color: #fafafa;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms ease, transform 150ms ease;
}

.copy-tip.show {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
}
