/**
 * Timeline Schedule Frontend Stylesheet
 */

:root {
    --ts-primary: #2563eb;
    --ts-primary-hover: #1d4ed8;
    --ts-primary-light: #eff6ff;
    --ts-accent: #0284c7;
    --ts-text-main: #1e293b;
    --ts-text-muted: #64748b;
    --ts-border: #e2e8f0;
    --ts-bg-card: #ffffff;
    --ts-line-color: #cbd5e1;
    --ts-dot-color: #2563eb;
    --ts-radius: 12px;
    --ts-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --ts-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.09), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.ts-timeline-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--ts-text-main);
    padding: 0;
}

.ts-timeline-container * {
    box-sizing: border-box;
}

.ts-timeline-header-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: var(--ts-text-main);
}

/* Category Navigation Tabs (On Top - Max 5) */
.ts-category-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding: 6px;
    background: #f1f5f9;
    border-radius: 30px;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--ts-border);
}

.ts-category-tab-btn {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--ts-text-muted);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 9px 24px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ts-category-tab-btn:hover {
    color: var(--ts-text-main);
    background: rgba(255, 255, 255, 0.7);
}

.ts-category-tab-btn.is-active {
    background: var(--ts-primary);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

.ts-category-pane.is-hidden {
    display: none !important;
}

/* Room Filter Tabs */
.ts-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 30px;
}

