/**
 * TimelineSelector CSS Styles
 * 
 * USAGE:
 * ------
 * Include this file in your HTML:
 * <link rel="stylesheet" href="css/timelineSelector.css">
 * 
 * OR copy these styles into your existing CSS file
 * 
 * CUSTOMIZATION:
 * --------------
 * Modify CSS variables to match your design:
 * --timeline-track-color
 * --timeline-progress-color
 * --timeline-node-color
 * --timeline-node-active-color
 * --timeline-label-color
 */

.timeline-selector {
    width: 100%;
    padding: 20px 0;
    position: relative;
}

.timeline-track {
    position: relative;
    height: 60px;
    margin: 0 30px;
    /* Space for edge labels */
}

/* Base track line */
.timeline-track::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
}

/* Progress line (colored portion) */
.timeline-progress {
    position: absolute;
    top: 20px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #67959d, #e07e38);
    border-radius: 1px;
    transition: width 0.3s ease;
    z-index: 1;
}

/* Timeline nodes (dots) */
.timeline-node {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-node:hover .timeline-dot {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(224, 126, 56, 0.2);
}

/* The dot itself */
.timeline-dot {
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: relative;
    top: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Active node */
.timeline-node.active .timeline-dot {
    background: #e07e38;
    border-color: #f0b086;
    transform: scale(1.4);
    box-shadow: 0 0 0 4px rgba(224, 126, 56, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Date labels */
.timeline-label {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    transition: all 0.3s ease;
    pointer-events: none;
}

.timeline-node.active .timeline-label {
    color: #f0b086;
    font-weight: 600;
    font-size: 0.8rem;
}

.timeline-node:hover .timeline-label {
    color: #d1d5db;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline-track {
        margin: 0 20px;
    }

    .timeline-label {
        font-size: 0.7rem;
        top: 38px;
    }

    .timeline-node.active .timeline-label {
        font-size: 0.75rem;
    }

    .timeline-dot {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .timeline-track {
        margin: 0 10px;
        height: 150px; /* Increased to accommodate vertical labels */
    }

    .timeline-label {
        font-size: 0.65rem;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        top: 35px;
        transform: translateX(-50%) rotate(180deg);
        max-height: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .timeline-dot {
        width: 12px;
        height: 12px;
    }
}

/* Animation for initial load */
@keyframes fadeInNode {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.timeline-node {
    animation: fadeInNode 0.4s ease forwards;
}

.timeline-node:nth-child(1) {
    animation-delay: 0.1s;
}

.timeline-node:nth-child(2) {
    animation-delay: 0.2s;
}

.timeline-node:nth-child(3) {
    animation-delay: 0.3s;
}

.timeline-node:nth-child(4) {
    animation-delay: 0.4s;
}

.timeline-node:nth-child(5) {
    animation-delay: 0.5s;
}

.timeline-node:nth-child(n+6) {
    animation-delay: 0.6s;
}