@use '~flux/components/css/mixin';

.timeline {
    position: relative;
    display: flex;
    flex-flow: column;
    gap: 15px;
}

.timelineLine {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.timelineItem {
    position: relative;
    display: grid;
    gap: 21px;
    grid-template-columns: 42px minmax(0, 1fr);
}

.timelineItemIcon,
.timelineItemPhoto {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.timelineItemIcon {
    margin: 3px;
    height: 36px;
    width: 36px;
}

.timelineItemDot {
    grid-column: 1;
    justify-self: center;
    margin-top: 15px;
    height: 12px;
    width: 12px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

.timelineItemPhoto {
    height: 42px;
    width: 42px;
}

.timelineItemPhotoIcon {
    position: absolute;
    display: flex;
    right: -9px;
    bottom: -9px;
    height: 30px;
    width: 30px;
    align-items: center;
    justify-content: center;
    background: var(--gray-25);
    border-radius: var(--radius-full);
}

.timelineItemPhotoImage {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
}

.timelineItemBody {
    position: relative;
    display: flex;
    padding-top: 9px;
    padding-bottom: 9px;
    align-items: flex-start;
    align-self: center;
    flex-flow: column;
    gap: 15px;
    grid-column: 2;
}

.timelineItemHeader {
    display: flex;
    margin-bottom: -9px;
    flex-flow: column;

    :is(strong) {
        color: var(--foreground-prominent);
    }

    :is(span) {
        @include mixin.text(small);

        color: var(--foreground-secondary);
    }
}

.timelineItemGray {
    composes: timelineItem;

    .timelineItemIcon,
    .timelineItemPhotoIcon {
        color: var(--foreground-prominent);
    }

    .timelineItemIcon {
        background: var(--gray-100);
    }

    .timelineItemDot {
        background: var(--gray-400);
    }
}

.timelineItemPrimary {
    composes: timelineItem;

    .timelineItemIcon,
    .timelineItemPhotoIcon {
        color: var(--primary-600);
    }

    .timelineItemIcon {
        background: var(--primary-100);
    }

    .timelineItemDot {
        background: var(--primary-600);
    }
}

.timelineItemDanger {
    composes: timelineItem;

    .timelineItemIcon,
    .timelineItemPhotoIcon {
        color: var(--danger-600);
    }

    .timelineItemIcon {
        background: var(--danger-100);
    }

    .timelineItemDot {
        background: var(--danger-600);
    }
}

.timelineItemInfo {
    composes: timelineItem;

    .timelineItemIcon,
    .timelineItemPhotoIcon {
        color: var(--info-600);
    }

    .timelineItemIcon {
        background: var(--info-100);
    }

    .timelineItemDot {
        background: var(--info-600);
    }
}

.timelineItemSuccess {
    composes: timelineItem;

    .timelineItemIcon,
    .timelineItemPhotoIcon {
        color: var(--success-600);
    }

    .timelineItemIcon {
        background: var(--success-100);
    }

    .timelineItemDot {
        background: var(--success-600);
    }
}

.timelineItemWarning {
    composes: timelineItem;

    .timelineItemIcon,
    .timelineItemPhotoIcon {
        color: var(--warning-600);
    }

    .timelineItemIcon {
        background: var(--warning-100);
    }

    .timelineItemDot {
        background: var(--warning-600);
    }
}
