@import "/UI/Core/Styles/Theme.scss";

Pointshop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    color: rgba( 255, 255, 255, 0.88 );
    @include menu-font-body();

    > root {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        opacity: 0;
        transition: opacity $motion-fast;
    }

    > root.visible {
        pointer-events: all;
        opacity: 1;
    }

    > root.hidden {
        pointer-events: none;
        opacity: 0;
    }

    .pointshop-backdrop {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: rgba( 0, 0, 0, 0.55 );
        pointer-events: all;
    }

    .pointshop-window {
        width: 1100px;
        max-width: 94vw;
        height: 720px;
        max-height: 88vh;
        flex-direction: column;
        align-items: stretch;
        pointer-events: all;
        border-radius: 6px;
        overflow: hidden;
        box-shadow: 0px 12px 48px rgba( 0, 0, 0, 0.55 );
        border: 1px solid rgba( 255, 255, 255, 0.08 );
        @include menu-surface-glass( $padding: 0 );
    }

    .pointshop-header {
        width: 100%;
        flex-direction: row;
        align-items: center;
        flex-shrink: 0;
        gap: 16px;
        padding: 10px 14px;
        border-bottom: 1px solid rgba( 255, 255, 255, 0.06 );
        background-color: rgba( 0, 0, 0, 0.35 );
    }

    .pointshop-eyebrow {
        @include menu-eyebrow();
    }

    .pointshop-tabs {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-grow: 1;
    }

    .pointshop-tabs UIButton .ui-button.pointshop-tab {
        background-color: rgba( 0, 0, 0, 0.5 );
        align-items: center;
        justify-content: center;
        border-radius: 5px;
        border: 1px solid rgba( 255, 255, 255, 0.12 );
        margin: 0;
    }

    .pointshop-tabs UIButton .ui-button.pointshop-tab:hover:not( .disabled ) {
        background-color: rgba( $grey, 0.22 );
    }

    .pointshop-tabs UIButton .ui-button.pointshop-tab.active {
        background-color: rgba( $traitor-red, 0.2 );
        border-color: rgba( $traitor-red, 0.45 );
    }

    .pointshop-balance {
        color: rgba( 255, 255, 255, 0.55 );
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .pointshop-close .ui-button {
        flex-shrink: 0;
    }

    .pointshop-body {
        width: 100%;
        flex-grow: 1;
        min-height: 0;
        flex-direction: column;
        padding: 12px;
    }

    // Shared loadout/shop card styles. Both PointshopLoadoutPage and PointshopShopPage
    // render with class="pointshop-loadout ..." so the look stays consistent. Scoping
    // these here (under Pointshop) ensures the shop picks them up despite per-component
    // [StyleSheet] scoping in the page-level scss files.

    .pointshop-loadout {
        width: 100%;
        min-height: 0;
        flex-direction: column;
        gap: 10px;
        flex-grow: 1;
    }

    .loadout-intro {
        width: 100%;
        flex-direction: column;
        flex-shrink: 0;
        gap: 4px;
        padding: 12px 14px;
    }

    .loadout-title {
        font-size: 18px;
        font-weight: 600;
        color: rgba( 255, 255, 255, 0.92 );
    }

    .loadout-copy {
        font-size: 13px;
        color: rgba( 255, 255, 255, 0.55 );
        line-height: 1.4;
    }

    .loadout-banner {
        flex-direction: column;
        flex-shrink: 0;
        gap: 2px;
        margin-top: 8px;
        padding: 8px 12px;
        border-radius: 4px;
        border: 1px solid rgba( 255, 255, 255, 0.08 );
        background-color: rgba( 0, 0, 0, 0.3 );
    }

    .loadout-banner.banner-info {
        border-color: rgba( $grey, 0.35 );
    }

    .loadout-banner.banner-disabled {
        border-color: rgba( $traitor-red, 0.55 );
        background-color: rgba( $traitor-red, 0.12 );
    }

    .banner-title {
        font-size: 13px;
        font-weight: 600;
        color: rgba( 255, 255, 255, 0.92 );
    }

    .banner-copy {
        font-size: 12px;
        color: rgba( 255, 255, 255, 0.7 );
        line-height: 1.4;
    }

    .loadout-body {
        flex-direction: column;
        flex-grow: 1;
        min-height: 0;
        padding: 8px;
    }

    .loadout-scroll {
        flex-direction: column;
        flex-grow: 1;
        min-height: 0;
        overflow-y: scroll;
        padding: 8px;
        gap: 18px;
    }

    .loadout-empty {
        color: rgba( 255, 255, 255, 0.55 );
        font-size: 14px;
        text-align: center;
        padding: 24px;
    }

    .loadout-group {
        width: 100%;
        flex-direction: column;
        flex-shrink: 0;
        gap: 8px;
    }

    .loadout-group-title {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: rgba( 255, 255, 255, 0.5 );
        padding-bottom: 4px;
        border-bottom: 1px solid rgba( 255, 255, 255, 0.08 );
        flex-shrink: 0;
    }

    .loadout-grid {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-content: flex-start;
        justify-content: flex-start;
        gap: 10px;
    }

    .loadout-card {
        position: relative;
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        height: 120px;
        min-height: 120px;
        max-height: 120px;
        flex-shrink: 0;
        flex-grow: 0;
        border-radius: 6px;
        background-color: rgba( 0, 0, 0, 0.5 );
        border: 1px solid rgba( 255, 255, 255, 0.08 );
        cursor: pointer;
        overflow: hidden;
        transition: border-color $motion-fast, transform $motion-fast;
    }

    .loadout-card:hover {
        border-color: rgba( 255, 255, 255, 0.28 );
    }

    .loadout-card.is-on {
        border-color: rgba( $innocent-green, 0.7 );
    }

    .loadout-card.is-on:hover {
        border-color: rgba( $innocent-green, 0.95 );
    }

    .loadout-card.is-locked {
        cursor: default;
        opacity: 0.45;
    }

    .loadout-card.is-locked:hover {
        border-color: rgba( 255, 255, 255, 0.08 );
    }

    .loadout-card.is-unaffordable {
        opacity: 0.55;
    }

    .card-image {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .card-image-fallback {
        align-items: center;
        justify-content: center;
        background-color: rgba( 255, 255, 255, 0.04 );
    }

    .card-image-fallback-letter {
        font-size: 36px;
        font-weight: 700;
        color: rgba( 255, 255, 255, 0.35 );
    }

    .card-source-badge {
        position: absolute;
        top: 4px;
        left: 4px;
        min-width: 22px;
        height: 18px;
        padding: 0 5px;
        align-items: center;
        justify-content: center;
        border-radius: 3px;
        font-size: 11px;
        font-weight: 700;
        font-family: "Consolas", monospace;
        color: rgba( 255, 255, 255, 0.95 );
        background-color: rgba( 50, 130, 240, 0.95 );
        border: 1px solid rgba( 130, 180, 255, 0.85 );
        box-shadow: 0px 2px 4px rgba( 0, 0, 0, 0.4 );
    }

    .card-cost-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        min-width: 28px;
        height: 18px;
        padding: 0 6px;
        align-items: center;
        justify-content: center;
        border-radius: 3px;
        font-size: 11px;
        font-weight: 700;
        color: rgba( 255, 255, 255, 0.96 );
        background-color: rgba( $innocent-green, 0.95 );
        border: 1px solid rgba( $innocent-green, 1 );
        box-shadow: 0px 2px 4px rgba( 0, 0, 0, 0.4 );
    }

    .card-owned-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        height: 18px;
        padding: 0 6px;
        align-items: center;
        justify-content: center;
        border-radius: 3px;
        font-size: 10px;
        font-weight: 700;
        color: rgba( 255, 255, 255, 0.92 );
        background-color: rgba( 0, 0, 0, 0.6 );
        border: 1px solid rgba( 255, 255, 255, 0.18 );
    }

    .card-name-overlay {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 14px 6px 4px 6px;
        align-items: center;
        justify-content: center;
        background-color: rgba( 0, 0, 0, 0.78 );
        border-top: 1px solid rgba( 255, 255, 255, 0.06 );
    }

    .card-name {
        font-size: 11px;
        text-align: center;
        color: rgba( 255, 255, 255, 0.92 );
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 100%;
    }
}
