/* css/modules/progress-bar.css */

/* Enhanced Progress Bar Container - Docked under header */
.progress-bar-container {
    width: 100%; /* Full width */
    height: 3px; /* Thin 3px height */
    background-color: var(--clr-border); /* Subtle track */
    position: sticky; /* Stick to viewport */
    top: 64px; /* Position directly under header (64px height) */
    z-index: 999; /* Below header but above content */
    border-radius: 0; /* Clean, sharp edges */
    overflow: hidden; /* Contain the fill animation */
    box-shadow: none; /* Remove shadow for clean line */
}

/* Progress Bar Fill Element - Brand Indigo */
.progress-bar-fill {
    height: 100%;
    background-color: var(--clr-indigo); /* Brand indigo color */
    width: 0; /* Initial width, JS will update this */
    border-radius: 0; /* Sharp edges for clean line */
    transition: width 0.6s ease-out; /* Smooth, slightly longer animation */
    display: block;
    position: relative;
    box-shadow: none; /* Clean line without shadow */
}

/* Simplified animation for thin progress bar */
.progress-bar-fill[data-updating="true"] {
    opacity: 0.9; /* Subtle opacity change when updating */
}

/* Progress Bar with Label */
.progress-bar-wrapper {
    position: relative;
    margin: 1.5rem 0;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--clr-ink);
}

.progress-bar-label__text {
    color: var(--clr-ink);
}

.progress-bar-label__percentage {
    color: var(--clr-indigo);
    font-weight: 600;
    font-variant-numeric: tabular-nums; /* Consistent number width */
}

/* Alternative progress bar styles for content areas */
.progress-bar-container--content {
    position: relative; /* Reset positioning for content use */
    top: auto;
    margin: 1.5rem 0;
    height: 8px;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar-container--content .progress-bar-fill {
    border-radius: 4px;
    background: linear-gradient(90deg, var(--clr-indigo), var(--clr-mint));
    box-shadow: 0 1px 2px rgba(91, 109, 251, 0.3);
}

/* Multi-step progress indicator */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--clr-border);
    z-index: 1;
    transform: translateY(-50%);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background-color: var(--clr-surface);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.progress-step__circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--clr-border);
    color: var(--clr-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease-out;
}

.progress-step__label {
    font-size: 0.8rem;
    color: #5a5f78;
    text-align: center;
    font-weight: 500;
}

/* Step states */
.progress-step--completed .progress-step__circle {
    background-color: var(--clr-mint);
    color: var(--clr-surface);
}

.progress-step--current .progress-step__circle {
    background-color: var(--clr-indigo);
    color: var(--clr-surface);
    box-shadow: 0 0 0 4px rgba(91, 109, 251, 0.2);
}

.progress-step--current .progress-step__label {
    color: var(--clr-indigo);
    font-weight: 600;
}

/* Accessibility improvements */
.progress-bar-fill[role="progressbar"] {
    /* Screen reader text will be provided via aria-label or associated text */
}

.progress-bar-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive adjustments for docked progress bar */
@media (max-width: 768px) {
    .progress-bar-container {
        top: 60px; /* Adjust for smaller mobile header height */
    }

    .progress-bar-label {
        font-size: 0.85rem;
    }

    .progress-steps {
        margin: 1.5rem 0;
    }

    .progress-step__circle {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .progress-step__label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .progress-bar-container {
        height: 2px; /* Even thinner on very small screens */
    }

    .progress-bar-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .progress-steps {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .progress-steps::before {
        display: none; /* Hide connecting line on very small screens */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .progress-bar-container {
        border: 1px solid var(--clr-ink);
        height: 4px; /* Slightly thicker for high contrast */
    }

    .progress-bar-fill {
        border: 1px solid var(--clr-ink);
    }

    .progress-step__circle {
        border: 2px solid var(--clr-ink);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .progress-bar-fill {
        transition: none;
    }

    .progress-step__circle {
        transition: none;
    }
}