/**
 * Rise Theme - Lesson Sidebar Navigation
 * Matches Rise 360 sidebar styling with light theme and clean design
 */

:root {
    --sidebar-width: 300px;
    --sidebar-bg: #ffffff;
    --sidebar-text: #000000;
    --sidebar-text-secondary: #666666;
    --sidebar-accent: var(--color-theme, #ff631e);
    --sidebar-hover: #f5f5f5;
    --sidebar-active-bg: #fff5f0;
    --sidebar-border: #e0e0e0;
    --sidebar-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Layout container - sidebar + content */
.lesson-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar - Rise 360 light theme */
.lesson-sidebar {
    width: 100%;
    height: 100%;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: var(--sidebar-shadow);
    z-index: 100;
    flex-shrink: 0;
    border-right: 1px solid var(--sidebar-border);
}

/* Sidebar header with course title */
.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
}

.sidebar-course-title {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-family-head, Lato);
    color: var(--sidebar-text);
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.sidebar-course-title:hover {
    color: var(--sidebar-accent);
}

/* Close button (mobile) */
.sidebar-close-btn {
    display: none; /* Hidden on desktop */
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--sidebar-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.sidebar-close-btn:hover {
    color: var(--sidebar-accent);
}

/* Progress section - Rise 360 style */
.sidebar-progress {
    padding: 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
}

.progress-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sidebar-text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-percentage {
    font-weight: 700;
    color: var(--sidebar-accent);
    font-size: 1.2rem;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--sidebar-accent);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Lesson navigation menu - Rise 360 clean style */
.sidebar-nav {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

.sidebar-nav-title {
    padding: 1.5rem 1.5rem 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sidebar-text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Lesson list */
.lesson-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lesson-nav-item {
    border-bottom: 1px solid var(--sidebar-border);
}

.lesson-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: var(--sidebar-text);
    transition: background-color 0.2s ease;
    position: relative;
}

.lesson-nav-link:hover {
    background: var(--sidebar-hover);
}

.lesson-nav-link.active {
    background: var(--sidebar-active-bg);
    border-left: 4px solid var(--sidebar-accent);
    padding-left: calc(1.5rem - 4px);
}

.lesson-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--sidebar-accent);
}

/* Lesson checkbox - styled as circular progress indicator (Rise 360 style) */
.lesson-nav-checkbox {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    position: relative;
}

.lesson-nav-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lesson-nav-checkbox-custom {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    background: white;
    position: relative;
    transition: all 0.2s ease;
}

.lesson-nav-link:hover .lesson-nav-checkbox-custom {
    border-color: var(--sidebar-accent);
}

.lesson-nav-link.active .lesson-nav-checkbox-custom {
    border-color: var(--sidebar-accent);
    border-width: 2px;
}

/* Checked state - show checkmark */
.lesson-nav-checkbox input[type="checkbox"]:checked + .lesson-nav-checkbox-custom {
    background: var(--sidebar-accent);
    border-color: var(--sidebar-accent);
}

.lesson-nav-checkbox input[type="checkbox"]:checked + .lesson-nav-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Lesson info (number and title) */
.lesson-nav-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lesson-nav-number {
    font-size: 10px;
    font-weight: 700;
    color: var(--sidebar-text-secondary);
    font-family: var(--font-family-head, Lato);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lesson-nav-link.active .lesson-nav-number {
    color: var(--sidebar-accent);
}

.lesson-nav-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--sidebar-text);
    line-height: 20px;
    font-family: var(--font-family-head, Lato);
}

/* Progress indicator - Rise 360 style circular progress */
.lesson-progress {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    position: relative;
}

.lesson-progress--sidebar {
    width: 24px;
    height: 24px;
}

.progress-circle {
    width: 100%;
    height: 100%;
    display: block;
}

.progress-circle--sidebar {
    width: 24px;
    height: 24px;
}

.progress-circle__track {
    stroke: #e0e0e0;
    fill: transparent;
}

.progress-circle__runner {
    stroke: var(--sidebar-accent, #ff631e);
    fill: transparent;
    transition: stroke-dashoffset 0.4s ease;
}

/* Completed checkmark */
.progress-circle__pass {
    fill: var(--sidebar-accent, #ff631e);
}

/* Failed X mark */
.progress-circle__fail {
    fill: #dc3545;
}

/* Active lesson - brighter progress circle */
.lesson-nav-link.active .progress-circle__runner {
    stroke: var(--sidebar-accent, #ff631e);
    stroke-width: 2.5;
}

.lesson-nav-link.active .progress-circle__track {
    stroke: #d0d0d0;
}

/* Mobile sidebar toggle button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--sidebar-accent);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
}

/* Mobile backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .lesson-layout {
        position: relative;
    }

    .lesson-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 101;
    }

    .lesson-sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .sidebar-close-btn {
        display: block;
    }
}

/* Scrollbar styling for sidebar */
.lesson-sidebar::-webkit-scrollbar {
    width: 8px;
}

.lesson-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.lesson-sidebar::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

.lesson-sidebar::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* Smooth scrolling */
.lesson-sidebar {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.lesson-nav-link:focus {
    outline: 2px solid var(--sidebar-accent);
    outline-offset: -2px;
}

.sidebar-course-title:focus {
    outline: 2px solid var(--sidebar-accent);
    outline-offset: 2px;
}
