/* Layout tokens shared by the app shell and pages. Media queries cannot use variables,
   breakpoints are Bootstrap ones only: 576 / 768 / 992 / 1200 / 1400 px (mobile-first, min-width). */
:root {
    --pow-touch-target: 44px;
    --pow-mobile-bottom-nav-height: 56px;
    --pow-desktop-top-bar-height: 3.5rem;
    --pow-safe-area-top: env(safe-area-inset-top, 0px);
    --pow-safe-area-right: env(safe-area-inset-right, 0px);
    --pow-safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --pow-safe-area-left: env(safe-area-inset-left, 0px);
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: white;
    cursor: url('../images/shared/cursor.png') 0 0, default !important;
    -webkit-tap-highlight-color: rgba(100, 150, 255, 0.2);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* A scrolled-to or focused element must not end up under the sticky top bar */
html {
    scroll-padding-top: calc(96px + var(--pow-safe-area-top));
}

@media (min-width: 992px) {
    html {
        scroll-padding-top: calc(var(--pow-desktop-top-bar-height) + 16px);
    }
}

/* On body only: it propagates to the canvas, so overscroll never flashes white. A background on html would stop
   the propagation and the background of body would then cover the pinned page background below. */
body {
    background-color: #0a0a0a;
}

/* Page background pinned to the viewport, a background of the page element would stretch with its height or end
   with it (background-attachment: fixed does not work on iOS). Large viewport height keeps the scale of the image
   while the bars of a mobile browser collapse. */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100lvh;
    z-index: -1;
    background: url('../images/pow_bg.jpg') center / cover no-repeat;
}

button, input[type="button"], input[type="submit"] {
    cursor: url('../images/shared/hand_32.png') 12 0, default !important;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
    cursor: url('../images/shared/hand_32.png') 12 0, default !important;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Dark Room Loading Screen */
.loading-room {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    perspective: 800px;
    overflow: hidden;
}

/* Back wall - slightly lighter to show depth */
.room-back {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 60%;
    height: 50%;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid #222;
}

/* Left wall - angled with perspective */
.room-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, #050505 0%, #151515 100%);
    transform-origin: right center;
    clip-path: polygon(0 0, 100% 15%, 100% 65%, 0 100%);
}

/* Right wall - mirrored angle */
.room-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 20%;
    height: 100%;
    background: linear-gradient(270deg, #050505 0%, #151515 100%);
    transform-origin: left center;
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 65%);
}

/* Floor - perspective plane */
.room-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    background: linear-gradient(0deg, #080808 0%, #121212 100%);
    clip-path: polygon(0 100%, 20% 0, 80% 0, 100% 100%);
}

/* Light from behind camera, slightly from left */
.room-light {
    position: absolute;
    bottom: 0;
    left: 30%;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse 80% 50% at 40% 100%,
        rgba(255, 250, 240, 0.06) 0%,
        rgba(255, 250, 240, 0.02) 40%,
        transparent 70%
    );
    pointer-events: none;
}

/* Loading content container - centered on back wall (top 15% + half of 50% height = 40%) */
.loading-content {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
}

.loading-title {
    font-size: 1rem;
    font-weight: 300;
    color: white;
    letter-spacing: 0.3em;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.loading-bar {
    width: 300px;
    height: 2px;
    background: #333;
    position: relative;
}

.loading-bar-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: #fff;
    box-shadow:
        0 0 4px #fff,
        0 0 8px #fff,
        0 0 16px #fff,
        0 0 32px #0ff,
        0 0 48px #0ff,
        0 0 64px #0ff;
    transition: width 0.1s ease-out;
    animation: neon-pulse 2s ease-in-out infinite;
}

@keyframes neon-pulse {
    0%, 100% {
        box-shadow:
            0 0 4px #fff,
            0 0 8px #fff,
            0 0 16px #fff,
            0 0 32px #0ff,
            0 0 48px #0ff,
            0 0 64px #0ff;
    }
    50% {
        box-shadow:
            0 0 6px #fff,
            0 0 12px #fff,
            0 0 24px #fff,
            0 0 48px #0ff,
            0 0 72px #0ff,
            0 0 96px #0ff;
    }
}

