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

// Theme header backgrounds
.appTheme({
    .character-header-sheet {
        .character-row .domains-section img {
            filter: @golden-filter;
        }
    }
}, {
    .character-header-sheet {
        .character-row .domains-section img {
            filter: brightness(0) saturate(100%);
        }
    }
});

.application.sheet.daggerheart.actor.dh-style.character {
    .character-header-sheet {
        padding: 0 15px;
        padding-top: var(--header-height);
        width: 100%;

        .name-row {
            display: flex;
            gap: 6px;
            align-items: start;
            justify-content: space-between;
            padding: 0;
            padding-top: 5px;
            flex: 1;

            [contenteditable],
            input {
                border: 1px solid @soft-shadow;
                background-color: light-dark(@dark-15, @soft-white-shadow);
            }

            h1 {
                display: flex;
                flex: 1;
                padding: 6px 0 0 0;
                font-size: var(--font-size-32);
                text-align: start;
                border: 1px solid transparent;
                outline: 2px solid transparent;
                transition: all 0.3s ease;
                word-break: break-word;

                &:hover {
                    outline: 2px solid light-dark(@dark, @golden);
                }
            }

            .level-div {
                white-space: nowrap;
                display: flex;
                justify-content: end;
                height: var(--font-size-32);
                margin-top: 6px;

                .label {
                    display: flex;
                    align-items: baseline;
                    gap: 4px;
                }

                input {
                    border: none;
                    width: 40px;
                    padding: 0;
                    text-align: center;
                    font-weight: 600;
                }

                .level-button {
                    color: light-dark(@dark, @beige);
                    font-size: var(--font-size-18);
                    line-height: 1;
                    min-height: unset;
                    height: min-content;
                    padding: 4px;
                    font-family: 'Cinzel', serif;
                    margin: 0;
                    font-weight: normal;
                    border-color: light-dark(@dark-blue, @golden);
                    background-color: light-dark(transparent, @deep-black);

                    &:hover {
                        background-image: none;
                        background-color: var(--color-warm-2);
                        filter: drop-shadow(0 0 3px lightgray);
                    }
                }
            }
        }

        .character-details {
            display: flex;
            justify-content: space-between;
            padding: 5px 0;
            margin-bottom: 8px;
            font-size: var(--font-size-12);
            color: @color-text-emphatic;

            .missing-header-feature {
                opacity: 0.5;
                text-decoration: line-through;
            }

            span {
                padding: 3px;
                border-radius: 3px;
                transition: all 0.3s ease;
                cursor: pointer;

                &:hover {
                    background: light-dark(@dark-blue-40, @golden-40);
                }

                &.dot {
                    background: transparent;
                    cursor: default;
                }
            }
        }

        .character-row {
            display: flex;
            align-items: center;
            padding: 0;
            margin-bottom: 12px;

            .resource-section {
                display: flex;
                align-items: center;
                gap: 4px;
                margin-right: 20px;

                .resource-manager {
                    transition: all 0.1s ease;

                    &.inverted {
                        transform: rotate(180deg);
                    }
                }
            }

            .downtime-section {
                display: flex;
                align-items: center;
                gap: 2px;
                margin-left: auto;

                button {
                    flex: 1;
                    padding: 0 0.375rem;
                }

                button[data-action='viewParty'] {
                    margin-right: 6px;
                }
            }

            .hope-section,
            .domains-section {
                position: relative;
                display: flex;
                gap: 4px;
                background-color: light-dark(transparent, @dark-blue);
                color: @color-text-emphatic;
                padding: 5px 10px;
                border: 1px solid light-dark(@dark-blue, @golden);
                border-radius: 6px;
                align-items: center;
                width: fit-content;
                height: 30px;

                h4 {
                    font-size: var(--font-size-14);
                    font-weight: bold;
                    text-transform: uppercase;
                    color: @color-text-emphatic;
                    margin-right: 4px;
                }

                .domain {
                    display: flex;
                    align-items: center;
                    gap: 5px;

                    .label {
                        font-size: var(--font-size-14);
                        font-weight: bold;
                        text-transform: uppercase;
                        color: @color-text-emphatic;
                    }

                    img {
                        height: 20px;
                        width: 20px;
                    }
                }

                .hope-value {
                    display: flex;
                    cursor: pointer;

                    &.scar {
                        cursor: initial;
                        opacity: 0.6;
                    }
                }
            }
        }

        .character-traits {
            display: flex;
            padding: 0;
            margin-bottom: 15px;
            justify-content: space-between;
            max-width: 38.5rem;
            gap: 0.5rem;
            padding-left: 0.5rem;

            .trait {
                --color-border: light-dark(@semi-transparent-dark-blue, @golden-60);
                cursor: pointer;
                position: relative;

                display: flex;
                align-items: center;
                justify-content: center;
                flex-direction: column;
                min-width: 4.375rem;

                .trait-name {
                    position: relative;
                    background-color: light-dark(@semi-transparent-dark-blue, @golden-40);
                    border: 1px solid var(--color-border);
                    border-radius: 3px;
                    color: light-dark(var(--color-light-1), @golden);
                    font-size: var(--font-size-12);
                    font-weight: 600;
                    height: 1rem;
                    line-height: 1rem;
                    white-space: nowrap;
                    width: 100%;
                    padding: 0 0.1876px 0 0.375rem;
                    margin-right: 0.125rem; /* makes it center SLIGHTLY */
                    text-shadow: 1px 1px 2px @light-black;

                    display: flex;
                    align-items: center;
                    justify-content: center;

                    .tier-mark {
                        position: absolute;
                        background-color: @dark-blue;
                        border: 1px solid light-dark(@dark-blue, @golden);
                        border-radius: 50%;
                        width: 1rem;
                        height: 1rem;
                        right: calc(100% - 0.4375rem);
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        &.marked::before {
                            content: ' ';
                            position: absolute;
                            width: 0.5rem;
                            height: 0.5rem;
                            border-radius: 50%;
                            background-color: @golden;
                        }
                    }
                }

                .trait-value-area {
                    --background: light-dark(#e8e6e3, @dark-blue);
                    display: flex;
                    position: relative;
                    .trait-value {
                        position: absolute;
                        inset: 0;
                        display: flex;
                        align-items: center;

                        justify-content: center;
                        font-style: normal;
                        font-weight: 600;
                        font-size: var(--font-size-20);
                        text-align: center;
                        margin-bottom: 0.375rem;
                    }

                    .spellcasting-mark {
                        position: absolute;
                        border: 1px solid light-dark(@dark-blue, @golden);
                        color: @golden;
                        left: 0;
                        right: 0;
                        bottom: -0.375rem;
                        margin-inline: auto;
                        border-radius: 50%;
                        width: 1.125rem;
                        height: 1.125rem;
                        background: radial-gradient(190.63% 190.63% at 50% -80.63%, #18152E 70%, #4D4494 80%, #A0837E 90%, var(--color-border) 100%);
                        font-size: var(--font-size-9);
                        text-shadow: 0 0 2px @light-black;

                        display: flex;
                        align-items: center;
                        justify-content: center;
                    }
                }

                &:hover {
                    .trait-name {
                        color: light-dark(@dark, @beige);
                        text-shadow: 0 0 8px light-dark(@dark-80, @beige-80);
                    }
                }
            }
        }
    }
}
