/**
 * SLA Course Navigation Styles
 */

/* Hide default LearnDash nav */
.sfwd-lessons .learndash-shortcode-wrap-ld_navigation,
.sfwd-topic .learndash-shortcode-wrap-ld_navigation {
    display: none !important;
}

/* Prevent horizontal scroll */
body.sfwd-lessons,
body.sfwd-topic {
    overflow-x: hidden;
}

/* Wrapper - zorgt voor ruimte onderaan */
.lessonnav-wrap {
    height: 100px;
}

/* ================================
   DESKTOP NAVIGATION
   ================================ */

.lessonnav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1000;
}

/* Primary Navigation Bar */
.lessonnav-primary {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    border-radius: 9999px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Button Wrapper */
.lessonnav-btn-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Divider */
.lessonnav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

/* Primary Buttons */
.lessonnav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-decoration: none;
}

.lessonnav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.lessonnav-btn:active {
    transform: scale(0.95);
}

.lessonnav-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
}

/* Previous Button - meer prominent */
.lessonnav-btn.is-prev {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.lessonnav-btn.is-prev:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Next Button - CTA */
.lessonnav-btn.is-next {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.lessonnav-btn.is-next:hover {
    background: #3b82f6;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* Complete Button */
.lessonnav-btn.is-complete {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}

.lessonnav-btn.is-complete:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Completed State */
.lessonnav-btn.is-done {
    background: #2563eb;
    color: #fff;
}

.lessonnav-btn.is-done:hover {
    transform: none;
    cursor: default;
}

/* Disabled */
.lessonnav-btn.is-disabled {
    background: rgba(255, 255, 255, 0.03);
    opacity: 0.3;
    cursor: not-allowed;
}

.lessonnav-btn.is-disabled:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: none;
    color: rgba(255, 255, 255, 0.6);
}

/* Loading */
.lessonnav-btn.is-loading,
.lessonnav-mobile-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.lessonnav-btn.is-loading svg,
.lessonnav-mobile-btn.is-loading svg {
    animation: lessonnav-spin 1s linear infinite;
}

@keyframes lessonnav-spin {
    to { transform: rotate(360deg); }
}

/* ================================
   SECONDARY NAVIGATION (Desktop)
   ================================ */

.lessonnav-secondary {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 16px;
    border-radius: 9999px;
}

.lessonnav-secondary-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
}

.lessonnav-secondary-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.lessonnav-secondary-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.lessonnav-secondary-dot {
    display: inline-block;
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
}

.lessonnav-badge {
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 9999px;
}

/* ================================
   MOBILE NAV (hidden on desktop)
   ================================ */

.lessonnav-mobile {
    display: none;
}

/* ================================
   TOOLTIPS
   ================================ */

.lessonnav-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10000;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    margin-bottom: 8px;
}

.lessonnav-btn-wrap:hover .lessonnav-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.lessonnav-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(0, 0, 0, 0.9);
}

/* ================================
   SUCCESS BOX (aparte shortcode)
   ================================ */

.lessonnav-success-box {
    margin: 30px 0;
    border-radius: 16px;
    overflow: hidden;
}

.lessonnav-success-box-content {
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.lessonnav-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    animation: lessonnav-pop 0.6s ease;
}

@keyframes lessonnav-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.lessonnav-success-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px;
    color: #fff;
}

.lessonnav-success-message {
    font-size: 18px;
    margin: 0 0 30px;
    color: rgba(255, 255, 255, 0.9);
}

.lessonnav-success-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: #2563eb;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.lessonnav-success-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    color: #fff;
}

.lessonnav-success-arrow {
    transition: transform 0.3s ease;
}

.lessonnav-success-button:hover .lessonnav-success-arrow {
    transform: translateX(5px);
}

