/**
 * Copyright (c) Enalean, 2024 - Present. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 *
 */

.prose-mirror-toolbar-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: var(--tlp-small-spacing) var(--tlp-medium-spacing);
    background: var(--tlp-white-color);
    gap: var(--tlp-small-spacing);
}

$magic-value-taken-from-mockups-to-have-a-separator-smaller-than-form-element-height: 7px;
$margin-of-separator: calc(
    $magic-value-taken-from-mockups-to-have-a-separator-smaller-than-form-element-height / 2
);
$height-of-separator: calc(
    var(--tlp-form-element-small-height) -
        $magic-value-taken-from-mockups-to-have-a-separator-smaller-than-form-element-height
);

.prose-mirror-button-group {
    display: flex;
    gap: var(--tlp-small-spacing);
    position: relative;
    padding: 0 var(--tlp-small-spacing) 0 0;

    &::after {
        content: "";
        display: block;
        position: absolute;
        top: $margin-of-separator;
        right: 0;
        width: 1px;
        height: $height-of-separator;
        background: var(--tlp-neutral-dark-color);
    }

    &:last-child::after {
        display: none;
    }
}

.prose-mirror-button {
    width: var(--tlp-form-element-small-height);
    height: var(--tlp-form-element-small-height);
    border: 0;
    box-shadow: none;

    &.button-active {
        background: var(--tlp-main-color-lighter-90);
    }

    &:hover {
        color: var(--tlp-typo-default-text-color);
    }

    &.tlp-button-secondary:disabled {
        color: var(--tlp-dimmed-color);
    }
}

.prose-mirror-toolbar-select-disabled {
    cursor: not-allowed;
}

.popover-scroll {
    max-height: 250px;
    overflow-x: scroll;
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tlp-small-spacing);

    > .emoji-button {
        transition: background-color 200ms ease;
        border: 0;
        border-radius: var(--tlp-small-radius);
        background: none;
        font-size: 1rem;

        &:hover {
            background-color: var(--tlp-dimmed-color-transparent-90);
            cursor: pointer;
        }

        &.emoji-button-hide {
            display: none;
        }
    }
}
