/**
 * Slide Navigation Bar
 * "Fundamentos Técnicos de IA para Abogados"
 *
 * (c) 2025 Trifolia (trifolia.cl)
 * Licensed under CC BY-NC-SA 4.0
 * https://creativecommons.org/licenses/by-nc-sa/4.0/
 */

/* Navigation Bar - hidden by default, revealed on mouse activity */
.slide-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(13, 17, 23, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(60, 120, 253, 0.2);
    padding: 14px 24px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.slide-nav-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Navigation Buttons */
.slide-nav-prev,
.slide-nav-next {
    flex: 0 0 auto;
}

.slide-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.slide-nav-btn:hover:not(.disabled) {
    color: white;
    background: rgba(60, 120, 253, 0.2);
    border-color: rgba(60, 120, 253, 0.4);
    transform: translateY(-1px);
    text-decoration: none;
}

.slide-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.slide-nav-arrow {
    font-size: 16px;
    font-weight: 500;
}

.slide-nav-label {
    font-weight: 500;
}

/* Dot Indicators */
.slide-nav-dots {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.slide-nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

/* Invisible expanded touch target (44px minimum) */
.slide-nav-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.slide-nav-dot:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.15);
}

.slide-nav-dot.active {
    background: linear-gradient(135deg, #00ffff 0%, #3c78fd 50%, #7200fc 100%);
    border-color: transparent;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(60, 120, 253, 0.5);
}

/* Focus Indicators */
.slide-nav-btn:focus-visible {
    outline: 2px solid #3c78fd;
    outline-offset: 2px;
    color: white;
    background: rgba(60, 120, 253, 0.2);
    border-color: rgba(60, 120, 253, 0.4);
}

.slide-nav-dot:focus-visible {
    outline: 2px solid #3c78fd;
    outline-offset: 4px;
    background: rgba(255, 255, 255, 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 575.98px) {
    .slide-nav {
        padding: 12px 16px;
    }

    .slide-nav-btn {
        padding: 10px 14px;
    }

    .slide-nav-label {
        display: none;
    }

    .slide-nav-arrow {
        font-size: 18px;
    }

    .slide-nav-dots {
        gap: 10px;
    }

}

/* Tablet */
@media (min-width: 576px) and (max-width: 767.98px) {
    .slide-nav-label {
        display: none;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .slide-nav-btn,
    .slide-nav-dot {
        transition: none;
    }

    .slide-nav-btn:hover:not(.disabled),
    .slide-nav-dot:hover {
        transform: none;
    }
}

/* -------------------------------------------
   Progress Indicator & Nav Auto-Show
   ------------------------------------------- */

/* Minimal progress indicator at bottom of viewport */
.slide-progress-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 999;
    pointer-events: none;
}

.slide-progress-indicator .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #7200fc);
    transition: width 0.3s ease;
}

/* Show nav briefly on mouse activity */
body.nav-active .slide-nav {
    transform: translateY(0);
    opacity: 1;
}

/* Hide progress bar when full nav is visible */
body.nav-active .slide-progress-indicator {
    opacity: 0;
}

/* Mobile: always-visible nav */
@media (max-width: 767.98px) {
    .slide-nav {
        transform: translateY(0);
        opacity: 1;
    }

    .slide-progress-indicator {
        display: none;
    }

    .slide-nav-dots {
        gap: 6px;
        min-width: 0;
    }

    .slide-nav-dot {
        width: 8px;
        height: 8px;
    }
}

/* Narrow mobile: fit all 20 dots + arrows on small screens */
@media (max-width: 480px) {
    .slide-nav-container {
        gap: 10px;
    }

    .slide-nav-dots {
        gap: 3px;
    }

    .slide-nav-dot {
        width: 6px;
        height: 6px;
    }
}
