@import '../../../utils/colors.less';
@import '../../../utils/fonts.less';
@import '../../../utils/mixin.less';

body.game:is(.performance-low, .noblur) {
    .application.sheet.daggerheart.actor.dh-style.party .tab.resources .actors-list .actor-resources {
        background: light-dark(@dark-blue, @dark-golden);

        .actor-name {
            background: light-dark(@dark-blue, @dark-golden);
        }
    }
}

.application.sheet.daggerheart.actor.dh-style.party .tab.partyMembers {
    overflow: auto;

    .actors-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        width: 100%;

        .actor-resources {
            display: grid;
            grid-template:
                "img header" min-content
                "img body" 1fr
                / 7.5rem 1fr;
            gap: 6px;
            column-gap: 12px;
            padding: 6px;
            background-color: light-dark(@dark-blue-10, @golden-10);

            .actor-img-frame {
                grid-area: img;
                width: 7.375rem;
                height: 7.375rem;
                position: relative;
                
                .actor-img {
                    object-fit: cover;
                    object-position: top center;
                    border-radius: 6px;
                    width: 100%;
                    height: 100%;
                }

                .equipped-weapons {
                    position: absolute;
                    top: -2px;
                    left: -3px;
                    display: flex;
                    flex-direction: column;
                    gap: 1px;
                    img {
                        border-radius: 50%;
                        width: 24px;
                        height: 24px;
                        border: 1px solid light-dark(@dark-blue, @golden);
                        object-fit: cover;
                    }
                }

                .evasion {
                    position: absolute;
                    top: 1px;
                    right: 1px;
                    width: 1.75rem;
                    height: 1.75rem;
                    background: url('../assets/svg/trait-shield.svg') no-repeat;
                    background-size: 100%;
                    color: var(--color-light-1);
                    font-size: var(--font-size-14);
                    font-weight: 700;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                }

                .threshold-section {
                    position: absolute;
                    left: 0;
                    right: 0;
                    bottom: -2px;
                    margin: auto;

                    display: flex;
                    gap: 4px;
                    background-color: light-dark(var(--color-light-1), @dark-blue);
                    color: light-dark(@dark-blue, @golden);
                    padding: 4px 6px;
                    border: 1px solid light-dark(@dark-blue, @golden);
                    border-radius: 3px;
                    align-items: baseline;
                    width: fit-content;

                    h4 {
                        font-weight: bold;
                        text-transform: uppercase;
                        white-space: nowrap;

                        &.threshold-label {
                            font-size: var(--font-size-10);
                            color: light-dark(@dark-blue, @golden);
                        }

                        &.threshold-value {
                            font-size: var(--font-size-11);
                            color: light-dark(@dark, @beige);
                        }
                    }
                }
            }

            header {
                grid-area: header;
                display: grid;
                grid-template:
                    "name hope" min-content
                    "subtitle subtitle" min-content
                    / 1fr min-content;

                .actor-name {
                    width: 100%;
                    z-index: 1;
                    font-size: var(--font-size-20);
                    color: light-dark(@dark-blue, @golden);
                    font-weight: bold;
                }

                .delete-icon {
                    font-size: 0.75em;
                }

                .subtitle {
                    grid-area: subtitle;
                    font-size: var(--font-size-14);
                }

                .hope-section {
                    display: flex;
                    background-color: light-dark(transparent, @dark-blue);
                    color: light-dark(@dark-blue, @golden);
                    padding: 3px 6px;
                    border: 1px solid light-dark(@dark-blue, @golden);
                    border-radius: 3px;
                    align-items: center;
                    width: fit-content;
                    margin-left: auto;

                    h4 {
                        font-size: var(--font-size-12);
                        font-weight: bold;
                        text-transform: uppercase;
                        color: light-dark(@dark-blue, @golden);
                        margin-right: 3px;
                    }

                    .hope-value {
                        display: flex;
                        cursor: pointer;
                        font-size: var(--font-size-12);
                        margin-left: 1px;
                    }
                }
            }

            .body {
                grid-area: body;
                display: flex;
                align-items: start;
                justify-content: space-between;
            }

            .resources {
                display: flex;
                flex-direction: column;
                gap: 4px;

                .slot-section {
                    display: flex;
                    flex-direction: row;
                    align-items: stretch;

                    .slot-label {
                        display: flex;
                        align-items: center;
                        color: light-dark(@beige, @dark-blue);
                        background: light-dark(@dark-blue, @golden);
                        padding: 0 4px;
                        width: fit-content;
                        font-weight: bold;
                        border-radius: 6px 0px 0px 6px;
                        font-size: var(--font-size-12);
                        white-space: nowrap;

                        .label {
                            padding-right: 2px;
                        }

                        .value {
                            font-variant-numeric: tabular-nums;
                            .current {
                                display: inline-block;
                                text-align: end;
                                width: 2ch;
                            }
                            .max {
                                display: inline-block;
                                text-align: start;
                                width: 2ch;
                            }
                        }
                    }

                    .slot-bar {
                        display: flex;
                        align-items: center;
                        flex-wrap: wrap;
                        gap: 4px;

                        background-color: light-dark(@dark-blue-10, @dark-blue);
                        color: light-dark(@dark-blue, @golden);
                        padding: 2px 5px;
                        border: 1px solid light-dark(@dark-blue, @golden);
                        border-radius: 0 6px 6px 0;
                        width: fit-content;
                        min-height: 22px;

                        .armor-slot {
                            cursor: pointer;
                            transition: all 0.3s ease;
                            font-size: var(--font-size-12);

                            .fa-shield-halved {
                                color: light-dark(@dark-blue-40, @golden-40);
                            }
                        }

                        .slot {
                            width: 16px;
                            height: 10px;
                            border: 1px solid light-dark(@dark-blue, @golden);
                            background: light-dark(@dark-blue-10, @golden-10);
                            border-radius: 3px;
                            transition: all 0.3s ease;
                            cursor: pointer;

                            &.filled {
                                background: light-dark(@dark-blue, @golden);
                            }
                        }
                    }
                }
            }

            .traits {
                background-color: light-dark(@dark-blue-10, @dark-blue);
                border: 1px solid light-dark(@dark-blue, @golden);
                border-radius: 6px;
                display: grid;
                grid-template-columns: 1fr 1fr;                
                font-size: var(--font-size-12);
                padding: 3px 4px;
                gap: 3px 7px;
                .trait {
                    display: flex;
                    justify-content: space-between;
                    gap: 3px;
                    .label {
                        color: light-dark(@dark-blue, @golden);
                    }
                    .value {
                        font-weight: 600;
                    }
                }
            }
        }
    }

    .actors-dragger {
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 100%;
        height: 40px;
        border: 1px dashed light-dark(@dark-blue-50, @beige-50);
        border-radius: 3px;
        color: light-dark(@dark-blue-50, @beige-50);
    }
}
