/* =====================================================
   HONESTLY, E — Timeline Styles
   Visual timeline for life events
   ===================================================== */

/* -----------------------------------------------------
   Right Sidebar: Timeline Container
   ----------------------------------------------------- */
.timeline-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
}

.timeline-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.timeline-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.timeline-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* -----------------------------------------------------
   Timeline Scroll Area
   ----------------------------------------------------- */
.timeline-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}

/* The vertical spine */
.timeline-spine {
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--gold) 0%, var(--navy) 100%);
    border-radius: 2px;
}

/* -----------------------------------------------------
   Timeline Markers
   ----------------------------------------------------- */
.timeline-markers {
    position: relative;
    padding-left: 2.5rem;
}

.timeline-marker {
    position: relative;
    padding: 0.75rem 0 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-marker:hover {
    background: var(--bg-hover);
    border-radius: 8px;
    margin-left: -0.5rem;
    padding-left: 2rem;
}

/* The dot on the spine */
.timeline-marker::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--gold);
    border: 3px solid var(--bg-card);
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1;
}

.timeline-marker:hover::before {
    transform: translateY(-50%) scale(1.2);
    box-shadow: 0 0 0 4px rgba(197, 165, 114, 0.2);
}

/* Turning point markers (larger) */
.timeline-marker.turning-point::before {
    width: 18px;
    height: 18px;
    left: -1.7rem;
    background: var(--navy);
    border: 3px solid var(--gold);
}

.timeline-marker.turning-point:hover::before {
    box-shadow: 0 0 0 4px rgba(27, 54, 93, 0.2);
}

/* Marker content */
.timeline-marker-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.timeline-marker-label {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.timeline-marker.turning-point .timeline-marker-label {
    font-weight: 600;
    color: var(--navy);
}

.timeline-marker-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -----------------------------------------------------
   Timeline Tooltip (hover preview)
   ----------------------------------------------------- */
.timeline-tooltip {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--navy);
    color: white;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-top: 4px;
}

.timeline-marker:hover .timeline-tooltip {
    opacity: 1;
    visibility: visible;
}

/* -----------------------------------------------------
   Empty State
   ----------------------------------------------------- */
.timeline-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.timeline-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.timeline-empty-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-empty-text {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* -----------------------------------------------------
   Year Separators
   ----------------------------------------------------- */
.timeline-year {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold);
    padding: 1rem 0 0.5rem 0;
    margin-left: -0.5rem;
    position: relative;
}

.timeline-year::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    width: 20px;
    height: 2px;
    background: var(--gold);
}

/* -----------------------------------------------------
   Mark as Timeline Event (in entry detail)
   ----------------------------------------------------- */
.timeline-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.timeline-toggle-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
    cursor: pointer;
}

.timeline-toggle-label {
    flex: 1;
}

.timeline-toggle-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.timeline-toggle-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timeline-label-input {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    background: var(--bg-card);
    color: var(--text-primary);
}

.timeline-label-input:focus {
    outline: none;
    border-color: var(--gold);
}

.timeline-label-input::placeholder {
    color: var(--text-muted);
}

/* Only show input when checkbox is checked */
.timeline-toggle:not(.active) .timeline-label-input {
    display: none;
}

/* -----------------------------------------------------
   Mobile: Timeline Drawer
   ----------------------------------------------------- */
@media (max-width: 1024px) {
    .timeline-sidebar {
        display: none;
    }
}

/* Mobile drawer (slides up from bottom) */
.timeline-drawer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 200;
    max-height: 70vh;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.timeline-drawer.active {
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .timeline-drawer {
        display: block;
    }
}

.timeline-drawer-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0.75rem auto;
}

.timeline-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.timeline-drawer-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-primary);
}

.timeline-drawer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.timeline-drawer-content {
    padding: 1rem 1.25rem 2rem;
    max-height: calc(70vh - 80px);
    overflow-y: auto;
}

/* Mobile timeline button (FAB style) */
.timeline-fab {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--navy) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(27, 54, 93, 0.3);
    z-index: 100;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(27, 54, 93, 0.4);
}

.timeline-fab:active {
    transform: scale(0.95);
}

@media (max-width: 1024px) {
    .timeline-fab {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Overlay for mobile drawer */
.timeline-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-overlay.active {
    opacity: 1;
}

@media (max-width: 1024px) {
    .timeline-overlay {
        display: block;
        pointer-events: none;
    }
    
    .timeline-overlay.active {
        pointer-events: auto;
    }
}

/* -----------------------------------------------------
   Journal card badge for timeline events
   ----------------------------------------------------- */
.badge-timeline {
    background: linear-gradient(135deg, var(--gold) 0%, var(--navy) 100%);
    color: white;
}
