/* TIMELINE */
/* Grid with rigid positions (regardless of text length) */
.timeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 steps */
    position: relative;
    align-items: start;
}

/* Base progress line */
.timeline::before {
    content: "";
    position: absolute;
    top: 26px;              /* position vertically in the centre of the circles */
    left: calc(100% / 10);  /* start in the centre of the first column */
    right: calc(100% / 10); /* end in the centre of the last column */
    height: 3px;
    background: #dee2e6;  /* Grey when inactive */
    z-index: 0;             /* Position behind the circles */
}

/* Active progress line (Width depends on ticket.status) */
.timeline::after {
    content: "";
    position: absolute;
    top: 26px;
    left: calc(100% / 10);
    height: 3px;
    background: #4CAF7A; /* Green when active */
    z-index: 0;
    width: 0%; 
    transition: width 0.4s ease-in-out;
}

/* Progress bar widths */
.timeline.progress-1::after { width: 0%; }
.timeline.progress-2::after { width: 20%; }
.timeline.progress-3::after { width: 40%; }
.timeline.progress-4::after { width: 60%; }
.timeline.progress-5::after { width: 80%; }

/* Div containing the info for each step of the timeline */
.timeline-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 80px;
}

.timeline-step .small {
    max-width: 90px;
    text-align: center;
}

    .timeline-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #dee2e6;
    z-index: auto; /* Position above the progress line */
}

/* Created - Blue */
.timeline-step:nth-child(1) .timeline-circle.active {
    background-color: #0d95fd;
}

/* Advertised - Cyan */
.timeline-step:nth-child(2) .timeline-circle.active {
    background-color: #0dcaf0;
}

/* Assigned - Teal */
.timeline-step:nth-child(3) .timeline-circle.active {
    background-color: #20c997;
}

/* Resolved - Light Green */
.timeline-step:nth-child(4) .timeline-circle.active {
    background-color: #5cb85c;
}

/* Closed - Dark Green */
.timeline-step:nth-child(5) .timeline-circle.active {
    background-color: #198754;
}

/* Clickable timeline steps */
.timeline-step {
    cursor: pointer;
}

.timeline-step:hover {
    opacity: 0.85;
}

/* Modal backdrop */
.timeline-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);

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

    z-index: 1050;
}

/* White popup box */
.timeline-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;

    width: 90%;
    max-width: 500px;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Hidden state */
.d-none {
    display: none !important;
}

.timeline-circle.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(9, 137, 101, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(13,110,253,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13,110,253,0);
    }
}
