/* Follow the active MudBlazor theme background; dark fallback covers the WASM load. */
html {
    margin: 0;
    background-color: var(--mud-palette-background, #15121C);
}

body {
    margin: 0;
}

/* Thin, themed scrollbars that follow the palette instead of the OS default. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--mud-palette-lines-default) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--mud-palette-lines-default);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--mud-palette-primary);
        background-clip: padding-box;
    }

/* A soft purple glow at the top of the content area adds depth without fighting the theme. */
.mud-main-content {
    background-image: radial-gradient(1200px 420px at 50% -220px, rgba(124, 77, 255, 0.12), transparent 70%);
    background-repeat: no-repeat;
}

/* A hairline under the app bar to separate it cleanly from the content glow. */
.mud-appbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* Responsive catalogue grid: fills the row evenly instead of ragged-centred fixed cards. */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

/* Catalogue cards lift on hover and gently zoom their cover for a more tactile feel. */
.entity-card {
    transition: transform 150ms ease, box-shadow 150ms ease;
    overflow: hidden;
}

    .entity-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    }

    .entity-card .mud-card-media {
        transition: transform 220ms ease;
    }

    .entity-card:hover .mud-card-media {
        transform: scale(1.05);
    }

/* Content (and its skeleton) eases in rather than popping, smoothing the load → list transition. */
@keyframes vinylhog-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.card-grid {
    animation: vinylhog-fade-in 220ms ease-out;
}

/* Signed-out landing: a soft purple/pink glow behind the sign-in card. */
.login-hero {
    background:
        radial-gradient(900px 520px at 50% -8%, rgba(124, 77, 255, 0.22), transparent 60%),
        radial-gradient(640px 460px at 100% 100%, rgba(231, 174, 192, 0.12), transparent 55%);
    border-radius: 16px;
}

.login-prompt {
    background-image: linear-gradient(160deg, var(--mud-palette-surface), var(--mud-palette-background));
    border: 1px solid var(--mud-palette-lines-default);
}

/* Detail dialogs: full-bleed cover image, clipped to the dialog's rounded corners,
   with no title bar or content padding so the image sits flush at the very top. */
.entity-detail-dialog {
    overflow: hidden;
    padding: 0;
}

.entity-detail-dialog .mud-dialog-content {
    padding: 0 !important;
}

.entity-detail-dialog .mud-dialog-title {
    display: none;
}

/* Detail hero: the full cover sits on a blurred, zoomed copy of itself so non-square art has no bare
   letterboxing, and a bottom scrim keeps the overlaid title legible over any image. */
.entity-detail-hero {
    position: relative;
    height: 260px;
    overflow: hidden;
    background-color: var(--mud-palette-surface);
}

.entity-detail-hero__backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.65);
    transform: scale(1.25);
}

.entity-detail-hero__img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.entity-detail-hero__scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.35) 28%, rgba(0, 0, 0, 0) 55%);
}

.entity-detail-hero__title {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 14px;
    color: #fff;
}

.entity-detail-hero__actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

    .entity-detail-hero__actions .mud-icon-button {
        color: #fff;
        background: rgba(0, 0, 0, 0.45);
    }

/* Chat dialog: a fixed-height column whose middle (message list) scrolls. The empty title region is hidden so the
   header sits flush at the top (same as the detail dialogs). */
.chat-dialog .mud-dialog-content {
    padding: 0 !important;
}

.chat-dialog .mud-dialog-title {
    display: none;
}

.chat-message-list {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    /* A tone behind the bubbles so the (surface-coloured) incoming bubbles stand out. */
    background-color: var(--mud-palette-background);
}

/* Comments dialog: same flush, fixed-height-column-with-scrolling-middle pattern as the chat dialog. */
.comments-dialog .mud-dialog-content {
    padding: 0 !important;
}

.comments-dialog .mud-dialog-title {
    display: none;
}

.comment-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

/* Chat bubbles: own messages use the primary accent; the other party uses the surface tone with a
   border so it reads as a distinct bubble against the message area. */
.chat-bubble {
    max-width: 75%;
    border-radius: 16px;
    padding: 8px 12px;
    word-break: break-word;
}

.chat-bubble-own {
    background-color: var(--mud-palette-primary);
    color: #fff;
}

.chat-bubble-other {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-lines-default);
}

/* Ephemeral "X is typing…" line just above the composer; gently pulses so it reads as live activity. */
.chat-typing {
    animation: chat-typing-pulse 1.4s ease-in-out infinite;
}

@keyframes chat-typing-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Unread/pending count on a nav link: a fully-controlled dot, vertically centred and inset from the
   right so it isn't clipped by the (mini) drawer edge — replaces MudBadge's edge-centred dot. */
.nav-link-badged {
    position: relative;
}

.nav-link-badged .nav-unread {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 9px;
    background-color: var(--mud-palette-error);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

/* Darker, blacker backdrop behind dialogs. */
.mud-overlay-scrim {
    background-color: rgba(0, 0, 0, 0.72) !important;
}

/* Snackbars: themed surface instead of bright filled colours, with a severity accent. */
.mud-snackbar[class*="mud-alert-filled"] {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    border-left: 4px solid var(--mud-palette-lines-default);
}

.mud-snackbar[class*="mud-alert-filled"] .mud-icon-root,
.mud-snackbar[class*="mud-alert-filled"] .mud-button-root {
    color: var(--mud-palette-text-primary) !important;
}

.mud-snackbar.mud-alert-filled-success {
    border-left-color: var(--mud-palette-success);
}

.mud-snackbar.mud-alert-filled-error {
    border-left-color: var(--mud-palette-error);
}

.mud-snackbar.mud-alert-filled-warning {
    border-left-color: var(--mud-palette-warning);
}

.mud-snackbar.mud-alert-filled-info {
    border-left-color: var(--mud-palette-info);
}

/* Pill-shaped buttons (text/filled/outlined); icon buttons stay circular. */
.mud-button-root:not(.mud-icon-button) {
    border-radius: 999px !important;
}

/* Soft purple elevation on filled buttons so primary actions stand out. */
.mud-button-root.mud-button-filled {
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.30);
    transition: box-shadow 120ms ease-in-out;
}

.mud-button-root.mud-button-filled:hover {
    box-shadow: 0 6px 16px rgba(124, 77, 255, 0.42);
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwv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DcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-logo {
    position: absolute;
    display: block;
    width: 4.5rem;
    height: 4.5rem;
    inset: calc(20vh - 6rem) 0 auto 0;
    margin: 0 auto;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #2E2740;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #B085F5;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: #CFCBE0;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #B085F5;
}