/* Timeline Wrapper */
.timeline-page{
    background-color: #ecf0f1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 50px;
    padding-inline: 20px;
}
.timeline-page .container{
    max-width: 800px;
    width: 100%;
    position: relative;
}
.timeline-container{
    padding-top: 50px;
}
.eng-logo{
    display: block;
    width: 240px;
}
.timeline-content-wrap{
    max-width: 500px;
}
.timeline-wrapper {
    max-width: 800px;
    width: 100%;
    border: 1px solid #e0e0e0;
    background-color: #f9fafb;
    box-shadow: 0 0 10px rgba(0,0,0,0.07);
    margin: 20px auto;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
      Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
      position: relative;
}

/* Header */
.timeline-heading{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.timeline-heading h1{
    font-weight: bold;
    font-size: 1.5rem;
}
.timeline-header {
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 20px;
    align-items: center;
    box-shadow: 0px 4px 5px 0px rgba(0, 0, 0, 0.07);
    margin-bottom: 20px;
    border-radius: 12px 12px 0 0;
}
.item-ref{
    display: flex;
    align-items: center;
}
.item-ref strong{
    font-weight: bold;
}
.timeline-header h2 {
    margin: 0;
    font-weight: 700;
    font-size: 1.4rem;
    color: #222;
}
.timeline-header .left{
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.timeline-header .left .timeline-header-ref{
    font-weight: 600;
    color: #0073aa;
}
.timeline-header .right {
    text-align: right;
}

.timeline-header .status {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.timeline-header .current-stage h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #0073aa; /* tealish */
}

.timeline-header .current-stage small {
    color: #222;
    font-size: 1rem;
    font-weight: bold;
}

/* Timeline vertical line */
.timeline {
    position: relative;
    margin: 0 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 12px;
    width: 3px;
    height: 95%;
    background: #ecf0f1;
    border-radius: 2px;
}

/* Timeline item */
.timeline-item {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    outline: none;
    transition: background-color 0.25s ease;
    border-radius: 8px;
    padding-left: 40px;
}

.timeline-item.next-stage .timeline-content{
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.timeline-item-agency .timeline-content{
    border-color: #0b86dd;
}

.timeline-item-client .timeline-content {
    border-color: #F6C28B;
}

/* Optionally style icons differently */
.timeline-item-agency .timeline-icon {
  background-color: #0b86dd;
  border-color: #0b86dd;
}

.timeline-item-client .timeline-icon {
      background-color: #F6C28B;
    border-color: #F6C28B;
}

/* Icon */
.timeline-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    background: #e0e0e0;
    border: 3px solid #b0bec5;
    border-radius: 50%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}
.timeline-item.completed .timeline-icon,
.timeline-item.active .timeline-icon {
    background-color: #30c869;
    border-color: #30c869;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 16px;
}
.timeline-item.completed .timeline-icon::before,
.timeline-item.active .timeline-icon::before {
    content: '';
    background-image: url('https://dev.eng.co.za/engmedia/wp-content/uploads/2025/07/checkmark-svgrepo-com.png');
    width: 18px;
    height: 18px;
    display: block;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Content */
.timeline-item.active .timeline-content{
    background-color: #fff;
}
.timeline-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px 15px;
    position: relative;
    background-color: #f9fafc;
}
.timeline-content .timeline-date{
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: -0.05em;
    color: #111;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.timeline-content .timeline-date span{
     font-size: 0.85rem;
    color: #888;
    font-weight: 400;
}

.timeline-content small {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 2px;
}

.timeline-content h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Info icon */
.info-icon {
    display: block;
    line-height: 0;
    font-style: normal;
    font-weight: bold;
    color: #5a5a5a;
    cursor: help;
    user-select: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
}
.info-icon svg{
    width: 24px;
    height: 24px;
    line-height: 0;
}

/* Expanded extra description */
.timeline-extra {
    margin-top: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #555;
    display: none;
}

/* Animations */
.timeline-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeSlideUp 0.4s forwards;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}
.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}
.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}
.timeline-item:nth-child(4) {
    animation-delay: 0.4s;
}
.timeline-item:nth-child(5) {
    animation-delay: 0.5s;
}
.timeline-item:nth-child(6) {
    animation-delay: 0.6s;
}
.timeline-item:nth-child(7) {
    animation-delay: 0.7s;
}
.timeline-item:nth-child(8) {
    animation-delay: 0.8s;
}

@keyframes fadeSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .timeline-wrapper {
        padding: 15px;
        max-width: 100%;
    }
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-header .right {
        text-align: left;
        margin-top: 10px;
    }
    .timeline-item {
        padding-left: 35px;
    }
    .timeline-icon {
        left: -5px;
    }
}


.loading-spinner {
    display: flex;
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top-color: #4caf50; /* green accent */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px; 
  height: 1px; 
  padding: 0; 
  margin: -1px; 
  overflow: hidden; 
  clip: rect(0,0,0,0); 
  border: 0;
}

.feedback-btn {
    margin-top: 10px;
    padding: 8px 14px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.feedback-btn:hover {
    background-color: #005f8d;
}

.timeline-legend{
    position: absolute;
    top: 20px;
    right: -370px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
    width: 100%;
    height: 100%;
}
.timeline-legend-container{
    position: sticky;
    display: flex;
    flex-direction: column;
    gap: 10px;
    top: 40px;
}
.timeline-legend-container svg{
    width: 18px;
    height: 18px;
    line-height: 0;
}
.timeline-legend-container span{
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.eng-legend,
.client-legend,
.completed-legend {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.completed-legend::before,
.eng-legend::before,
.client-legend:before{
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background-color: #666;
    border-radius: 50%;
}

.eng-legend::before{
    background-color: #0b86dd;
}
.client-legend:before{
    background-color: #F6C28B;
}

.completed-legend::before{
    background-color: #30c869;
    content: '';
    background-image: url(https://dev.eng.co.za/engmedia/wp-content/uploads/2025/07/checkmark-svgrepo-com.png);
    width: 18px;
    height: 18px;
    display: block;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
}

.client-legend div {
    flex: 1;
}

.timeline-item-note{
    cursor: default;
    outline: none;
}
.timeline-item-note .note-icon{
    background-color: #0073aa;
    border-color: #0073aa;
}
.timeline-item-note .note-icon::after{
    content: 'i';
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    font-style: italic;
}
.timeline-item-note .note-content{
    background-color: #eef6fb;
    border: 1px dashed #0073aa;
    padding: 12px 15px;
    cursor: default;
}
.timeline-item-note .note-content p{
    margin: 0;
    color: #1b5e7a;
    font-size: 0.95rem;
    font-weight: 600;
}        