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

#tooltip:has(div.daggerheart.dh-style.tooltip.card-style),
aside[role='tooltip']:has(div.daggerheart.dh-style.tooltip.card-style) {
    padding: 0;
    border: none;
    border-radius: 10px;
    height: max-content;
    max-height: 650px;
    width: 18rem;
    background-image: url('../assets/parchments/dh-parchment-dark.png');
    outline: 1px solid light-dark(@dark-80, @beige-80);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);

    .tooltip-subtitle {
        margin: 0;
    }

    .tooltip-image {
        width: 100%;
        height: 160px;
        object-fit: cover;
        mask-image: linear-gradient(180deg, black 88%, transparent 100%);
    }

    .tooltip-description {
        font-style: inherit;
        text-align: inherit;
        width: 100%;
        padding: 5px 10px;
        position: relative;
        margin-top: 5px;

        &::before {
            content: '';
            background: @golden;
            mask-image: linear-gradient(270deg, transparent 0%, black 50%, transparent 100%);
            height: 2px;
            width: calc(100% - 10px);
        }

        &::before {
            position: absolute;
            top: -5px;
        }
    }

    .tooltip-duration {
        font-style: italic;
        text-align: start;
        position: relative;
        width: 100%;
        padding: 5px 10px;
        margin: 5px 0px;

        &::before {
            content: '';
            background: @golden;
            mask-image: linear-gradient(270deg, transparent 0%, black 50%, transparent 100%);
            height: 2px;
            width: calc(100% - 10px);
            position: absolute;
            top: -5px;
            font-size: 14px;
        }

        .duration-inner-container {
            display: flex;
            justify-content: center;
            gap: 2px;
            width: 100%;
        }
    }

    .item-icons-list {
        position: absolute;
        display: flex;
        flex-direction: column;
        gap: 5px;
        align-items: end;
        justify-content: center;
        top: 25px;
        right: 10px;
        z-index: 1;

        .item-icon {
            display: flex;
            align-items: center;
            justify-content: end;
            text-align: center;
            padding-right: 8px;
            width: 50px;
            height: 50px;
            font-size: 1.2rem;
            background: light-dark(@dark-blue-60, @dark-golden-80);
            backdrop-filter: blur(8px);
            border: 4px double light-dark(@beige, @golden);
            color: light-dark(@beige, @golden);
            border-radius: 999px;
            transition: all 0.3s ease;

            .recall-label {
                font-size: var(--font-size-14);
                opacity: 0;
                margin-right: 0.3rem;
                transition: all 0.3s ease;
            }

            i {
                font-size: 0.8rem;
            }

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

            &:hover {
                max-width: 300px;
                padding: 0 10px;
                border-radius: 60px;

                .recall-label {
                    opacity: 1;
                }
            }
        }
    }

    .tooltip-hint {
        border-radius: 3px;
        padding: 3px;
        background: light-dark(@dark-blue-60, @rustic-brown-80);
        color: light-dark(@dark-blue, @golden);
        font-size: 12px;
        margin-bottom: 10px;
    }
}

aside[role='tooltip'].locked-tooltip:has(div.daggerheart.dh-style.tooltip.card-style) {
    box-shadow: 0 0 25px @golden-90;
    outline: 1px solid light-dark(@dark-blue, @golden);
}

#tooltip,
.locked-tooltip,
.daggerheart.dh-style.tooltip {
    &.wide {
        max-width: 480px;

        .daggerheart.dh-style.tooltip {
            align-items: start;
        }
    }

    .daggerheart.dh-style.tooltip {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        border-width: 0;

        .tooltip-title-container {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 16px;

            .tooltip-image {
                height: 40px;
                width: 40px;
                border-radius: 6px;
                border: 1px solid @golden;
            }
        }

        .tooltip-title {
            margin: 0;
            text-align: center;
        }

        .tooltip-image {
            height: 180px;
            width: 180px;
        }

        .tooltip-description {
            font-style: italic;
            text-align: start;
        }

        .simple-info {
            font-style: italic;
        }

        .tooltip-information-section {
            width: 100%;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;

            &.spaced {
                margin-top: 8px;
            }

            &.triple {
                grid-template-columns: 1fr 1fr 1fr;
            }

            .tooltip-information {
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 2px;

                &.full-width {
                    grid-column: span 2;
                }

                label {
                    font-weight: bold;
                }

                label,
                div {
                    white-space: nowrap;
                }
            }
        }

        .tooltip-chips {
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
            gap: 8px;

            .tooltip-chip {
                font-size: var(--font-size-18);
                padding: 2px 4px;
                border: 1px solid light-dark(@dark-blue, @golden);
                border-radius: 6px;
                color: light-dark(@dark, @beige);
                background-image: url(../assets/parchments/dh-parchment-dark.png);
            }
        }

        .spaced {
            margin-bottom: 4px;
        }
    }

    .party-list {
        display: flex;
        flex-direction: column;
        button {
            width: 100%;
            align-items: center;
            justify-content: start;
            img {
                border: none;
                width: 1rem;
                height: 1rem;
                object-fit: contain;
            }
        }
    }
}
