/**
 * USWDGC 2026 - Section Navigation
 * Vertical rail + scroll progress bar
 * Championship Editorial aesthetic
 */

/* ==========================================================================
   Scroll Progress Bar
   ========================================================================== */

.uswdgc-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 52, 98, 0.3);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.uswdgc-progress-bar.visible {
    opacity: 1;
}

.uswdgc-progress-bar__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        var(--uswdgc-teal, #009f91) 0%,
        var(--uswdgc-gold, #fabe28) 100%
    );
    box-shadow: 0 0 10px var(--uswdgc-glow-gold, rgba(250, 190, 40, 0.5));
    transition: width 0.1s linear;
}

/* ==========================================================================
   Vertical Section Rail
   ========================================================================== */

.uswdgc-section-rail {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.uswdgc-section-rail.visible {
    opacity: 1;
    visibility: visible;
}

/* Connecting track line */
.uswdgc-section-rail__track {
    position: absolute;
    left: 5px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 10%,
        rgba(255, 255, 255, 0.1) 90%,
        transparent 100%
    );
    border-radius: 1px;
}

/* Individual section items */
.uswdgc-section-rail__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.uswdgc-section-rail__item:hover {
    transform: translateX(4px);
}

/* Hide items based on path */
.page-majors-uswdgc2026[data-active-path="competitor"] .uswdgc-section-rail__item[data-path="community"] {
    display: none;
}

.page-majors-uswdgc2026[data-active-path="community"] .uswdgc-section-rail__item[data-path="competitor"] {
    display: none;
}

/* Section dot */
.uswdgc-section-rail__dot {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.uswdgc-section-rail__dot::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        var(--uswdgc-glow-gold, rgba(250, 190, 40, 0.4)) 0%,
        transparent 70%
    );
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Active state */
.uswdgc-section-rail__item.active .uswdgc-section-rail__dot {
    background: var(--uswdgc-gold, #fabe28);
    border-color: var(--uswdgc-gold, #fabe28);
    box-shadow: 0 0 20px var(--uswdgc-glow-gold, rgba(250, 190, 40, 0.6));
}

.uswdgc-section-rail__item.active .uswdgc-section-rail__dot::before {
    opacity: 1;
    transform: scale(1);
}

/* Hover state */
.uswdgc-section-rail__item:hover .uswdgc-section-rail__dot {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.uswdgc-section-rail__item.active:hover .uswdgc-section-rail__dot {
    background: var(--uswdgc-gold, #fabe28);
    border-color: var(--uswdgc-gold, #fabe28);
}

/* Section label */
.uswdgc-section-rail__label {
    font-family: var(--font-display, 'Suiza', system-ui, sans-serif);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.uswdgc-section-rail__item:hover .uswdgc-section-rail__label,
.uswdgc-section-rail__item.active .uswdgc-section-rail__label {
    opacity: 1;
    transform: translateX(0);
}

.uswdgc-section-rail__item.active .uswdgc-section-rail__label {
    color: var(--uswdgc-gold, #fabe28);
}

.uswdgc-section-rail__item:hover .uswdgc-section-rail__label {
    color: rgba(255, 255, 255, 0.8);
}

.uswdgc-section-rail__item.active:hover .uswdgc-section-rail__label {
    color: var(--uswdgc-gold, #fabe28);
}

/* ==========================================================================
   Responsive - Hide on smaller screens
   ========================================================================== */

@media (max-width: 1200px) {
    .uswdgc-section-rail {
        left: 0.75rem;
    }

    .uswdgc-section-rail__label {
        display: none;
    }

    .uswdgc-section-rail__item {
        padding: 0.5rem 0;
    }

    .uswdgc-section-rail__dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 768px) {
    .uswdgc-section-rail {
        display: none;
    }

    .uswdgc-progress-bar {
        height: 2px;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .uswdgc-progress-bar,
    .uswdgc-progress-bar__fill,
    .uswdgc-section-rail,
    .uswdgc-section-rail__item,
    .uswdgc-section-rail__dot,
    .uswdgc-section-rail__dot::before,
    .uswdgc-section-rail__label {
        transition: none;
    }
}

/* ==========================================================================
   Light Mode Overrides (Bootstrap uses data-bs-theme)
   ========================================================================== */

/* Progress bar track - darker for light backgrounds */
[data-bs-theme="light"] .uswdgc-progress-bar {
    background: rgba(0, 52, 98, 0.15);
}

/* Track line - use navy instead of white */
[data-bs-theme="light"] .uswdgc-section-rail__track {
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 52, 98, 0.3) 10%,
        rgba(0, 52, 98, 0.3) 90%,
        transparent 100%
    );
}

/* Section dots - solid navy with white outline for visibility on any background */
[data-bs-theme="light"] .uswdgc-section-rail__dot {
    background: var(--uswdgc-navy, #003462);
    border-color: var(--uswdgc-navy, #003462);
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.9),
        0 0 0 3px rgba(0, 52, 98, 0.3);
}

[data-bs-theme="light"] .uswdgc-section-rail__item:hover .uswdgc-section-rail__dot {
    background: var(--uswdgc-navy, #003462);
    border-color: var(--uswdgc-navy, #003462);
    transform: scale(1.1);
}

/* Active state - gold with white outline */
[data-bs-theme="light"] .uswdgc-section-rail__item.active .uswdgc-section-rail__dot {
    background: var(--uswdgc-gold, #fabe28);
    border-color: var(--uswdgc-gold, #fabe28);
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.9),
        0 0 0 3px rgba(0, 52, 98, 0.3),
        0 0 12px rgba(250, 190, 40, 0.6);
}

/* Labels - navy with white text-stroke for visibility */
[data-bs-theme="light"] .uswdgc-section-rail__label {
    color: var(--uswdgc-navy, #003462);
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 8px rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

[data-bs-theme="light"] .uswdgc-section-rail__item:hover .uswdgc-section-rail__label {
    color: var(--uswdgc-navy, #003462);
}

/* Active label - gold with white outline */
[data-bs-theme="light"] .uswdgc-section-rail__item.active .uswdgc-section-rail__label {
    color: var(--uswdgc-gold-dark, #b8860b);
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 8px rgba(255, 255, 255, 0.9);
}

[data-bs-theme="light"] .uswdgc-section-rail__item.active:hover .uswdgc-section-rail__label {
    color: var(--uswdgc-gold-dark, #b8860b);
}
