@import "/UI/Core/Styles/Theme.scss";

.mod-menu-page {
    width: 100%;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    padding: 12px 12px 100px 12px;

    // Outer shell is ONE surface so nav + content read as a single unified menu.
    .mod-shell {
        width: 100%;
        max-width: 1340px;
        min-height: 0;
        max-height: 850px;
        flex-grow: 1;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        margin-left: auto;
        margin-right: auto;
    }

    // Vertical 1px divider between nav and content (and between list and detail).
    .mod-vdivider {
        width: 1px;
        align-self: stretch;
        background-color: rgba( 255, 255, 255, 0.06 );
        flex-shrink: 0;
    }

    // The first vdivider (between nav and content) is more prominent than the
    // list/detail one nested inside .mod-list-detail.
    .mod-shell > .mod-vdivider {
        background-color: rgba( 255, 255, 255, 0.10 );
    }

    .mod-nav {
        flex-shrink: 0;
        width: 200px;
        align-self: stretch;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 14px 10px;
        background-color: rgba( 0, 0, 0, 0.40 );
    }

    UIButton .ui-button.mod-nav-button {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        padding: 9px 12px;
        font-size: 13px;
        margin: 0;
        border-radius: 4px;
    }

    UIButton .ui-button.mod-nav-button:hover:not( .disabled ) {
        background-color: rgba( 255, 255, 255, 0.06 );
    }

    UIButton .ui-button.mod-nav-button.active {
        background-color: rgba( $traitor-red, 0.18 );
    }

    .mod-content {
        flex-grow: 1;
        min-width: 0;
        min-height: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    // List + detail layout (Players, Reports). Internal-only flex split, separated by a divider.
    .mod-list-detail {
        width: 100%;
        flex-grow: 1;
        min-height: 0;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
    }

    .mod-list {
        flex-shrink: 0;
        flex-basis: 320px;
        min-width: 240px;
        max-width: 420px;
        min-height: 0;
        padding: 16px 18px;
        gap: 10px;
        background-color: rgba( 0, 0, 0, 0.2 );
    }

    .mod-detail {
        flex-grow: 1;
        min-width: 0;
        min-height: 0;
        padding: 16px 18px;
        gap: 10px;
    }

    // Full-width content for Banned/Tools/Ranks/Pointshop. No own surface; lives inside the shell surface.
    .mod-pane {
        width: 100%;
        flex-grow: 1;
        min-height: 0;
        flex-direction: column;
        gap: 0;
        padding: 18px 20px;
    }

    .mod-pane-section {
        flex-direction: column;
        gap: 10px;
    }

    // Lift section so open rank menu wins hit-testing against next section.
    .mod-pane-section.rank-section-active {
        position: relative;
        z-index: 300;
    }

    .mod-pane-divider {
        width: 100%;
        height: 1px;
        background-color: rgba( 255, 255, 255, 0.06 );
        margin: 14px 0;
        flex-shrink: 0;
    }

    // Card kept for list+detail surfaces (mod-list, mod-detail) and the player detail header.
    .mod-card {
        min-height: 0;
        gap: 10px;
        padding: 16px 18px;
    }

    .mod-card-eyebrow,
    .mod-pane-eyebrow {
        @include menu-eyebrow();
        margin-bottom: 6px;
    }

    .mod-list-scroll {
        flex-direction: column;
        gap: 6px;
    }

    .mod-detail-scroll,
    .mod-stack-scroll {
        flex-direction: column;
        gap: 8px;
    }

    // Empty-state composition: large icon + bold label + small subtitle, vertically centered.
    .mod-empty {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 40px 20px;
        margin: auto;
        color: rgba( 255, 255, 255, 0.45 );
    }

    .mod-empty-icon {
        font-family: $font-family-icon;
        font-size: 48px;
        opacity: 0.6;
        text-transform: lowercase;
        height: 60px;
        min-height: 60px;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mod-empty-label {
        font-size: 16px;
        font-weight: 700;
        color: rgba( 255, 255, 255, 0.78 );
    }

    .mod-empty-sub {
        font-size: 12px;
        opacity: 0.7;
        text-align: center;
    }

    // Inline-expand panel that opens beneath an action button (Ban, Gimp, Slay, BanId).
    .mod-action-expand {
        flex-direction: column;
        gap: 6px;
        padding: 10px 12px;
        margin: 4px 0 8px 0;
        background-color: rgba( 0, 0, 0, 0.32 );
        border: 1px solid rgba( 255, 255, 255, 0.08 );
        border-radius: 6px;
    }

    .mod-action-expand .slidercontrol { min-height: 24px; }
    .mod-action-expand .slider-value-tooltip,
    .mod-action-expand .ui-slider-tooltip,
    .mod-action-expand .value-tooltip { display: none; }

    UIButton .ui-button.mod-action {
        transition: background-color 0.1s ease;
    }

    UIButton .ui-button.mod-action:active {
        background-color: rgba( $traitor-red, 0.64 );
    }

    .mod-rank-select {
        width: 90px;
        flex-shrink: 0;
        flex-direction: column;
        position: relative;
        pointer-events: all;
    }

    .mod-rank-select.is-open {
        z-index: 200;
    }


    UIButton .ui-button.mod-rank-trigger {
        width: 100%;
        flex-direction: row-reverse;
        justify-content: space-between;
        border-radius: 3px;
        padding: 4px 8px;
        font-size: 12px;
    }

    .mod-rank-menu {
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 4px;
        width: 90px;
        border: 1px solid rgba( white, 0.22 );
        border-radius: 6px;
        background-color: rgba( 0, 0, 0, 0.95 );
        box-shadow: 0px 6px 18px rgba( 0, 0, 0, 0.5 );
        padding: 3px;
        flex-direction: column;
        gap: 2px;
        z-index: 200;
        pointer-events: all;
    }

    UIButton .ui-button.mod-rank-item {
        width: 100%;
        justify-content: flex-start;
        flex-shrink: 0;
        padding: 4px 8px;
        font-size: 12px;
        border: 0;
        border-radius: 3px;
        box-shadow: none;
        background-color: transparent;
    }

    UIButton .ui-button.mod-rank-item:hover:not( .disabled ) {
        background-color: rgba( white, 0.08 );
    }

    UIButton .ui-button.mod-rank-item.active {
        background-color: rgba( $traitor-red, 0.45 );
    }

    .mod-pointshop-manifest-scroll {
        flex-direction: column;
        min-height: 0;
        gap: 8px;
        padding-right: 6px;
        max-height: 360px;
    }

    .mod-round-logs-header {
        flex-direction: column;
        flex-shrink: 0;
        gap: 8px;
    }

    .mod-round-logs-controls-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px;
        flex-shrink: 0;
    }

    .mod-round-logs-filter-toggle {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .mod-round-logs-filters {
        flex-shrink: 0;
        flex-wrap: wrap;
    }

    .mod-round-logs-player-select {
        width: 260px;
        max-width: 260px;
        flex-shrink: 0;
        align-self: flex-start;
        flex-direction: column;
        position: relative;
        pointer-events: all;
    }

    UIButton .ui-button.mod-round-logs-player-trigger {
        width: 100%;
        flex-direction: row-reverse;
        justify-content: space-between;
        border-radius: 3px;
    }

    .mod-round-logs-player-menu {
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 4px;
        width: 260px;
        max-height: 260px;
        overflow-y: scroll;
        border: 1px solid rgba( white, 0.22 );
        border-radius: 6px;
        background-color: rgba( 0, 0, 0, 0.95 );
        box-shadow: 0px 6px 18px rgba( 0, 0, 0, 0.5 );
        padding: 4px;
        flex-direction: column;
        gap: 2px;
        z-index: 200;
        pointer-events: all;
    }

    UIButton .ui-button.mod-round-logs-player-item {
        width: 100%;
        justify-content: flex-start;
        flex-shrink: 0;
        padding: 8px 12px;
        border: 0;
        border-radius: 3px;
        box-shadow: none;
        background-color: transparent;
    }

    UIButton .ui-button.mod-round-logs-player-item:hover:not( .disabled ) {
        background-color: rgba( white, 0.08 );
    }

    UIButton .ui-button.mod-round-logs-player-item.active {
        background-color: rgba( $traitor-red, 0.45 );
    }

    .mod-round-logs-scroll {
        width: 100%;
        height: 0;
        flex-grow: 1;
        min-height: 0;
        max-height: 100%;
        flex-direction: column;
        gap: 4px;
        overflow-y: scroll;
        padding-right: 6px;
    }

    .mod-round-logs-scroll.dropdown-blocking {
        pointer-events: none;
    }

    .mod-evidence-scroll {
        width: 100%;
        height: 0;
        flex-grow: 1;
        min-height: 0;
        max-height: 100%;
        flex-direction: column;
        gap: 4px;
        overflow-y: scroll;
        padding-right: 6px;
    }

    .mod-pointshop-manifest-list {
        flex-direction: column;
        gap: 6px;
    }

    .mod-pointshop-manifest-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        padding: 6px 8px;
        border-radius: 4px;
        background-color: rgba( 0, 0, 0, 0.25 );
    }

    .mod-pointshop-manifest-cell {
        flex-shrink: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-shadow: none;
    }

    .mod-pointshop-manifest-name {
        flex-grow: 1;
        flex-shrink: 1;
        min-width: 0;
    }

    .mod-pointshop-manifest-ident {
        width: 220px;
        color: rgba( 255, 255, 255, 0.55 );
    }

    .mod-pointshop-manifest-price {
        width: 64px;
        text-align: right;
    }

    .mod-pointshop-manifest-category {
        width: 120px;
    }

    UIButton .ui-button.mod-pointshop-manifest-remove {
        width: 92px;
        flex-shrink: 0;
        justify-content: center;
    }

    .mod-pointshop-settings {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    .mod-pointshop-card {
        width: 100%;
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
        border-radius: 6px;
        border: 1px solid rgba( 255, 255, 255, 0.08 );
        background-color: rgba( 0, 0, 0, 0.32 );
    }

    .mod-pointshop-eyebrow {
        @include menu-eyebrow();
        flex-shrink: 0;
    }

    .mod-pointshop-caption {
        @include menu-copy( $size: 11px, $color: rgba( 255, 255, 255, 0.62 ), $tracking: 0.4px );
        flex-shrink: 0;
    }

    .mod-pointshop-credits-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }

    .mod-pointshop-action-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mod-pointshop-field {
        flex-direction: column;
        gap: 4px;
    }

    .mod-pointshop-field-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .mod-pointshop-field-label {
        width: 80px;
        flex-shrink: 0;
        text-shadow: none;
    }

    .mod-pointshop-field-title {
        text-shadow: none;
    }

    .mod-pointshop-text-entry {
        margin: 0;
        height: 28px;
        font-size: 12px;

        .content-label,
        .prefix-label,
        .suffix-label,
        .placeholder {
            font-size: 12px;
            padding: 4px 8px;
        }
    }

    .mod-pointshop-text-entry-grow {
        flex-grow: 1;
        min-width: 0;
    }

    .mod-pointshop-category-list {
        flex-direction: column;
        flex-shrink: 0;
        gap: 4px;
        max-height: 220px;
        overflow-y: scroll;
        padding-right: 6px;
    }

    .mod-pointshop-category-row {
        flex-direction: row;
        flex-shrink: 0;
        align-items: center;
        gap: 8px;
        padding: 4px 8px;
        border-radius: 4px;
        border: 1px solid rgba( 255, 255, 255, 0.08 );
        background-color: rgba( 0, 0, 0, 0.3 );
    }

    .mod-pointshop-category-name {
        flex-grow: 1;
        font-size: 12px;
    }

    .mod-pointshop-category-select {
        position: relative;
        flex-grow: 1;
        flex-direction: column;
    }

    .mod-pointshop-category-select.is-disabled {
        opacity: 0.5;
    }

    UIButton .ui-button.mod-pointshop-category-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 5px 10px;
        font-size: 12px;
    }

    .mod-pointshop-category-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 10;
        flex-direction: column;
        max-height: 200px;
        overflow-y: scroll;
        margin-top: 2px;
        padding: 4px;
        gap: 2px;
        border-radius: 4px;
        border: 1px solid rgba( 255, 255, 255, 0.18 );
        background-color: rgba( 8, 8, 8, 0.96 );
    }

    UIButton .ui-button.mod-pointshop-category-item {
        padding: 5px 10px;
        font-size: 12px;
        text-align: left;
        background-color: transparent;
        border: 1px solid transparent;
    }

    UIButton .ui-button.mod-pointshop-category-item:hover:not( .active ) {
        background-color: rgba( $grey, 0.22 );
    }

    UIButton .ui-button.mod-pointshop-category-item.active {
        background-color: rgba( $traitor-red, 0.2 );
        border-color: rgba( $traitor-red, 0.45 );
    }

    .mod-section-header {
        @include menu-eyebrow();
        margin-top: 4px;
        padding-bottom: 4px;
        border-bottom: 1px solid rgba( white, 0.18 );
        flex-shrink: 0;
    }

    .mod-section-header + .mod-section-header,
    .mod-reports-list + .mod-section-header,
    .mod-rounds-list + .mod-section-header {
        margin-top: 14px;
    }

    .mod-reports-list,
    .mod-rounds-list {
        flex-direction: column;
        gap: 8px;
        flex-shrink: 0;
        max-height: 32vh;
        overflow-y: scroll;
        padding-right: 4px;

        UIButton {
            width: 100%;
        }

        UIButton .ui-button.player-row {
            width: 100%;
            cursor: pointer;
            text-align: left;
            padding: 8px 12px;
            border-radius: 8px;
            border: 0;
            box-shadow: none;
            background-color: rgba( black, 0.3 );
            justify-content: flex-start;
        }

        UIButton .ui-button.player-row > label {
            flex-grow: 1;
            text-align: left;
        }

        UIButton .ui-button.player-row:hover:not( .disabled ) {
            background-color: rgba( $grey, 0.5 );
        }

        UIButton .ui-button.player-row.active {
            background-color: rgba( $traitor-red, 0.4 );
        }
    }

    .player-list {
        .player-row-wrap {
            width: 100%;
        }

        UIButton {
            width: 100%;
        }

        UIButton .ui-button.player-row {
            width: 100%;
            cursor: pointer;
            text-align: left;
            padding: 8px 12px;
            border-radius: 8px;
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
            border: 0;
            box-shadow: none;
            background-color: rgba( black, 0.3 );
            justify-content: flex-start;
        }

        UIButton .ui-button.player-row > label {
            flex-grow: 1;
            text-align: left;
        }

        UIButton .ui-button.player-row:hover:not( .disabled ) {
            background-color: rgba( $grey, 0.5 );
        }

        UIButton .ui-button.player-row.active {
            background-color: rgba( $traitor-red, 0.4 );
        }
    }

    .report-text-box {
        background-color: rgba( 0, 0, 0, 0.4 );
        border-radius: 8px;
        padding: 10px 12px;
        border: 1px solid rgba( 255, 255, 255, 0.12 );
    }

    UIButton .ui-button.report-btn--slay {
        background-color: rgba( $traitor-red, 0.3 );
        border: 1px solid rgba( $traitor-red, 0.5 );
    }

    UIButton .ui-button.report-btn--slay:hover:not( .disabled ) {
        background-color: rgba( $traitor-red, 0.5 );
    }
}
