:root {
    --accent: #f5b50a;
    --accent-2: #ffd66b;
    --accent-soft: rgba(245, 181, 10, 0.12);
    --accent-glow: rgba(245, 181, 10, 0.35);
}

html, body {
    font-family: Lexend, sans-serif;
    background-color: black;
    color: white;
}

.btn-accent {
    background: var(--accent);
    color: #0a0b0d;
    border-color: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #0a0b0d;
    box-shadow: 0 10px 34px -8px var(--accent-glow);
}

a, .btn-link {
    color: #006bb7;
}

.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: 1.5rem;
    flex-grow: 1;
}

h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuN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3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.main-layout {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.main-layout > main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar {
    display: flex;
    flex-direction: column;
    width: 240px;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    padding: 1rem 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: block;
    padding: 0.5rem 1.25rem 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.sidebar-toggler {
    display: none;
    margin: 0 1.25rem 0.5rem;
}

.sidebar-collapse {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.sidebar-nav {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
}

.sidebar-download {
    margin-top: auto;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: flex-start;
}

.sidebar-account {
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.sidebar-home-link {
    display: block;
    margin-top: 0.5rem;
    color: var(--accent) !important;
}

.sidebar-home-link:hover {
    color: var(--accent-2) !important;
}

.navbar-nav {
    align-items: flex-start;
}

.nav-item {
    padding: 0.5rem 1rem;
}

@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .sidebar-toggler {
        display: inline-block;
    }

    .sidebar-collapse {
        display: none;
    }

    .sidebar-collapse.show {
        display: flex;
    }
}

.roundedprofile {
    border-radius: 50%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.25rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dashboard-card:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: #fff;
}

.dashboard-card .bi {
    font-size: 1.5rem;
    color: var(--accent);
}

.dashboard-card-title {
    font-weight: 600;
}

.dashboard-card-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Inventory layout */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
}

.inventory-item {
    position: relative;
}

.inventory-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.4rem;
    background-color: #1a1d20;
    border: 1px solid #343a40;
    border-radius: 0.4rem;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

    .inventory-card:hover {
        border-color: #0d6efd;
    }

    /* Square thumbnail slot that holds the centered spinner behind the image. */
    .inventory-card .inv-thumb {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1;
    }

    .inventory-card .inv-img {
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        background-color: #15171a;
        border-radius: 0.3rem;
        /* Hidden until the icon finishes downloading; revealing it (opaque bg) covers the spinner. */
        opacity: 0;
        transition: opacity 0.2s ease-in;
    }

        .inventory-card .inv-img.loaded {
            opacity: 1;
        }

    /* Loading spinner shown in the slot until the image loads. Centered via inset+margin (NOT transform,
       which Bootstrap's spinner-border animation already uses for the rotation). */
    .inv-spinner {
        position: absolute;
        inset: 0;
        margin: auto;
        color: #6c757d;
    }

    /* Once the sibling image has loaded, hide the spinner (the image is painted under the
       absolutely-positioned spinner, so opacity alone can't cover it). */
    .inv-img.loaded ~ .inv-spinner,
    .item-popup-icon.loaded ~ .inv-spinner,
    .detail-thumb img.loaded ~ .inv-spinner {
        display: none;
    }

    .inventory-card .inv-name {
        margin-top: 0.35rem;
        font-size: 0.78rem;
        font-weight: 600;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .inventory-card .inv-sub {
        font-size: 0.7rem;
        color: #9aa0a6;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* Special-pattern tier badge overlaid on the inventory card (background color is set inline per entry). */
.inv-tier-badge {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    z-index: 2;
    padding: 0.1rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #000;
    border-radius: 0.3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Contextual action (Case ROI / Catalog) overlaid on the inventory card, top-left. */
.inv-action {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background-color: rgba(13, 110, 253, 0.85);
    border-radius: 0.3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.inventory-item:hover .inv-action {
    opacity: 1;
}

    .inv-action:hover {
        background-color: #0d6efd;
        color: #fff;
    }

/* Inventory item hover popup */
.item-popup {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    z-index: 1050;
    width: 20rem;
    margin-left: 0.5rem;
    padding: 0.75rem;
    background-color: #1a1d20;
    border: 1px solid #495057;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.6);
    color: #fff;
}

.inventory-item:hover .item-popup {
    display: block;
}

/* Square slot holding the spinner behind the popup icon. */
.item-popup-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
}

.item-popup-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

    .item-popup-icon.loaded {
        opacity: 1;
    }

/* Detail-page hero image with a centered spinner behind it until the icon loads. */
.detail-thumb {
    position: relative;
}

    .detail-thumb img {
        opacity: 0;
        transition: opacity 0.2s ease-in;
    }

        .detail-thumb img.loaded {
            opacity: 1;
        }

/* ---- Trade-up calculator ---- */

/* Combobox dropdown under the skin search input. */
.tu-combo-list {
    position: absolute;
    z-index: 1060;
    width: 100%;
    max-height: 22rem;
    overflow-y: auto;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.6);
}

.tu-combo-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: #fff;
}

    .tu-combo-item:hover {
        background-color: #2a2e33;
    }

.tu-combo-thumb {
    width: 32px;
    height: 24px;
    object-fit: contain;
}

.tu-row-thumb {
    width: 40px;
    height: 30px;
    object-fit: contain;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* Hover tooltip shared by skin names/thumbs across the calculator. */
.tu-tip-wrap {
    position: relative;
    cursor: default;
}

.tu-tip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    z-index: 1070;
    width: 16rem;
    margin-bottom: 0.35rem;
    padding: 0.6rem 0.75rem;
    background-color: #1a1d20;
    border: 1px solid #495057;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.6);
    color: #fff;
    white-space: normal;
    text-align: left;
}

.tu-tip-wrap:hover .tu-tip {
    display: block;
        }

/* Invisible bridge over the gap so the pointer can move into the tooltip to click links. */
.tu-tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.45rem;
}

.tu-tip-thumb {
    width: 100%;
    max-height: 5rem;
    object-fit: contain;
    margin-bottom: 0.4rem;
    background-color: #0d0f11;
    border-radius: 0.35rem;
}

.tu-tip-link {
    display: inline-block;
    margin-top: 0.35rem;
    color: #6ea8fe;
    text-decoration: none;
}

    .tu-tip-link:hover {
        text-decoration: underline;
    }

/* Skin-name links in the input/outcome tables keep the table's text color but stay visibly underlined. */
.tu-skin-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(110, 168, 254, 0.7);
    text-underline-offset: 2px;
}

    .tu-skin-link:hover {
        text-decoration-color: currentColor;
    }

/* Catalog */
.catalog-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.catalog-group-card {
    display: flex;
    flex-direction: column;
    padding: 0.4rem;
    background-color: #1a1d20;
    border: 1px solid #343a40;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.catalog-group-card:hover {
    border-color: #0d6efd;
}

.catalog-group-card .inv-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.catalog-group-label {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-rarity-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.catalog-hero {
    background-color: #15171a;
    border: 1px solid #343a40;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-hero-img {
    max-width: 100%;
    max-height: 18rem;
    object-fit: contain;
}

.catalog-case-thumb img {
    width: 64px;
    height: 48px;
    object-fit: contain;
}

/* Catalog v2 */
.catalog-group-card .inv-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background-color: #15171a;
    border-radius: 0.3rem;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}
.catalog-group-card .inv-img.loaded { opacity: 1; }

.catalog-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}
.catalog-cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.4rem 0.5rem;
    background-color: #1a1d20;
    border: 1px solid #343a40;
    border-radius: 0.5rem;
    color: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.catalog-cat-tile:hover { border-color: #0d6efd; background-color: #20242a; }
.catalog-cat-tile .bi { font-size: 1.6rem; }

.catalog-result-card { border-left-width: 3px; border-left-style: solid; }

.catalog-search { position: relative; }
.catalog-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1080;
    background-color: #1a1d20;
    border: 1px solid #495057;
    border-radius: 0 0 0.4rem 0.4rem;
    max-height: 22rem;
    overflow-y: auto;
}
.catalog-suggest-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #2a2e33;
}
.catalog-suggest-item:hover { background-color: #2a2e33; }
.catalog-suggest-item img { width: 36px; height: 28px; object-fit: contain; }
.catalog-suggest-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: 0 0 auto; }

/* StatTrak / Souvenir variant coloring (CS in-game name colors) */
.text-stattrak { color: #cf6a32 !important; }
.text-souvenir { color: #ffd700 !important; }
.badge-stattrak { background-color: #cf6a32; color: #000; }
.badge-souvenir { background-color: #ffd700; color: #000; }

/* Catalog v3 */
.catalog-cat-tile { text-decoration: none; }
.catalog-result-card { position: relative; overflow: visible; }
.catalog-tip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1075;
    width: 15rem;
    margin-bottom: 0.35rem;
    padding: 0.5rem 0.7rem;
    background-color: #1a1d20;
    border: 1px solid #495057;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.6);
    color: #fff;
    white-space: normal;
    text-align: left;
    pointer-events: none;
}
.catalog-result-card:hover .catalog-tip { display: block; }
