@use "variables" as *;

:host {
    display: block;

    &:last-child {
        margin-bottom: 0;
    }
}

.dot-history-timeline-item {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: $spacing-0;
    min-height: 80px;
}

.dot-history-timeline-item__marker-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding: 0 2px;
}

.dot-history-timeline-item__marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid $white;
    position: relative;
    z-index: 2;
    background: $color-palette-gray-400;
    flex-shrink: 0;

    &--live {
        background: $color-palette-green;
        box-shadow: 0 0 0 2px $color-palette-green-op-20;
    }

    &--draft {
        background: $color-palette-yellow;
        box-shadow: 0 0 0 2px $color-palette-yellow-op-20;
    }
}

.dot-history-timeline-item__connector {
    width: 2px;
    background: $color-palette-gray-300;
    flex-shrink: 0;

    &--top {
        height: $spacing-3 + $spacing-0;
    }

    &--bottom {
        flex: 1;
    }
}

:host:first-child .dot-history-timeline-item__connector--top {
    visibility: hidden;
}

:host:last-child .dot-history-timeline-item__connector--bottom {
    visibility: hidden;
}

.dot-history-timeline-item__content-wrapper {
    background: $color-palette-gray-100;
    border-radius: $border-radius-md;
    padding: $spacing-1;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: $spacing-1;
    transition: background-color $basic-speed ease;
    flex: 1;

    &:hover {
        background: $color-palette-primary-op-10;

        .dot-history-timeline-item__actions {
            visibility: visible;
        }
    }

    &--active {
        background: $color-palette-primary-op-30 !important;

        .dot-history-timeline-item__actions {
            visibility: visible;
        }
    }
}

.dot-history-timeline-item__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: $spacing-1;
}

.dot-history-timeline-item__header {
    display: flex;
    gap: $spacing-1;
    align-items: center;
    line-height: $spacing-4;
}

.dot-history-timeline-item__time-section {
    display: flex;
    align-items: center;
    gap: $spacing-2;
}

.dot-history-timeline-item__time-relative {
    font-weight: $font-weight-medium-bold;
    color: $black;
    font-size: $font-size-md;
}

.dot-history-timeline-item__actions {
    display: flex;
    visibility: hidden;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dot-history-timeline-item__user-section {
    display: flex;
    align-items: center;
    gap: $spacing-0;
}

::ng-deep .dot-history-timeline-item__avatar.p-avatar {
    width: 21px;
    height: 21px;
}

.dot-history-timeline-item__user-name {
    color: $color-palette-gray-800;
    font-size: $font-size-md;
}

::ng-deep .dot-history-timeline-item__tooltip.p-tooltip {
    &.p-tooltip-bottom {
        transform: translateX(-55px);

        .p-tooltip-arrow {
            border-bottom-color: $color-palette-primary-200;
            border-top-color: transparent;
            border-left-color: transparent;
            border-right-color: transparent;
            left: 20px;
        }
    }

    .p-tooltip-text {
        background: $color-palette-primary-200;
        padding: 0;
        min-width: 220px;
        max-width: 220px;
    }
}

.dot-history-timeline-item__overlay-content {
    padding: $spacing-1;
    display: flex;
    flex-direction: column;
    gap: $spacing-0;
}

.dot-history-timeline-item__overlay-title {
    margin: 0;
    color: $color-palette-gray-800;
    font-size: $font-size-sm;
    font-weight: $font-weight-bold;
    word-wrap: break-word;
}

.dot-history-timeline-item__overlay-list {
    padding-left: $spacing-3;
    margin: 0;

    li {
        color: $color-palette-gray-700;
    }
}