.ts-filter-btn {
    appearance: none;
    background: #f1f5f9;
    color: var(--ts-text-muted);
    border: 1px solid var(--ts-border);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ts-filter-btn:hover {
    background: #e2e8f0;
    color: var(--ts-text-main);
}

.ts-filter-btn.is-active {
    background: var(--ts-primary);
    color: #ffffff;
    border-color: var(--ts-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Dual Stage Header Bar - Exact Balanced Columns with Center Spine */
.ts-stages-header-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr);
    gap: 0;
    align-items: center;
    margin-bottom: 24px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.ts-stage-heading-box {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ts-stage-heading-box.ts-stage-left {
    justify-content: center;
    padding-right: 20px;
}

.ts-stage-heading-box.ts-stage-center {
    justify-content: center;
    text-align: center;
    padding: 0 4px;
}

.ts-stage-heading-box.ts-stage-right {
    justify-content: center;
    padding-left: 20px;
}

.ts-stage-pill {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1.5px solid #bfdbfe;
    padding: 7px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.ts-time-pill {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Vertical Timeline Structure with Center Spine - Equal Left & Right Columns */
.ts-vertical-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    box-sizing: border-box;
}

.ts-timeline-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.ts-timeline-item.is-hidden {
    display: none;
}

/* Stage Slots (Both Left and Right identical 1fr width) */
.ts-stage-slot {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ts-slot-left {
    align-items: stretch;
    padding-right: 20px;
}

.ts-slot-right {
    align-items: stretch;
    padding-left: 20px;
}

/* Center Spine Column: Exactly Centered */
.ts-spine-col {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 6px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    z-index: 2;
}

.ts-time-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.ts-time-separator {
    color: var(--ts-text-muted);
    font-weight: 400;
    margin: 0 3px;
}

.ts-timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3.5px solid var(--ts-dot-color);
    margin-top: 10px;
    z-index: 2;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.ts-timeline-item:hover .ts-timeline-dot {
    transform: scale(1.25);
    border-color: var(--ts-primary-hover);
}

.ts-timeline-line {
    position: absolute;
    top: 50px;
    bottom: -28px;
    width: 2px;
    background-color: var(--ts-line-color);
    z-index: 1;
}

.ts-timeline-item:last-child .ts-timeline-line {
    display: none;
}

/* Card Column */
.ts-talk-card {
    background: var(--ts-bg-card);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    padding: 22px 24px;
    box-shadow: var(--ts-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.ts-talk-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--ts-shadow-hover);
    transform: translateY(-2px);
}

/* Card Directional Indicator Notch on Desktop */
@media (min-width: 861px) {
    .ts-item-left .ts-talk-card::after {
        content: '';
        position: absolute;
        right: -8px;
        top: 20px;
        width: 0;
        height: 0;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-left: 8px solid var(--ts-border);
    }

    .ts-item-left .ts-talk-card::before {
        content: '';
        position: absolute;
        right: -6px;
        top: 21px;
        width: 0;
        height: 0;
        border-top: 7px solid transparent;
        border-bottom: 7px solid transparent;
        border-left: 7px solid var(--ts-bg-card);
        z-index: 2;
    }

    .ts-item-right .ts-talk-card::after {
        content: '';
        position: absolute;
        left: -8px;
        top: 20px;
        width: 0;
        height: 0;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-right: 8px solid var(--ts-border);
    }

    .ts-item-right .ts-talk-card::before {
        content: '';
        position: absolute;
        left: -6px;
        top: 21px;
        width: 0;
        height: 0;
        border-top: 7px solid transparent;
        border-bottom: 7px solid transparent;
        border-right: 7px solid var(--ts-bg-card);
        z-index: 2;
    }
}

/* Card Meta Badges */
.ts-card-meta-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ts-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    line-height: 1.4;
}

.ts-badge-type {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.ts-badge-room {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.ts-icon-room {
    stroke-width: 2;
}

/* Title & Subtitle */
.ts-talk-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--ts-text-main);
    margin: 0 0 6px 0;
    line-height: 1.35;
}

.ts-talk-subtitle {
    font-size: 14px;
    color: var(--ts-text-muted);
    font-style: italic;
    margin-bottom: 14px;
    line-height: 1.4;
}

/* Speaker Block & Highlighted Avatars */
.ts-speaker-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.ts-speaker-avatar-wrap {
    flex-shrink: 0;
    position: relative;
}

.ts-speaker-avatar {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--ts-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 4px 10px rgba(37, 99, 235, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: block;
}

.ts-speaker-avatar:hover,
.ts-talk-card:hover .ts-speaker-avatar {
    transform: scale(1.06);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.28), 0 6px 16px rgba(37, 99, 235, 0.22);
    border-color: var(--ts-primary-hover);
}

.ts-speaker-avatar-placeholder {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ts-primary);
    border: 2.5px solid var(--ts-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 4px 10px rgba(37, 99, 235, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ts-talk-card:hover .ts-speaker-avatar-placeholder {
    transform: scale(1.06);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.28), 0 6px 16px rgba(37, 99, 235, 0.22);
}

.ts-speaker-info {
    display: flex;
    flex-direction: column;
}

.ts-speaker-name {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--ts-text-main);
    margin-bottom: 2px;
}

.ts-speaker-title {
    font-size: 13px;
    color: var(--ts-text-muted);
    line-height: 1.4;
}

/* Full Description Display */
.ts-talk-description {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--ts-border);
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.ts-talk-description p {
    margin-top: 0;
    margin-bottom: 10px;
}

.ts-talk-description p:last-child {
    margin-bottom: 0;
}

/* Empty Schedule message */
.ts-empty-schedule {
    padding: 30px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
    color: var(--ts-text-muted);
}

/* Responsive adjustments for tablets and mobile devices */
@media (max-width: 860px) {
    .ts-stages-header-bar {
        display: none;
    }

    .ts-category-tabs-nav {
        border-radius: 14px;
        width: 100%;
        gap: 6px;
    }

    .ts-category-tab-btn {
        flex: 1 1 auto;
        text-align: center;
        padding: 8px 12px;
        font-size: 13px;
    }

    .ts-timeline-item {
        display: flex;
        flex-direction: column;
        padding-left: 36px;
        position: relative;
        gap: 12px;
        width: 100%;
    }

    .ts-slot-left:empty,
    .ts-slot-right:empty {
        display: none;
    }

    .ts-stage-slot {
        width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .ts-spine-col {
        position: static;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding-top: 0;
        width: 100%;
    }

    .ts-timeline-dot {
        position: absolute;
        left: 0;
        top: 8px;
        margin-top: 0;
    }

    .ts-timeline-line {
        left: 7px;
        top: 24px;
        bottom: -28px;
    }

    .ts-talk-card {
        padding: 18px;
    }
}