.lessonnav-success-next-title {
    margin: 15px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

/* ================================
   NOTIFICATION
   ================================ */

.lessonnav-msg {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    animation: lessonnav-slide-in 0.3s ease;
    max-width: 400px;
    cursor: pointer;
}

@keyframes lessonnav-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.lessonnav-msg.is-success {
    background: #28a745;
    color: #fff;
}

.lessonnav-msg.is-error {
    background: #dc3545;
    color: #fff;
}

.lessonnav-msg.fade-out {
    animation: lessonnav-fade-out 0.3s ease forwards;
}

@keyframes lessonnav-fade-out {
    to { opacity: 0; transform: translateX(100%); }
}

/* ================================
   RESPONSIVE - TABLET
   ================================ */

@media (max-width: 768px) {
    .lessonnav-tooltip {
        display: none !important;
    }
    
    .lessonnav-secondary {
        display: none;
    }
}

/* ================================
   RESPONSIVE - MOBILE
   ================================ */

@media (max-width: 480px) {
    .lessonnav-topic-template .lessonnav-wrap {
        height: 140px;
    }
    
    body.sfwd-lessons .lessonnav-wrap {
        height: 0;
    }
    
    .lessonnav {
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        gap: 0;
    }
    
    /* Hide desktop nav */
    .lessonnav-primary,
    .lessonnav-secondary {
        display: none;
    }
    
    /* Show mobile nav */
    .lessonnav-mobile {
        display: flex;
        flex-direction: column;
        width: 100%;
        background: rgba(15, 23, 42, 1);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Mobile Primary Row */
    .lessonnav-mobile-primary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 12px;
    }
    
    .lessonnav-mobile-btn {
        width: 56px;
        height: 56px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        border: none;
        color: rgba(255, 255, 255, 0.6);
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
    }
    
    .lessonnav-mobile-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
    }
    
    .lessonnav-mobile-btn svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
    }
    
    .lessonnav-mobile-btn.is-prev {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.9);
    }
    
    .lessonnav-mobile-btn.is-next {
        background: #2563eb;
        color: #fff;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }
    
    .lessonnav-mobile-btn.is-next:hover {
        background: #3b82f6;
    }
    
    .lessonnav-mobile-btn.is-done {
        background: #2563eb;
        color: #fff;
    }
    
    .lessonnav-mobile-btn.is-disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }
    
    .lessonnav-mobile-btn.is-disabled:hover {
        background: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.6);
    }
    
    /* Mobile Secondary Row */
    .lessonnav-mobile-secondary {
        display: flex;
        align-items: center;
        justify-content: space-around;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding: 6px 8px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
    
    .lessonnav-mobile-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 12px;
        color: rgba(255, 255, 255, 0.3);
        text-decoration: none;
        transition: color 0.2s ease;
        position: relative;
    }
    
    .lessonnav-mobile-link:hover {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .lessonnav-mobile-link svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
    }
    
    .lessonnav-mobile-link span {
        font-size: 9px;
        font-weight: 500;
    }
    
    .lessonnav-mobile-badge {
        position: absolute;
        top: 2px;
        right: 8px;
        width: 6px;
        height: 6px;
        background: #3b82f6;
        border-radius: 9999px;
    }
}

/* ================================
   PRINT
   ================================ */

@media print {
    .lessonnav-wrap,
    .lessonnav,
    .lessonnav-success-box,
    .lessonnav-back-widget {
        display: none;
    }
}

/* ================================
   BACK TO LESSON WIDGET
   ================================ */

.lessonnav-back-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 320px;
    overflow: hidden;
}

.lessonnav-back-widget.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.lessonnav-back-widget-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.lessonnav-back-widget-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.lessonnav-back-widget-close svg {
    width: 14px;
    height: 14px;
}

.lessonnav-back-widget-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 44px 16px 16px;
    text-decoration: none;
    color: #fff;
    transition: background 0.2s ease;
}

.lessonnav-back-widget-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lessonnav-back-widget-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 8px;
    background: rgba(37, 99, 235, 0.2);
    border-radius: 10px;
    color: #60a5fa;
}

.lessonnav-back-widget-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lessonnav-back-widget-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.lessonnav-back-widget-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .lessonnav-back-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

/* ================================
   FLOATING SIDEBAR
   ================================ */

.lessonnav-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lessonnav-sidebar-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.lessonnav-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

.lessonnav-sidebar.is-active {
    right: 0;
}

.lessonnav-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.lessonnav-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lessonnav-sidebar-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lessonnav-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.lessonnav-sidebar-close svg {
    width: 20px;
    height: 20px;
}

.lessonnav-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.lessonnav-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

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

.lessonnav-sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Module Styling */
.lessonnav-module {
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.lessonnav-module.is-active {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.lessonnav-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lessonnav-module-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.lessonnav-module-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.lessonnav-module-num {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
}

.lessonnav-module-name {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lessonnav-module-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lessonnav-module-status-done {
    background: #22c55e;
}

.lessonnav-module-status-done svg {
    width: 12px;
    height: 12px;
    color: #fff;
}

.lessonnav-module-status-progress {
    background: rgba(59, 130, 246, 0.2);
    width: auto;
    min-width: 24px;
    padding: 0 8px;
    border-radius: 12px;
    height: 22px;
}

.lessonnav-module-count {
    font-size: 11px;
    font-weight: 600;
    color: #60a5fa;
}

.lessonnav-module-status-todo {
    border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Topics */
.lessonnav-topics {
    display: none;
    padding: 0 12px 12px 12px;
}

.lessonnav-module.is-open .lessonnav-topics {
    display: block;
}

.lessonnav-topic {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.lessonnav-topic:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lessonnav-topic.is-current {
    background: rgba(59, 130, 246, 0.15);
}

.lessonnav-topic-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
}

.lessonnav-topic-icon svg {
    width: 14px;
    height: 14px;
}

.lessonnav-topic-icon.is-intro {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.lessonnav-topic-icon.is-quiz {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.lessonnav-topic-title {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lessonnav-topic.is-current .lessonnav-topic-title {
    color: #fff;
}

.lessonnav-topic-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lessonnav-topic-check.is-done {
    background: #22c55e;
    border-color: #22c55e;
}

.lessonnav-topic-check svg {
    width: 10px;
    height: 10px;
    color: #fff;
}

/* Mobile sidebar */
@media (max-width: 480px) {
    .lessonnav-sidebar {
        width: 100%;
        max-width: 100%;
        right: -100%;
    }
}
