/* Horizontal Timeline Styles */
.horizontal-timeline-container {
    max-width: 90%;
    margin: 0px auto;
    /* padding: 40px 20px; */
    position: relative;
}

.horizontal-timeline-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 50px;
    color: #333;
}

.horizontal-timeline {
    position: relative;
    padding: 40px 0;
    width: 90%;
    place-self: center;
    /* overflow-x: auto; */
    overflow-y: visible;
}

.horizontal-timeline-line {
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 4px;
    background: linear-gradient(to right, #ff8b4e, #000000);
    border-radius: 2px;
    transform: translateY(-50%);
    z-index: 1;
}

.horizontal-timeline-markers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
    padding: 0 5%;
    min-width: 800px;
}

.horizontal-timeline-marker {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.horizontal-timeline-marker:hover {
    transform: scale(1.1);
}

.horizontal-timeline-dot {
    width: 20px;
    height: 20px;
    background: #ff8b4e;
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #ff8b4e, 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
}

.horizontal-timeline-marker:hover .horizontal-timeline-dot {
    background: #000;
    box-shadow: 0 0 0 3px #000, 0 6px 15px rgba(0, 0, 0, 0.3);
    transform: scale(1.2);
}

.horizontal-timeline-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    z-index: 4;
}

.horizontal-timeline-date {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff8b4e;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.horizontal-timeline-title-marker {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff8b4e;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.horizontal-timeline-marker .horizontal-timeline-title {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    opacity: 1;
    text-align: center;
}

.horizontal-timeline-tooltip {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid #ff8b4e;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    width: 250px;
    pointer-events: none;
}

.horizontal-timeline-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ff8b4e;
}

.horizontal-timeline-marker:hover .horizontal-timeline-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -90px;
}

.horizontal-timeline-tooltip-content {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
}

.horizontal-timeline-tooltip-title {
    font-weight: bold;
    color: #ff8b4e;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Responsive Design - Vertical layout for mobile */
@media (max-width: 768px) {
    .horizontal-timeline-container {
        padding: 20px 10px;
        margin: 40px auto;
    }
    
    .horizontal-timeline-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    .horizontal-timeline {
        padding: 30px 0 30px 30px;
        overflow-x: visible;
    }
    
    /* Vertical line instead of horizontal */
    .horizontal-timeline-line {
        top: 0;
        bottom: 0;
        left: 15px;
        right: auto;
        width: 3px;
        height: auto;
        background: linear-gradient(to bottom, #ff8b4e, #000000);
        transform: none;
    }
    
    /* Vertical stack of markers */
    .horizontal-timeline-markers {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 0;
        min-width: auto;
        gap: 40px;
    }
    
    .horizontal-timeline-marker {
        position: relative;
        width: 100%;
        margin-bottom: 0;
    }
    
    .horizontal-timeline-dot {
        position: absolute;
        left: -23px;
        top: 8px;
        width: 16px;
        height: 16px;
        border-width: 3px;
    }
    
    .horizontal-timeline-number {
        font-size: 9px;
    }
    
    /* Date and title positioning for vertical layout */
    .horizontal-timeline-date {
        position: static;
        transform: none;
        font-size: 0.8rem;
        font-weight: 600;
        color: #ff8b4e;
        margin-bottom: 5px;
        text-align: left;
        white-space: normal;
    }

    .horizontal-timeline-title-marker {
        position: static;
        transform: none;
        font-size: 0.9rem;
        font-weight: 600;
        color: #ff8b4e;
        margin-bottom: 8px;
        text-align: left;
        white-space: normal;
    }
    
    .horizontal-timeline-marker .horizontal-timeline-title {
        position: static;
        transform: none;
        font-size: 0.9rem;
        font-weight: 600;
        color: #333;
        margin-bottom: 8px;
        text-align: left;
        white-space: normal;
    }
    
    /* Tooltip adjustments for vertical layout */
    .horizontal-timeline-tooltip {
        position: static;
        transform: none;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        padding: 12px;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        width: auto;
        margin-top: 10px;
        pointer-events: auto;
    }
    
    .horizontal-timeline-tooltip::before {
        display: none;
    }
    
    .horizontal-timeline-marker:hover .horizontal-timeline-tooltip {
        bottom: auto;
    }
    
    .horizontal-timeline-tooltip-content {
        font-size: 0.85rem;
        text-align: left;
    }
    
    .horizontal-timeline-tooltip-title {
        display: none; /* Hide since title is now shown above */
    }
    
    /* Remove hover effects for mobile */
    .horizontal-timeline-marker:hover {
        transform: none;
    }
    
    .horizontal-timeline-marker:hover .horizontal-timeline-dot {
        background: #ff8b4e;
        box-shadow: 0 0 0 3px #ff8b4e, 0 4px 10px rgba(0, 0, 0, 0.2);
        transform: none;
    }
}

@media (max-width: 480px) {
    .horizontal-timeline-container {
        padding: 15px 5px;
    }
    
    .horizontal-timeline {
        padding: 20px 0 20px 25px;
    }
    
    .horizontal-timeline-tooltip-content {
        font-size: 0.8rem;
    }
}

/* Dark mode support */
body.dark-mode .horizontal-timeline-container .horizontal-timeline-title {
    color: #e0e0e0;
}

body.dark-mode .horizontal-timeline-marker .horizontal-timeline-title {
    color: #ccc;
}

body.dark-mode .horizontal-timeline-tooltip {
    background: #2a2a2a;
    border-color: #ff8b4e;
    color: #e0e0e0;
}

body.dark-mode .horizontal-timeline-tooltip-content {
    color: #ccc;
}

body.dark-mode .horizontal-timeline-line {
    background: linear-gradient(to right, #ff8b4e, #444);
}

/* Dark mode support for mobile vertical layout */
@media (max-width: 768px) {
    body.dark-mode .horizontal-timeline-line {
        background: linear-gradient(to bottom, #ff8b4e, #444);
    }
    
    body.dark-mode .horizontal-timeline-tooltip {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    body.dark-mode .horizontal-timeline-tooltip-content {
        color: #ccc;
    }
}

/* Animation for markers */
.horizontal-timeline-marker {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.horizontal-timeline-marker:nth-child(1) { animation-delay: 0.1s; }
.horizontal-timeline-marker:nth-child(2) { animation-delay: 0.2s; }
.horizontal-timeline-marker:nth-child(3) { animation-delay: 0.3s; }
.horizontal-timeline-marker:nth-child(4) { animation-delay: 0.4s; }
.horizontal-timeline-marker:nth-child(5) { animation-delay: 0.5s; }
.horizontal-timeline-marker:nth-child(6) { animation-delay: 0.6s; }
.horizontal-timeline-marker:nth-child(7) { animation-delay: 0.7s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
    from {
        opacity: 0;
        transform: translateY(20px);
    }
}