code {
    color: #c02d76;
}

/******************/

span, h2, h3, h4, h5, h6, p {
    color: white;
    text-shadow: 2px 2px 5px black;
}

.base-bg {
    background-color: rgba(0,0,0, 0.7);
}

.r {
    border: solid red 1px;
}

.g {
    border: solid green 1px;
}

.b {
    border: solid blue 1px;
}

h1 {
    color: #b0910c;
    font-weight: 800;
    font-family: Consolas;
    text-shadow: 2px 2px 3px black;
}

.img-border {   
    box-shadow: 0 0 5px white;
}

.neon-purple-very-bright {
    border: solid white 1px;
    box-shadow: 0 0 .2rem #fff,
        0 0 .2rem #fff, 
        0 0 2rem #bc13fe, 
        0 0 0.8rem #bc13fe, 
        0 0 2.8rem #bc13fe, 
        inset 0 0 1.3rem #bc13fe;
}

.neon-purple {
    border: solid white 1px;
    box-shadow: 0 0 .2rem #fff, 0 0 .2rem #fff, 0 0 2rem #bc13fe, 0 0 0.8rem #bc13fe, inset 0 0 1.3rem #bc13fe;
}

.neon-blue {
    border: solid white 1px;
    box-shadow: 0 0 .2rem #fff, 0 0 .2rem #fff, 0 0 2rem #3347ff, 0 0 0.6rem #3347ff, inset 0 0 0.5rem #3347ff;
}

.neon-green {
    border: solid white 1px;
    box-shadow: 0 0 .2rem #fff, 0 0 .2rem #fff, 0 0 2rem #4caf50, 0 0 0.6rem #4caf50, inset 0 0 0.5rem #4caf50;
}

.neon-white {
    border: solid white 1px;
    box-shadow: 0 0 .2rem #fff, 0 0 .3rem #fff inset 0 0 0.2rem #fff;
}

/* Global input styling - semi-transparent dark theme */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="week"],
input[type="month"],
textarea,
select {
    background-color: rgba(30, 30, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: white;
}

/* Touch devices: iOS Safari zooms the whole page when a focused input has font-size below 16px.
   !important wins over component styles that shrink inputs for desktop density. */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    textarea,
    select {
        font-size: max(16px, 1em) !important;
    }
}

/* Horizontally scrollable row (tab bars, chips). The edge behind which more content is hidden fades out,
   so it is visible that the row continues. Browsers without scroll-driven animations just scroll. */
@property --pow-scroll-fade-start {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

@property --pow-scroll-fade-end {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

@keyframes pow-scroll-fade-x {
    0% {
        --pow-scroll-fade-start: 0px;
        --pow-scroll-fade-end: 32px;
    }

    8%, 92% {
        --pow-scroll-fade-start: 32px;
        --pow-scroll-fade-end: 32px;
    }

    100% {
        --pow-scroll-fade-start: 32px;
        --pow-scroll-fade-end: 0px;
    }
}

.pow-scroll-fade-x {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.pow-scroll-fade-x::-webkit-scrollbar {
    display: none;
}

@supports (animation-timeline: scroll()) {
    .pow-scroll-fade-x {
        mask-image: linear-gradient(to right,
            transparent,
            black var(--pow-scroll-fade-start),
            black calc(100% - var(--pow-scroll-fade-end)),
            transparent);
        animation: pow-scroll-fade-x linear both;
        animation-timeline: scroll(self inline);
    }
}

/* Action beside the main one (ActionExecuteButton), for a link as well as for a button */
.pow-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: var(--pow-touch-target);
    padding: 7px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #b0b0b0;
    border-radius: 8px;
    color: #b0b0b0;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    text-shadow: 1px 1px 3px black;
    transition: all 0.2s;
}

@media (hover: hover) {
    .pow-secondary-action:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: white;
        color: white;
    }
}

/* Phones: toasts across the full width at the top instead of a narrow box in the corner */
@media (max-width: 575.98px) {
    .toast-container {
        left: 0 !important;
        right: 0 !important;
        padding: calc(8px + var(--pow-safe-area-top)) 8px 8px !important;
    }

    .toast-container .toast {
        width: 100%;
    }
}