/* --- Events Timeline View --- */
#view_events {
    background-color: var(--theme-surface-main, #0d0d0e);
    /* Even darker background for premium look */
    display: flex;
    flex-direction: column;
    color: var(--theme-text-emphasis, #ffffff);
    height: 100%;
    position: relative;
}

.timeline_title_wrapper {
    overflow: hidden;
    height: calc(32 * var(--ws-unit, 1px));
    position: relative;
    min-width: calc(350 * var(--ws-unit, 1px));
    /* Ensure enough space for long month names like September */
    /* Removed flex to allow absolute children to overlap without pushing */
}

.timeline_title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin: 0;
    line-height: 1;
    letter-spacing: calc(-0.5 * var(--ws-unit, 1px));
    white-space: nowrap;
    /* Prevent month names from wrapping to the next line */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

/* Next Month Transition (Old goes down, New from top) */
.title-slide-out-down {
    transform: translateY(100%);
    opacity: 0;
}

.title-slide-in-top {
    transform: translateY(-100%);
    opacity: 0;
}

/* Prev Month Transition (Old goes up, New from bottom) */
.title-slide-out-up {
    transform: translateY(-100%);
    opacity: 0;
}

.title-slide-in-bottom {
    transform: translateY(100%);
    opacity: 0;
}

/* Active state for both */
.title-active {
    transform: translateY(0);
    opacity: 1;
}

.timeline_subtitle {
    font-size: var(--font-size-base, calc(14 * var(--ws-unit, 1px)));
    font-weight: 700;
    color: var(--theme-accent-text, #a78bfa);
    margin: calc(8 * var(--ws-unit, 1px)) 0 0 calc(6 * var(--ws-unit, 1px));
    text-transform: uppercase;
    letter-spacing: calc(2 * var(--ws-unit, 1px));
    display: flex;
    /* Using flex for alignment with the wrapper */
    align-items: center;
}

/* --- Subtitle Year Animation --- */
.timeline_year_wrapper {
    display: inline-flex;
    overflow: hidden;
    height: calc(18 * var(--ws-unit, 1px));
    /* Slightly taller than 14px font for room */
    position: relative;
    vertical-align: middle;
    width: calc(54 * var(--ws-unit, 1px));
    /* Enough for 4 digits */
    margin-left: calc(5 * var(--ws-unit, 1px));
}

.timeline_year {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: var(--font-size-base, calc(14 * var(--ws-unit, 1px)));
    font-weight: 700;
    color: var(--theme-accent-text, #a78bfa);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.timeline_header_right {
    display: flex;
    gap: calc(8 * var(--ws-unit, 1px));
    margin-bottom: 0;
    align-self: flex-start;
}

.timeline_header_right .ws-header-btn img {
    width: calc(16 * var(--ws-unit, 1px));
    height: calc(16 * var(--ws-unit, 1px));
}

.timeline_scroll_area {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 calc(32 * var(--ws-unit, 1px)) calc(40 * var(--ws-unit, 1px)) calc(32 * var(--ws-unit, 1px));
    position: relative;
    scrollbar-width: none;
    /* Hide for cleaner look */
}

.timeline_scroll_area::-webkit-scrollbar {
    display: none;
}

/* Timeline Custom Scrollbar */
.custom-scrollbar-track.timeline-scrollbar {
    top: calc(105 * var(--ws-unit, 1px));
    bottom: 0px;
    right: 0px;
    background-color: transparent;
    z-index: 20;
}

/* Timeline Scrollbar Markers */
.timeline-scrollbar-marker {
    position: absolute;
    right: calc(15 * var(--ws-unit, 1px));

    font-weight: 700;
    background-color: transparent;
    padding: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    transform: translateY(-50%);
    z-index: 30;
    text-shadow: 0 calc(1 * var(--ws-unit, 1px)) calc(3 * var(--ws-unit, 1px)) var(--theme-shadow, rgba(0, 0, 0, 0.8));
}

.timeline-scrollbar-marker.month {
    font-size: calc(11 * var(--ws-unit, 1px));
    color: var(--theme-accent-text, #a78bfa);
}

.timeline-scrollbar-marker.day {
    font-size: calc(9 * var(--ws-unit, 1px));
    color: var(--theme-text-secondary, rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.4));
}


.custom-scrollbar-track.timeline-scrollbar:hover .timeline-scrollbar-marker,
.custom-scrollbar-track.timeline-scrollbar:active .timeline-scrollbar-marker,
.custom-scrollbar-track.timeline-scrollbar.scrolling .timeline-scrollbar-marker,
.custom-scrollbar-track.timeline-scrollbar .custom-scrollbar-thumb.scrolling ~ .timeline-scrollbar-marker {
    opacity: 1;
}

/* Base class for the content container being animated */
.timeline_content {
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.6s ease;
    width: 100%;
    /* Ensure it doesn't shrink during animation */
}

/* Classes for the exit/entry animations */
.timeline_content.slide-push-out-left {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: calc(40 * var(--ws-unit, 1px));
    /* Padding of scroll area */
    right: calc(40 * var(--ws-unit, 1px));
}

.timeline_content.slide-push-out-right {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: calc(40 * var(--ws-unit, 1px));
    right: calc(40 * var(--ws-unit, 1px));
}

.timeline_content.slide-push-in-right {
    transform: translateX(100%);
    opacity: 0;
}

.timeline_content.slide-push-in-left {
    transform: translateX(-100%);
    opacity: 0;
}

/* Active state for newly added content */
.timeline_content.active {
    transform: none;
    opacity: 1;
}

.timeline_content {
    display: flex;
    flex-direction: column;
    gap: calc(30 * var(--ws-unit, 1px));
}

.timeline_day_section {
    display: flex;
    flex-direction: column;
    gap: calc(4 * var(--ws-unit, 1px));
}

.timeline_day_header {
    position: sticky;
    top: 0;
    background: var(--theme-surface-main, #0d0d0e);
    margin: 0 calc(-32 * var(--ws-unit, 1px));
    z-index: 10;
}

.timeline_day_header_inner {
    display: flex;
    align-items: baseline;
    gap: calc(12 * var(--ws-unit, 1px));
    padding: calc(12 * var(--ws-unit, 1px)) calc(32 * var(--ws-unit, 1px));
}

.timeline_day_num {
    font-size: calc(36 * var(--ws-unit, 1px));
    font-weight: 800;
    color: var(--theme-text-muted, #444);
    /* Very dark for depth */
    line-height: 1;
}

.timeline_day_name {
    font-size: var(--font-size-base);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--theme-accent-text, #a78bfa);
    letter-spacing: calc(1 * var(--ws-unit, 1px));
}

.timeline_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(calc(280 * var(--ws-unit, 1px)), 1fr));
    gap: calc(16 * var(--ws-unit, 1px));
}

/* Event Card Styles */
/* --- Base Event Card (Foundation) --- */
.event_card {
    position: relative;
    border-radius: calc(16 * var(--ws-unit, 1px));
    overflow: hidden;
    background-color: var(--theme-surface-main, #161618);
    min-height: calc(240 * var(--ws-unit, 1px));
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    z-index: 1;
    border: calc(1 * var(--ws-unit, 1px)) solid rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.05);
    box-sizing: border-box;
}

.event_card:hover {
    transform: scale(1.02);
    box-shadow: 0 calc(15 * var(--ws-unit, 1px)) calc(30 * var(--ws-unit, 1px)) var(--theme-shadow, rgba(0, 0, 0, 0.5));
}

.event_card.large {
    grid-column: span 2;
}

/* --- Mode 1: Text-only (Default Spacious Design) --- */
.event_card:not(.has-image) {
    /* Edit variables here to update all text-only cards */
    --card-padding: calc(32 * var(--ws-unit, 1px)) calc(28 * var(--ws-unit, 1px));
    --card-height: calc(280 * var(--ws-unit, 1px));
    /* Unified Height for all cards */
    --tag-margin: calc(20 * var(--ws-unit, 1px));
    --title-size: calc(24 * var(--ws-unit, 1px));
    --title-margin: calc(5 * var(--ws-unit, 1px));
    --title-line-height: 1.3;
    /* --desc-margin-top: 10px; */
    --footer-margin-top: calc(15 * var(--ws-unit, 1px));

    justify-content: space-between;
    padding: var(--card-padding);
    min-height: var(--card-height);
}

.event_card:not(.has-image).large {
    --card-height: calc(320 * var(--ws-unit, 1px));
}

.event_card:not(.has-image) .event_card_tags {
    margin-bottom: var(--tag-margin);
}

.event_card:not(.has-image) .event_card_title {
    font-size: var(--title-size);
    margin-bottom: var(--title-margin);
    line-height: var(--title-line-height);
}

.event_card:not(.has-image) .event_card_top {
    flex-grow: 1;
}

.event_card:not(.has-image) .event_card_desc {
    -webkit-line-clamp: 8;
    line-clamp: 8;
    margin-top: calc(10 * var(--ws-unit, 1px));
}

.event_card:not(.has-image).large .event_card_desc {
    -webkit-line-clamp: 8;
    line-clamp: 8;
}

.event_card:not(.has-image) .event_card_footer {
    margin-top: var(--footer-margin-top);
}

.event_card:not(.has-image) .event_card_bottom {
    margin-top: auto;
}

/* --- Mode 2: Image Background (Compact Overlay Design) --- */
.event_card.has-image {
    /* Edit variables here to update all image cards */
    --img-card-padding: calc(20 * var(--ws-unit, 1px));
    --img-card-min-height: calc(280 * var(--ws-unit, 1px));
    /* Unified Height for all cards */
    --img-tag-margin: calc(10 * var(--ws-unit, 1px));
    --img-title-size: calc(22 * var(--ws-unit, 1px));
    --img-title-margin: calc(5 * var(--ws-unit, 1px));
    --img-title-line-height: 1.2;
    /* --img-desc-margin-top: 8px; */
    --img-footer-margin-top: calc(10 * var(--ws-unit, 1px));

    justify-content: flex-end;
    padding: var(--img-card-padding);
    min-height: var(--img-card-min-height);
}

.event_card.has-image.large {
    --img-card-min-height: calc(320 * var(--ws-unit, 1px));
    /* Consistent Large Height */
}

.event_card.has-image .event_card_tags {
    margin-bottom: var(--img-tag-margin);
}

.event_card.has-image .event_card_title {
    font-size: var(--img-title-size);
    margin-bottom: var(--img-title-margin);
    line-height: var(--img-title-line-height);
}

.event_card.has-image .event_card_desc {
    margin-top: var(--img-desc-margin-top);
}

.event_card.has-image .event_card_footer {
    margin-top: var(--img-footer-margin-top);
}

.event_card.has-image .event_card_bottom {
    margin-top: 0;
}

/* --- Shared Elements & Overlay (Z-index Management) --- */
.event_card_top,
.event_card_bottom {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
}

.event_card_bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.6;
    transition: transform 0.5s ease;
}

.event_card:hover .event_card_bg {
    transform: scale(1.05);
}

.event_card_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--theme-overlay, rgba(0, 0, 0, 0.95)) 0%, var(--theme-overlay, rgba(0, 0, 0, 0.4)) 50%, transparent 100%);
    z-index: 1;
}

