/* ============================================
   Timeline Carousel Widget
   ============================================ */

.tcw-timeline-wrapper {
    --tcw-active: #EA7912;
    --tcw-passed: #C0C0C0;
    --tcw-upcoming: #FFFFFF;
    --tcw-bg: #1A1A1A;
    --tcw-year-color: rgba(255, 255, 255, 0.08);

    position: relative;
    width: 100%;
    min-height: 100vh;
    background: var(--tcw-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    user-select: none;
}

/* ---- Header Title ---- */
.tcw-header-title {
    position: absolute;
    top: 2rem;
    left: 3rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tcw-upcoming);
    letter-spacing: 0.05em;
    z-index: 10;
}

/* ---- Year Display (Large Background) ---- */
.tcw-year-display {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    line-height: 0.85;
    z-index: 1;
    pointer-events: none;
}

.tcw-year-top,
.tcw-year-bottom {
    font-size: clamp(8rem, 18vw, 20rem);
    font-weight: 900;
    color: var(--tcw-year-color);
    display: block;
    transition: opacity 0.5s ease;
}

/* ---- Year Subtitle ---- */
.tcw-year-subtitle {
    position: absolute;
    left: 3rem;
    bottom: 6rem;
    max-width: 30%;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
    z-index: 5;
    transition: opacity 0.4s ease;
}

/* ---- Navigation Arrows ---- */
.tcw-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--tcw-active);
    background: transparent;
    color: var(--tcw-active);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.tcw-nav-arrow:hover {
    background: var(--tcw-active);
    color: var(--tcw-bg);
}

.tcw-nav-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.tcw-nav-arrow:disabled:hover {
    background: transparent;
    color: var(--tcw-active);
}

.tcw-nav-arrow svg {
    width: 24px;
    height: 24px;
}

.tcw-nav-prev {
    left: 1.5rem;
}

.tcw-nav-next {
    right: 1.5rem;
}

/* ---- Timeline Content ---- */
.tcw-timeline-content {
    position: relative;
    margin-left: 50%;
    padding-right: 5rem;
    width: 40%;
    z-index: 10;
}

.tcw-timeline-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

/* ---- Events Container ---- */
.tcw-events-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ---- Single Event ---- */
.tcw-event {
    position: relative;
    padding-left: 2.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    min-height: 80px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
}

.tcw-event.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tcw-event.is-exiting {
    opacity: 0;
    transform: translateY(-30px);
    position: absolute;
    pointer-events: none;
}

/* Timeline Dot */
.tcw-event::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 1.5rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--tcw-upcoming);
    background: var(--tcw-bg);
    transition: all 0.4s ease;
    z-index: 5;
}

/* Timeline Connector Line */
.tcw-event::after {
    content: '';
    position: absolute;
    left: 0;
    top: calc(1.5rem + 14px);
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.4s ease;
}

.tcw-event:last-child::after {
    display: none;
}

/* State: Active */
.tcw-event.is-active::before {
    border-color: var(--tcw-active);
    background: var(--tcw-active);
    box-shadow: 0 0 20px rgba(234, 121, 18, 0.4);
}

.tcw-event.is-active::after {
    background: var(--tcw-active);
}

.tcw-event.is-active .tcw-event-month {
    color: var(--tcw-active);
}

.tcw-event.is-active .tcw-event-title {
    color: var(--tcw-active);
}

.tcw-event.is-active .tcw-event-desc {
    color: rgba(234, 121, 18, 0.7);
}

.tcw-event.is-active .tcw-event-badge {
    background: var(--tcw-active);
    color: var(--tcw-bg);
}

/* State: Passed */
.tcw-event.is-passed::before {
    border-color: var(--tcw-passed);
    background: var(--tcw-passed);
}

.tcw-event.is-passed::after {
    background: var(--tcw-passed);
}

.tcw-event.is-passed .tcw-event-month {
    color: var(--tcw-passed);
}

.tcw-event.is-passed .tcw-event-title {
    color: var(--tcw-passed);
}

.tcw-event.is-passed .tcw-event-desc {
    color: rgba(192, 192, 192, 0.5);
}

.tcw-event.is-passed .tcw-event-badge {
    background: var(--tcw-passed);
    color: var(--tcw-bg);
}

/* State: Upcoming (default) */
.tcw-event .tcw-event-month {
    color: var(--tcw-upcoming);
    transition: color 0.4s ease;
}

.tcw-event .tcw-event-title {
    color: var(--tcw-upcoming);
    transition: color 0.4s ease;
}

/* ---- Event Inner Elements ---- */
.tcw-event-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.tcw-event-month {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.tcw-event-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.05em;
    transition: all 0.4s ease;
}

.tcw-event-title {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.tcw-event-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.4s ease;
}

/* ---- Year Navigation Dots ---- */
.tcw-year-nav {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 20;
}

.tcw-year-dot {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tcw-year-dot:hover {
    color: var(--tcw-active);
    border-color: var(--tcw-active);
}

.tcw-year-dot.is-active {
    color: var(--tcw-bg);
    background: var(--tcw-active);
    border-color: var(--tcw-active);
}

/* ---- Scroll Indicator ---- */
.tcw-scroll-indicator {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.tcw-scroll-text {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.3);
    writing-mode: vertical-lr;
}

.tcw-scroll-line {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.tcw-scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--tcw-active);
    animation: tcw-scroll-anim 1.5s ease-in-out infinite;
}

@keyframes tcw-scroll-anim {
    0% { top: -100%; }
    50% { top: 100%; }
    100% { top: 100%; }
}

/* ---- Transition Overlay (year switch) ---- */
.tcw-transition-overlay {
    position: absolute;
    inset: 0;
    background: var(--tcw-bg);
    opacity: 0;
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.tcw-transition-overlay.is-active {
    opacity: 1;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .tcw-year-display {
        left: 1.5rem;
    }

    .tcw-year-top,
    .tcw-year-bottom {
        font-size: clamp(5rem, 15vw, 12rem);
    }

    .tcw-timeline-content {
        margin-left: 40%;
        width: 50%;
        padding-right: 3rem;
    }

    .tcw-year-subtitle {
        max-width: 35%;
        left: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tcw-year-display {
        top: 8rem;
        transform: none;
        left: 1rem;
    }

    .tcw-year-top,
    .tcw-year-bottom {
        font-size: clamp(4rem, 20vw, 8rem);
    }

    .tcw-timeline-content {
        margin-left: 1.5rem;
        margin-top: 40%;
        width: calc(100% - 3rem);
        padding-right: 1.5rem;
    }

    .tcw-year-subtitle {
        max-width: 60%;
        bottom: auto;
        top: 5rem;
        left: 1rem;
    }

    .tcw-header-title {
        left: 1rem;
        top: 1rem;
    }

    .tcw-nav-prev {
        left: 0.75rem;
    }

    .tcw-nav-next {
        right: 0.75rem;
    }

    .tcw-nav-arrow {
        width: 36px;
        height: 36px;
    }

    .tcw-nav-arrow svg {
        width: 18px;
        height: 18px;
    }

    .tcw-year-nav {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 1rem;
    }
}
