/* ============================================
   Milestones Timeline Styles
   ============================================ */

/* ============================================
   Three.js Particle Background
   ============================================ */
.milestone-hero {
    position: relative;
    overflow: hidden;
}

#particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#particles-container canvas {
    display: block;
}

.milestone-hero-content {
    position: relative;
    z-index: 1;
}

/* Timeline Container */
.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Year Section */
.timeline-year-section {
    position: relative;
    margin-bottom: 60px;
}

.timeline-year-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--base-color, #0d6efd);
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.timeline-year-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--base-color, #0d6efd), #6c63ff);
    border-radius: 2px;
}

/* Timeline Line */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--base-color, #0d6efd) 0%, #6c63ff 100%);
    border-radius: 2px;
}

/* Timeline Item */
.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
    padding-right: 60px;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
    padding-left: 60px;
}

/* Timeline Dot */
.timeline-item::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 4px solid var(--base-color, #0d6efd);
    border-radius: 50%;
    top: 30px;
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-item:nth-child(odd)::before {
    right: -10px;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

.timeline-item:hover::before {
    background: var(--base-color, #0d6efd);
    transform: scale(1.3);
    box-shadow: 0 0 20px rgba(13, 110, 253, 0.5);
}

/* Timeline Content Card */
.timeline-content {
    background: #fff;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

/* Arrow for Timeline Content */
.timeline-item:nth-child(odd) .timeline-content::after {
    content: '';
    position: absolute;
    top: 25px;
    right: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: transparent transparent transparent #fff;
}

.timeline-item:nth-child(even) .timeline-content::after {
    content: '';
    position: absolute;
    top: 25px;
    left: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}

/* Month Badge */
.timeline-month {
    display: inline-block;
    background: linear-gradient(135deg, var(--base-color, #0d6efd), #6c63ff);
    color: #fff;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

/* Timeline Text */
.timeline-text {
    color: #333;
    font-size: 1rem;
    line-height: 1.8;
    margin: 0;
    text-align: left;
}

/* Timeline Icon Animation */
.timeline-icon {
    position: absolute;
    top: 25px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--base-color, #0d6efd), #6c63ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 5px 20px rgba(13, 110, 253, 0.3);
    z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-icon {
    right: -25px;
}

.timeline-item:nth-child(even) .timeline-icon {
    left: -25px;
}

/* Responsive Design */
@media (max-width: 991px) {
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        text-align: left !important;
        padding-left: 80px !important;
        padding-right: 20px !important;
    }

    .timeline-item::before {
        left: 21px !important;
        right: auto !important;
    }

    .timeline-content::after {
        left: -10px !important;
        right: auto !important;
        border-color: transparent #fff transparent transparent !important;
    }

    .timeline-icon {
        left: 5px !important;
        right: auto !important;
    }
}

@media (max-width: 575px) {
    .timeline-year-title {
        font-size: 1.8rem;
    }

    .timeline-content {
        padding: 20px;
    }

    .timeline-month {
        font-size: 0.9rem;
        padding: 6px 15px;
    }

    .timeline-text {
        font-size: 0.95rem;
    }
}

/* Animation Keyframes */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

.timeline-item:hover::before {
    animation: pulse 1.5s infinite;
}

/* Scroll Progress Indicator */
.timeline-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--base-color, #0d6efd), #6c63ff);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Year Navigation Dots */
.timeline-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timeline-nav-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.timeline-nav-dot:hover,
.timeline-nav-dot.active {
    background: var(--base-color, #0d6efd);
    transform: scale(1.3);
}

.timeline-nav-dot::before {
    content: attr(data-year);
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.timeline-nav-dot:hover::before {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 991px) {
    .timeline-nav {
        display: none;
    }
}

/* ============================================
   Year Range Filter Navigation (Mobile)
   ============================================ */
.year-range-nav {
    display: none;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin: 20px auto 30px;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.year-range-nav-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 500;
}

.year-range-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.year-range-btn {
    padding: 10px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: #fff;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.year-range-btn:hover {
    border-color: var(--base-color, #0d6efd);
    color: var(--base-color, #0d6efd);
}

.year-range-btn.active {
    background: linear-gradient(135deg, var(--base-color, #0d6efd), #6c63ff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

/* Show on mobile devices */
@media (max-width: 991px) {
    .year-range-nav {
        display: block;
    }
}

@media (max-width: 575px) {
    .year-range-nav {
        margin: 15px 10px 25px;
        padding: 12px;
    }

    .year-range-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

/* Timeline section visibility for filter */
.timeline-year-section.hidden-by-filter {
    display: none;
}

/* Decorative Elements */
.timeline-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.timeline-decoration::before,
.timeline-decoration::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.05) 0%, transparent 70%);
}

.timeline-decoration::before {
    top: 10%;
    left: -100px;
}

.timeline-decoration::after {
    bottom: 10%;
    right: -100px;
}