/* --- Inner Components Base Styles --- */
.event_card_tags {
    text-shadow: none;
    display: flex;
    flex-wrap: wrap;
    gap: calc(6 * var(--ws-unit, 1px));
    margin-bottom: calc(8 * var(--ws-unit, 1px));
    overflow: hidden;
    max-height: calc(28 * var(--ws-unit, 1px));

    align-items: center;
    padding-right: calc(10 * var(--ws-unit, 1px));

}

.event_tag {
    font-size: var(--font-size-base, calc(14 * var(--ws-unit, 1px)));
    font-weight: var(--font-weight-semibold);
    padding: calc(4 * var(--ws-unit, 1px)) calc(9 * var(--ws-unit, 1px));
    border-radius: calc(6 * var(--ws-unit, 1px));
    text-transform: uppercase;
    letter-spacing: calc(0.5 * var(--ws-unit, 1px));
    backdrop-filter: blur(calc(4 * var(--ws-unit, 1px)));
    border: calc(1 * var(--ws-unit, 1px)) solid rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.1);
    white-space: nowrap;
}

.event_tag_more {
    background-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.2);
    color: var(--theme-text-emphasis, #fff);
    border-color: rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.event_card_title {
    font-weight: 800;
    margin: 0;
}

.event_card_desc {
    font-size: var(--font-size-md, calc(16 * var(--ws-unit, 1px)));
    color: var(--theme-text-secondary, rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.6));
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event_card_footer {
    display: flex;
    gap: calc(12 * var(--ws-unit, 1px));
    font-size: var(--font-size-base, calc(14 * var(--ws-unit, 1px)));
    font-weight: 700;
    color: var(--theme-text-secondary, rgba(var(--theme-foreground-rgb, 255, 255, 255), 0.7));
}

.event_card_info_item {
    display: flex;
    align-items: center;
    gap: calc(5 * var(--ws-unit, 1px));
}

.event_card_info_item img {
    width: calc(14 * var(--ws-unit, 1px));
    height: calc(14 * var(--ws-unit, 1px));
    opacity: 0.6;
}

/* Sidebar Nav Pointer Fix */
.sidebar_nav_item {
    position: relative;
    cursor: pointer;
}