/**
 * Timeline Widget Styles - Updated to match reference design
 */

.timeline-widget-wrapper {
    position: relative;
    width: 100%;
    padding: 0;
    background: #fff;
}

/* Year Navigation Styles */
.year-navigation {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    z-index: 2;
    transition: all 0.3s ease;
    gap: 28px;
}

/* Line under the year navigation */
.year-navigation::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.timeline-widget-wrapper.sticky-nav .year-navigation {
    position: sticky;
    top: 0; /* Default, overridden by Elementor control */
    background: #fff;
}

.year-nav-item {
    position: relative;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: #b0b0b0;
    transition: all 0.3s ease;
    white-space: nowrap;
    padding: 8px 0;
    z-index: 2;
    letter-spacing: 0.5px;
}

.year-nav-item:hover {
    color: #555;
}

.year-nav-item.active {
    font-weight: 600;
    color: #222;
}

/* Active year underline */
.year-nav-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: #1D1C1B;
}

/* Timeline Container */
.timeline-container {
    position: relative;
    padding: 80px 0 100px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Timeline Line - Starts from first item to last */
.timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 287px;
    bottom: 285px;
    width: 1px;
    background-color: #d0d0d0;
    z-index: 0;
}

/* Timeline Items */
.timeline-item {
    position: relative;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Timeline Year Circle - The main circle with year inside */
.timeline-dot-wrapper {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Main year circle with year text inside */
.timeline-dot {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* Year label positioned inside the circle */
.timeline-year-label {
    position: absolute;
    font-size: 13px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.5px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    text-align: center;
}

/* Active state - black circle */
.timeline-item.active .timeline-dot {
    background-color: #222;
}

.timeline-item.active .timeline-year-label {
    color: #fff;
}

/* Non-active items have reduced opacity */
.timeline-item:not(.active) {
    opacity: 0.6;
}

.timeline-item:not(.active):hover {
    opacity: 0.85;
}

/* Active items full opacity */
.timeline-item.active {
    opacity: 1;
}

/* Override the visible class to respect active state */
.timeline-item.visible:not(.active) {
    opacity: 0.6;
    transform: translateY(0);
}

.timeline-item.visible.active {
    opacity: 1;
    transform: translateY(0);
}

/* Horizontal connector line from year circle */
.timeline-item::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 110px;
    height: 1px;
    background-color: #d0d0d0;
    z-index: 5;
}

/* Left position - line goes left from center */
.timeline-item.position-left::before {
    right: calc(50% + 28px);
}

/* Right position - line goes right from center */
.timeline-item.position-right::before {
    left: calc(50% + 17px);
}

/* Remove the small dot pseudo-element - not needed */
.timeline-item::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    border-radius: 100%;
    background-color: #c2c2c2;
    z-index: 5;
    transform: translate(-50%, -50%);
}

.timeline-item.active::after {
     animation: dotPulse 2s ease-in-out infinite;
     background-color: #333333;
}

.timeline-item.position-left::after {
    right: calc(50% + 118px);
}

.timeline-item.position-right::after {
    left: calc(50% + 139px);
}

/* Timeline Content */
.timeline-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: auto;
}

/* Left position - content on left side */
.timeline-item.position-left .timeline-content {
    width: 40%;
    max-width: 400px;
    margin-right: auto;
    padding-left: 60px;
}

/* Right position - content on right side */
.timeline-item.position-right .timeline-content {
    width: 40%;
    max-width: 400px;
    margin-left: auto;
    padding-right: 60px;
}

.timeline-image {
    width: 100%;
}

.timeline-title {
    margin-bottom: 16px;
}

.timeline-text {
    width: 100%;
    padding: 10px 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .timeline-container {
        max-width: 1000px;
    }
    
    .timeline-content {
        padding: 0 40px;
    }
    
    .timeline-item.position-left .timeline-image,
    .timeline-item.position-right .timeline-image {
        flex: 0 0 40%;
        max-width: 40%;
    }
    
    .timeline-item.position-left .timeline-text,
    .timeline-item.position-right .timeline-text {
        flex: 0 0 40%;
        max-width: 40%;
    }
    
    .timeline-item.position-left::before {
        width: calc(50% - 28px - 40px);
    }
    
    .timeline-item.position-right::before {
        width: calc(50% - 28px - 40px);
    }
    
    .timeline-item.position-left::after {
        left: 40px;
    }
    
    .timeline-item.position-right::after {
        right: 40px;
    }
}

@media (max-width: 992px) {
    .year-navigation {
        gap: 25px;
    }
    
    .timeline-content {
        padding: 0 30px;
    }
    
    .timeline-title {
        font-size: 22px;
    }
    
    .timeline-dot {
        width: 48px;
        height: 48px;
    }
    
    .timeline-year-label {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .year-navigation {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 25px 15px 20px;
        gap: 20px;
    }
    
    .year-nav-item {
        font-size: 12px;
    }
    
    .timeline-line {
        left: 40px;
        top: 80px;
    }
    
    .timeline-dot-wrapper {
        left: 40px;
        transform: translateX(-50%);
        top: 20px;
    }
    
    .timeline-dot {
        width: 44px;
        height: 44px;
    }
    
    /* Hide horizontal connectors on mobile */
    .timeline-item::before,
    .timeline-item::after {
        display: none;
    }
    
    .timeline-content {
        flex-direction: column !important;
        padding-left: 80px;
        padding-right: 20px;
        gap: 20px;
        min-height: auto;
    }
    
    .timeline-item.position-left .timeline-image,
    .timeline-item.position-right .timeline-image {
        flex: 1 1 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .timeline-item.position-left .timeline-text,
    .timeline-item.position-right .timeline-text {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .timeline-item {
        margin-bottom: 80px;
    }
    
    .timeline-title {
        font-size: 20px;
    }
    
    .timeline-description {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .timeline-line {
        left: 25px;
    }
    
    .timeline-dot-wrapper {
        left: 25px;
    }
    
    .timeline-dot {
        width: 38px;
        height: 38px;
    }
    
    .timeline-year-label {
        font-size: 11px;
    }
    
    .timeline-content {
        padding-left: 60px;
        padding-right: 15px;
    }
    
    .year-nav-item {
        font-size: 11px;
    }
    
    .year-navigation {
        gap: 15px;
    }
}

/* Loading State */
.timeline-widget-wrapper.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dotPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 34, 34, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(34, 34, 34, 0);
    }
}

/*.timeline-item.animate-in {*/
/*    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;*/
/*}*/

.timeline-dot.pulse {
    animation: dotPulse 2s ease-in-out infinite;
}

/* Custom Scrollbar for Year Navigation */
.year-navigation::-webkit-scrollbar {
    height: 2px;
}

.year-navigation::-webkit-scrollbar-track {
    background: #f9f9f9;
}

.year-navigation::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 1px;
}

.year-navigation::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Hover states */
.timeline-item:hover .timeline-dot {
    background-color: #444;
}

.timeline-item:hover .timeline-year-label {
    color: #fff;
}

.timeline-item.active:hover .timeline-dot {
    background-color: #000;
}

/* Focus states for accessibility */
.year-nav-item:focus,
.timeline-dot:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 3px;
}

/* Print styles */
@media print {
    .timeline-widget-wrapper.sticky-nav .year-navigation {
        position: relative;
        box-shadow: none;
    }
    
    .timeline-item {
        opacity: 1 !important;
        transform: none !important;
        page-break-inside: avoid;
    }
    
    .timeline-item::before,
    .timeline-item::after {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}