/* Sidebar Progress Indicator Styles */

.sidebar-progress {
    position: sticky;
    top: 8rem; /* Fixed position - doesn't change with header expand/collapse */
    height: fit-content;
    max-height: calc(100vh - 10rem); /* Fixed max height */
    overflow: visible; /* Allow text to overflow in all directions */
    padding: 1rem 0 1rem 1.5rem; /* Add left padding so circles aren't cut off */
    display: none; /* Hidden by default, shown only on wide screens */
    width: 200px; /* Fixed width prevents layout shift */
    flex-shrink: 0; /* Don't shrink in flex layout */
}

/* Show only on screens >= 1200px */
@media (min-width: 1200px) {
    .sidebar-progress {
        display: block;
    }
}

/* Progress items list */
.progress-items {
    list-style: none;
    position: relative;
    padding-left: 1.5rem;
    margin: 0;
    overflow: visible; /* Allow text tooltips to overflow */
}

/* Vertical line connecting all dots */
.progress-items::before {
    content: '';
    position: absolute;
    left: 0.375rem; /* Center of 10px dot (0.375rem = (10px - 2px) / 2) */
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--color-border);
    transition: background 0.3s ease;
}

/* Individual progress items */
.progress-item {
    position: relative;
    margin-bottom: 0.75rem; /* Half of original 1.5rem */
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-item a {
    position: relative; /* For absolute positioning of text */
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    border-bottom: none;
    padding: 0.25rem 0;
    transition: all 0.2s ease;
}

/* Override main a styles for progress links */
main .progress-item a,
.dark-theme main .progress-item a {
    border-bottom: none !important;
    text-decoration: none !important;
}

/* Progress dot */
.progress-dot {
    position: relative;
    z-index: 1;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-left: -1.5rem;
}

/* Progress text - hidden by default */
.progress-text {
    position: fixed; /* Use fixed positioning to escape container clipping */
    font-size: 0.85rem;
    color: var(--color-muted);
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.3s ease;
    line-height: 1.3;
    pointer-events: none; /* Don't interfere with clicks */
    max-width: 400px; /* Allow longer text */
    width: max-content; /* Use as much space as needed */
    z-index: 1000; /* Ensure it appears above all content */
}

/* Hover state - reveal text */
.progress-item:hover .progress-text {
    opacity: 1;
    pointer-events: auto;
}

.progress-item:hover .progress-dot {
    border-color: var(--color-accent);
    transform: scale(1.2);
}

/* Active state - current section */
.progress-item.active .progress-dot {
    background: var(--color-accent);
    border-color: var(--color-accent);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.progress-item.active .progress-text {
    /* Don't show text on active - only on hover */
    color: var(--color-text);
    font-weight: 500;
}

/* Show text when hovering over active item */
.progress-item.active:hover .progress-text {
    opacity: 1;
    pointer-events: auto;
}

/* Focus state for accessibility */
.progress-item a:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.progress-item a:focus .progress-text {
    opacity: 1;
    pointer-events: auto;
}

/* Dark theme adjustments */
html.dark-theme .progress-item.active .progress-dot {
    box-shadow: 0 0 0 4px rgba(158, 193, 250, 0.2);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .progress-dot,
    .progress-text,
    .progress-items::before {
        transition: none;
    }
}

/* Custom scrollbar for overflow (if many headings) */
.sidebar-progress::-webkit-scrollbar {
    width: 6px;
}

.sidebar-progress::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-progress::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.sidebar-progress::-webkit-scrollbar-thumb:hover {
    background: var(--color-muted);
}
