/* Timeline Widget Styles - Matching Mockup */
.timeline-wrapper {
    width: 100%;
    overflow-x: auto;
    position: relative;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.timeline-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* Fade gradients for scroll indication */
.timeline-fade-overlay {
    width: 60px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-fade-left {
    background: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.1), transparent);
}

.timeline-fade-right {
    background: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.1), transparent);
}

.timeline-fade-overlay.show {
    opacity: 1;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-title {
    font-family: DM Sans, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #21282d;
    margin: 0;
    line-height: 1.2;
}

.timeline-controls {
    display: flex;
    gap: 8px;
}

/* Match carousel arrow styling exactly */
.timeline-arrow {
    position: relative;
    left: auto;
    right: auto;
    transform: none;
    border-radius: 0;
    background-color: #fff;
    border: 2px solid #000000;
    color: #000;
    opacity: 1;
    padding: 24px;
    transition: .2s all linear;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-arrow:hover {
    background-color: #000;
    color: #fff;
}

.timeline-arrow:active {
    transition: none;
    background-color: #5cff96;
    color: #000;
}

.timeline-arrow i {
    font-size: 1.125rem;
}

.timeline-container {
    position: relative;
    width: 100%;
    padding: 20px 0;
    opacity: 0; /* Hide until JS positioning is complete */
    transition: opacity 0.3s ease-in;
}

.timeline-container.positioned {
    opacity: 1; /* Show after positioning */
}

.timeline-line {
    position: absolute;
    top: 40%;
    left: 0;
    right: 0;
    height: 2px;
    background: #000000;
    transform: translateY(-50%);
    z-index: 2;
    width: 100%;
}

.timeline-items-wrapper {
    position: relative;
    min-height: 650px;
}

.timeline-top-items,
.timeline-bottom-items {
    position: absolute;
    display: flex;
    gap: 30px; /* Control spacing between cards within each row */
}

.timeline-top-items {
    top: 0;
}

.timeline-bottom-items {
    bottom: 0;
    left: 120px; /* 100px offset from top cards */
}

.timeline-item {
    position: relative;
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-item--top {
    align-self: flex-start; /* Position at top of container */
}

.timeline-item--bottom {
    align-self: flex-end; /* Position at bottom of container */  
}

/* Match card styling exactly */
.timeline-card {
    background-color: #E6EAE9;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100%;
    min-height: 200px;
    width: 100%;
    z-index: 4; /* Ensure cards are on top of connectors */
}

.timeline-card-header {
    background-color: #026982;
    height: 8px;
    width: 100%;
}

.timeline-card-content {
    padding: 10px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.timeline-date {
    font-family: DM Sans, sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.timeline-item-title {
    font-family: DM Sans, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #21282d;
    line-height: 1.3;
    margin: 0 0 12px 0;
}

.timeline-description {
    font-family: DM Sans, sans-serif;
    font-size: 16px;
    line-height: 1.3;
    color: #495057;
    margin-bottom: 16px;
}

.timeline-description .timeline-description-truncated {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-expand-btn {
    font-family: DM Sans, sans-serif;
    font-size: 12px;
    line-height: 145%;
    font-weight: 700;
    color: #21282d;
    font-size: .75rem;
    font-weight: 500;
    font-size: 12px !important;
    text-transform: uppercase;
    position: relative;
    padding-left: 15px;
    padding-top: 5px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.timeline-expand-btn:before, 
.timeline-expand-btn:after {
    content: "";
    width: 8px;
    height: 2px;
    position: absolute;
    top: 12px;
    left: 0;
    background-color: #000;
    transition: .2s all ease-in-out;
}

.timeline-expand-btn:after {
    transform: rotate(90deg);
}

.timeline-expand-btn[open]:before {
    transform: rotate(45deg);
}

.timeline-expand-btn[open]:after {
    transform: rotate(135deg);
}

/* Timeline overlay backdrop */
.timeline-overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    cursor: pointer;
}

/* Timeline overlay card */
.timeline-card-overlay {
    position: fixed;
    background-color: #E6EAE9; /* Solid background instead of transparent */
    border: 2px solid #026982;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    display: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.timeline-card-overlay.show {
    opacity: 1;
    transform: scale(1);
}

.timeline-card-overlay.hide {
    opacity: 0;
    transform: scale(0.95);
}

.timeline-card-overlay .timeline-card-header {
    background-color: #026982;
    height: 8px;
    width: 100%;
}

.timeline-card-overlay .timeline-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.timeline-card-overlay .timeline-description {
    margin-bottom: 16px;
}

.timeline-overlay-x-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    color: #21282d;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    z-index: 11;
}

.timeline-overlay-x-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Dynamic styles for dots and connectors */
.timeline-dot {
    position: absolute;
    width: 11px;
    height: 11px;
    background: #5cff96;
    border: 2px solid #000000;
    border-radius: 50%;
    z-index: 5;
    transform: translate(-50%, -50%);
}

.timeline-connector {
    position: absolute;
    background: #000000;
    width: 2px;
    z-index: 1;
    transform: translateX(-50%);
}

/* Pagination */
.timeline-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.timeline-page-info {
    background: #6c757d;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: DM Sans, sans-serif;
    font-size: 14px;
    font-weight: 500;
}