/* ------------------------------------------------------------------ */
/*  VoxMarket — custom styling layered on top of the MudBlazor theme.   */
/*  Colors reference MudBlazor CSS variables so they follow dark/light. */
/* ------------------------------------------------------------------ */

html, body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* Brand wordmark with a gradient fill */
.vox-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, var(--mud-palette-primary), var(--mud-palette-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Frosted-glass app bar */
.vox-appbar {
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* ---------------------------- Hero ---------------------------- */
.vox-hero {
    position: relative;
    overflow: hidden;
    padding: 96px 0 72px;
    background:
        radial-gradient(1200px 420px at 18% -20%, color-mix(in srgb, var(--mud-palette-primary) 38%, transparent), transparent 60%),
        radial-gradient(900px 520px at 105% -10%, color-mix(in srgb, var(--mud-palette-secondary) 28%, transparent), transparent 55%);
}

.vox-hero-kicker {
    color: var(--mud-palette-secondary);
    font-weight: 600;
    letter-spacing: 3px;
}

.vox-hero-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 8px 0 16px;
}

.vox-hero-sub {
    color: var(--mud-palette-text-secondary);
    max-width: 620px;
}

.vox-hero-search {
    max-width: 560px;
    margin-top: 28px;
}

.vox-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.vox-hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 22px;
}

.vox-hero-trust span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Benefits / trust strip */
.vox-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.vox-benefit {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 16px;
    background: var(--mud-palette-surface);
    transition: transform .2s ease, border-color .2s ease;
}

.vox-benefit:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 45%, transparent);
}

/* Category tiles */
.vox-cat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.vox-cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 16px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 16px;
    background: var(--mud-palette-surface);
    cursor: pointer;
    text-align: center;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.vox-cat-tile:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 55%, transparent);
}

.vox-cat-tile.active {
    border-color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

/* --------------------------- Product card --------------------------- */
.vox-card {
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.vox-card:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 55%, transparent);
    box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--mud-palette-primary) 60%, transparent);
}

.vox-card-media {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

.vox-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.vox-card:hover .vox-card-img {
    transform: scale(1.06);
}

.vox-card-cat {
    position: absolute;
    top: 12px;
    left: 12px;
}

.vox-card-soldout {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 14, 0.55);
    backdrop-filter: blur(2px);
}

.vox-card-title {
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vox-card-desc {
    color: var(--mud-palette-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.vox-price {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Delivered keys */
.vox-key-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--mud-palette-background-gray);
    border: 1px dashed var(--mud-palette-lines-inputs);
    border-radius: 10px;
    padding: 4px 6px 4px 14px;
    margin-top: 6px;
    max-width: 360px;
}

.vox-key {
    font-family: 'Cascadia Code', 'Consolas', monospace;
    letter-spacing: 1px;
    font-size: 0.95rem;
}

/* Detail page image */
.vox-detail-img {
    width: 100%;
    border-radius: 16px;
    display: block;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

/* Operator panel tabs */
.vox-tabs .mud-tabs-panels { padding-top: 24px; }

/* ----------------------------- Chat ----------------------------- */
.vox-chat {
    display: flex;
    flex-direction: column;
    height: 560px;
    overflow: hidden;
}

.vox-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.vox-chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vox-chat-input {
    display: flex;
    align-items: center;
    padding: 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.vox-bubble-row { display: flex; }
.vox-bubble-row.mine { justify-content: flex-end; }
.vox-bubble-row.other { justify-content: flex-start; }

.vox-bubble {
    max-width: 72%;
    padding: 8px 12px;
    border-radius: 14px;
}

.vox-bubble-mine {
    background: var(--mud-palette-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.vox-bubble-other {
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-lines-default);
    border-bottom-left-radius: 4px;
}

.vox-bubble-author { font-size: .72rem; font-weight: 600; opacity: .85; margin-bottom: 2px; }
.vox-bubble-text { white-space: pre-wrap; word-break: break-word; }
.vox-bubble-time { font-size: .66rem; opacity: .65; text-align: right; margin-top: 2px; }

/* Operator room list */
.vox-room {
    padding: 12px 14px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    cursor: pointer;
    transition: background .15s ease;
}

.vox-room:hover { background: var(--mud-palette-action-default-hover, rgba(125, 92, 255, 0.08)); }
.vox-room.selected { background: color-mix(in srgb, var(--mud-palette-primary) 14%, transparent); }
.vox-room-preview { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* --------------------------- Ratings --------------------------- */
.vox-rating { display: inline-flex; align-items: center; gap: 3px; font-size: .85rem; line-height: 1; }
.vox-rating-empty { color: var(--mud-palette-text-secondary); }
.vox-rating-val { font-weight: 700; }
.vox-rating-max { color: var(--mud-palette-text-secondary); }
.vox-rating-count { color: var(--mud-palette-text-secondary); margin-left: 2px; }

/* ----------------------- Presence indicator ----------------------- */
.vox-presence-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.vox-presence-dot.online { background: #22c55e; box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 25%, transparent); }
.vox-presence-dot.offline { background: #9ca3af; }

/* ----------------------- Games directory (home) ----------------------- */
.vox-games-grid { column-width: 300px; column-gap: 28px; }
.vox-game-col { break-inside: avoid; display: inline-block; width: 100%; margin-bottom: 22px; }
.vox-game-letter { font-family: 'Outfit', sans-serif; font-weight: 800; color: var(--mud-palette-primary); font-size: 1.05rem; margin-bottom: 6px; }
.vox-game-entry { margin-bottom: 10px; }
.vox-game-title { font-weight: 600; display: block; }
.vox-game-offers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vox-game-sep { color: var(--mud-palette-text-disabled); }

/* ----------------------- Offer-type circles (game page) ----------------------- */
.vox-offer-tabs { display: flex; flex-wrap: wrap; gap: 12px; }
.vox-offer-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    cursor: pointer;
    text-align: center;
    padding: 8px;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.vox-offer-tab:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--mud-palette-primary) 55%, transparent); }
.vox-offer-tab.active { background: var(--mud-palette-primary); color: #fff; border-color: var(--mud-palette-primary); }
.vox-offer-tab b { font-size: 1.15rem; margin-top: 2px; }

/* --------------------------- Scrollbar --------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: var(--mud-palette-lines-inputs);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--mud-palette-primary); }

/* Browser autofill on dark inputs: keep our colors instead of the default
   yellow box, and (since the auth forms use placeholders, not floating labels)
   avoid the value being unreadable. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--mud-palette-text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--mud-palette-surface) inset;
    caret-color: var(--mud-palette-text-primary);
    transition: background-color 9999s ease-in-out 0s;
}

/* ----------------- Blazor framework UI (kept from template) ----------------- */
h1:focus { outline: none; }

.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: #2a2a3a;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #8b6cff;
    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;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: #9a98b5;
    font-family: 'Inter', sans-serif;
}

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

#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;
    }
