/**
 * Timeline Widget Styles
 */

.timeline-widget {
    width: 100%;
    padding: 40px 20px;
    position: relative;
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* Timeline Line */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    /* Background color controlled by Elementor */
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0%;
    /* Background color controlled by Elementor */
    transition: height 0.3s ease;
    z-index: 2;
}

/* Timeline Items */
.timeline-items {
    position: relative;
    z-index: 3;
}

.timeline-item {
    position: relative;
    margin-bottom: 80px;
    display: flex;
    align-items: center;
    min-height: 100px;
    /* All items visible from start - only icon color changes on scroll */
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Active class is used by JavaScript to trigger icon color change */
/* Icon color change is handled by Elementor selectors in widget settings */

/* Left Side Items */
.timeline-item-left {
    flex-direction: row;
}

.timeline-item-left .timeline-year {
    position: absolute;
    right: calc(50% + 40px);
    text-align: right;
}

.timeline-item-left .timeline-content {
    position: absolute;
    left: calc(50% + 40px);
    max-width: calc(50% - 60px);
}

/* Right Side Items */
.timeline-item-right {
    flex-direction: row-reverse;
}

.timeline-item-right .timeline-year {
    position: absolute;
    left: calc(50% + 40px);
    text-align: left;
}

.timeline-item-right .timeline-content {
    position: absolute;
    right: calc(50% + 40px);
    max-width: calc(50% - 60px);
}

/* Timeline Year */
.timeline-year {
    font-size: 32px;
    font-weight: bold;
    color: #FF8C00;
    margin: 0;
    white-space: nowrap;
}

/* Timeline Icon */
.timeline-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: all 0.3s ease;
    /* Default fallback - will be overridden by Elementor settings */
    background-color: #e0e0e0;
}

/* Active state transform - color will be set by Elementor */
.timeline-item.active .timeline-icon {
    transform: translateX(-50%) scale(1.1);
    /* Active color set by Elementor: background-color will be overridden */
}

.timeline-icon i,
.timeline-icon svg {
    color: #ffffff;
    fill: #ffffff;
    font-size: 24px;
}

/* Timeline Content */
.timeline-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Triangle Arrow for Left Items (pointing right to timeline) */
.timeline-item-left .timeline-content::before {
    content: '';
    position: absolute;
    right: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #ffffff;
    z-index: 1;
    display: block;
}

/* Triangle Arrow for Right Items (pointing left to timeline) */
.timeline-item-right .timeline-content::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 10px 10px 0;
    border-color: transparent #ffffff transparent transparent;
    z-index: 1;
    display: block;
}

/* Hide arrows when disabled */
.elementor-widget-timeline_widget:not([data-settings*='"show_arrow":"yes"']) .timeline-content::before,
.elementor-widget-timeline_widget:not([data-settings*='"show_arrow":"yes"']) .timeline-content::after {
    display: none !important;
}

.timeline-content h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333333;
    font-weight: 600;
    line-height: 1.4;
}

.timeline-content p {
    margin: 0;
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 992px) {
    .timeline-line {
        left: 30px;
    }

    .timeline-item {
        min-height: 80px;
    }

    .timeline-item-left,
    .timeline-item-right {
        flex-direction: row;
        padding-left: 80px;
    }

    .timeline-item-left .timeline-year,
    .timeline-item-right .timeline-year {
        position: absolute;
        left: 70px;
        top: 0;
        right: auto;
        text-align: left;
        font-size: 28px;
    }

    .timeline-item-left .timeline-content,
    .timeline-item-right .timeline-content {
        position: relative;
        left: auto;
        right: auto;
        max-width: 100%;
        margin-left: 0;
        margin-top: 40px;
    }

    /* Hide desktop arrows in responsive mode */
    .timeline-item-left .timeline-content::before,
    .timeline-item-right .timeline-content::before {
        display: none;
    }

    /* Add left-pointing arrow for responsive mode */
    .timeline-item-left .timeline-content::after,
    .timeline-item-right .timeline-content::after {
        content: '';
        position: absolute;
        left: -10px;
        top: 20px;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 10px 10px 10px 0;
        border-color: transparent #ffffff transparent transparent;
        z-index: 1;
    }

    .timeline-icon {
        left: 30px;
        top: 0;
    }

    .timeline-item.active .timeline-icon {
        transform: translateX(-50%) scale(1.1);
    }
}

@media (max-width: 768px) {
    .timeline-widget {
        padding: 30px 15px;
    }

    .timeline-line {
        left: 20px;
    }

    .timeline-item {
        min-height: 70px;
        margin-bottom: 60px;
    }

    .timeline-icon {
        left: 20px;
        top: 0;
        width: 40px;
        height: 40px;
    }

    .timeline-icon i,
    .timeline-icon svg {
        font-size: 18px;
    }

    .timeline-item-left,
    .timeline-item-right {
        padding-left: 60px;
    }

    .timeline-item-left .timeline-year,
    .timeline-item-right .timeline-year {
        left: 55px;
        top: 0;
        font-size: 24px;
    }

    .timeline-item-left .timeline-content,
    .timeline-item-right .timeline-content {
        margin-top: 35px;
    }

    .timeline-content h4 {
        font-size: 15px;
    }

    .timeline-content p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .timeline-item {
        min-height: 60px;
        margin-bottom: 50px;
    }

    .timeline-year {
        font-size: 20px;
    }

    .timeline-item-left .timeline-content,
    .timeline-item-right .timeline-content {
        margin-top: 30px;
    }

    .timeline-content {
        padding: 15px;
    }

    .timeline-content h4 {
        font-size: 14px;
    }

    .timeline-content p {
        font-size: 12px;
    }
}
