/* dom-timeline.css - Beautiful Modern Timeline using Theme Variables */

.dom-timeline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--timeline-height, 175px);
    z-index: 100;
    background: var(--timeline-bg);
    border-bottom: none;
    overflow: visible;
    user-select: none;
    pointer-events: auto;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Subtle inner glow at top */
.dom-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-glow) 20%,
        rgba(139, 92, 246, 0.4) 50%,
        var(--accent-glow) 80%,
        transparent 100%
    );
}

/* Filter row - top section */
.timeline-filter-row {
    position: relative;
    height: 60px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    border-bottom: none;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

/* Months row */
.timeline-months {
    position: relative;
    height: 40px;
    white-space: nowrap;
    background: transparent;
    overflow: hidden;
}

.timeline-month {
    position: absolute;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1.5px;
    color: var(--timeline-month-color);
    background: transparent;
    border-right: 1px solid var(--border-default);
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    transition: color var(--transition-fast);
}

.timeline-month:hover {
    color: var(--text-primary);
}

/* Days row */
.timeline-days {
    position: relative;
    height: 50px;
    white-space: nowrap;
    background: var(--timeline-days-bg);
    overflow: hidden;
    border-top: 1px solid var(--border-subtle);
}

.timeline-day {
    position: absolute;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-right: 1px solid var(--border-subtle);
    box-sizing: border-box;
    background: transparent;
    transition: background var(--transition-fast);
}

.timeline-day:hover {
    background: var(--accent-subtle);
}

/* Weekend days */
.timeline-day.weekend {
    background: var(--timeline-weekend-bg);
}

.timeline-day.weekend:hover {
    background: var(--accent-subtle);
}

/* Today highlight */
.timeline-day.today {
    background: var(--timeline-today-bg);
}

.timeline-day.today:hover {
    background: linear-gradient(180deg, var(--color-success-subtle) 0%, rgba(34, 197, 94, 0.2) 100%);
}

/* Week start border */
.timeline-day.week-start {
    border-left: 2px solid var(--border-hover);
}

/* Week view (zoomed out) - left border creates divider */
.timeline-day.week-view {
    border-left: 1px solid var(--border-hover);
    border-right: none;
}

/* Day labels */
.timeline-day .day-name {
    font-size: 10px;
    font-weight: 500;
    color: var(--timeline-day-name-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-day .day-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--timeline-day-color);
    line-height: 1;
}

/* Today's date number - glowing circle */
.timeline-day.today .day-number {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
    color: var(--text-on-accent);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 
        0 0 12px var(--color-success-glow),
        0 0 24px rgba(34, 197, 94, 0.2);
}

/* Today indicator when actual date is a non-working day (e.g., weekend) */
.timeline-day.today-proxy {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
}

.timeline-day.today-proxy:hover {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.12) 100%);
}

.timeline-day.today-proxy .day-number {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--text-on-accent);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 
        0 0 12px rgba(239, 68, 68, 0.5),
        0 0 24px rgba(239, 68, 68, 0.2);
}

.timeline-day .day-range {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
}

/* Milestones row */
.timeline-milestones {
    position: relative;
    height: 25px;
    background: var(--timeline-milestones-bg);
    border-top: 1px solid var(--border-subtle);
    overflow: visible;
    z-index: 2;
}

/* Milestone labels */
.timeline-milestone {
    position: absolute;
    transform: translateX(-50%);
    height: 24px;
    padding: 0 14px;
    background: var(--milestone-bg);
    color: var(--text-on-accent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: grab;
    white-space: nowrap;
    z-index: 3;
    border-radius: var(--radius-lg);
    box-shadow: 
        0 2px 8px var(--accent-glow),
        0 4px 16px var(--accent-subtle);
    transition: all var(--transition-fast);
}

.timeline-milestone:hover {
    filter: brightness(1.15);
    box-shadow: 
        0 4px 12px var(--accent-glow),
        0 6px 20px var(--accent-subtle);
    transform: translateX(-50%) translateY(-1px);
}

.timeline-milestone:active {
    cursor: grabbing;
    transform: translateX(-50%) translateY(0);
}

.timeline-milestone.selected {
    background: var(--milestone-selected-bg);
    box-shadow: 
        0 0 0 2px rgba(245, 158, 11, 0.3),
        0 4px 16px var(--color-warning-glow),
        0 8px 32px rgba(245, 158, 11, 0.2);
}

.timeline-milestone.locked {
    background: var(--milestone-locked-bg);
    cursor: default;
    opacity: 0.85;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.timeline-milestone.locked:hover {
    transform: translateX(-50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.timeline-milestone .milestone-name {
    font-weight: 600;
}

.timeline-milestone .milestone-lock {
    font-size: 10px;
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--transition-fast);
    filter: grayscale(0.3);
    display: flex;
    align-items: center;
}

.timeline-milestone .milestone-lock:hover {
    opacity: 1;
    transform: scale(1.1);
    filter: grayscale(0);
}

.timeline-milestone .milestone-lock .lock-icon {
    width: 12px;
    height: 12px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Milestone vertical lines container */
.timeline-milestone-lines {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 3000px;
    pointer-events: none;
    z-index: 99;
    overflow: visible;
}

.milestone-line {
    position: absolute;
    top: 0;
    width: 2px;
    height: 3000px;
    background: linear-gradient(180deg, 
        var(--accent) 0%,
        rgba(99, 102, 241, 0.4) 200px,
        rgba(99, 102, 241, 0.1) 600px,
        transparent 1500px
    );
    transform: translateX(-1px);
}

.milestone-line.selected {
    width: 3px;
    background: linear-gradient(180deg, 
        var(--color-warning) 0%,
        rgba(245, 158, 11, 0.5) 200px,
        rgba(245, 158, 11, 0.15) 600px,
        transparent 1500px
    );
    transform: translateX(-1.5px);
}

/* Bottom shadow/glow */
.dom-timeline::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: var(--timeline-shadow);
    pointer-events: none;
    z-index: 101;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline-month {
        font-size: 11px;
        letter-spacing: 1px;
    }
    
    .timeline-day .day-name {
        font-size: 9px;
    }
    
    .timeline-day .day-number {
        font-size: 11px;
    }
    
    .timeline-milestone {
        padding: 0 10px;
        font-size: 10px;
        height: 22px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dom-timeline {
        background: var(--bg-base);
        border-bottom: 2px solid var(--text-primary);
    }
    
    .timeline-day {
        border-right: 1px solid var(--border-hover);
    }
    
    .timeline-day .day-number {
        color: var(--text-primary);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .timeline-milestone,
    .timeline-day,
    .timeline-month {
        transition: none;
    }
}