.nav-menu-container {
    flex: 1;
    min-height: 0;
    height: auto;
    padding: 20px 15px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
}

html.layout-sidebar-lock .nav-menu-container,
body.layout-sidebar-lock .nav-menu-container {
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    padding: 0 20px;
    margin: 20px 0 10px 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link-locked {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link-locked-action {
    cursor: pointer;
    pointer-events: auto;
    text-decoration: none;
}

.nav-link-locked::before {
    background: transparent;
}

.nav-link-locked .nav-icon i {
    color: rgba(255, 255, 255, 0.65);
    filter: none;
}

.nav-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.nav-link-custom::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-500);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-link-custom:hover {
    background: rgba(46, 139, 131, 0.18);
    color: white;
    transform: translateX(3px);
}

.nav-link-custom.active {
    background: rgba(46, 139, 131, 0.28);
    color: white;
}

.nav-link-custom.active::before {
    transform: scaleY(1);
}

.nav-icon {
    font-size: 1.2rem;
    width: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.nav-icon i {
    transition: color 0.2s ease, filter 0.2s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

/* Colorful icons */
.nav-icon .bi-house-door-fill,
.nav-icon .bi-house-door {
    color: #42c5d9;
}

.nav-icon .bi-book-fill {
    color: #ffd166;
}

.nav-icon .bi-pencil-square {
    color: #ff8fa3;
}

.nav-icon .bi-mortarboard-fill {
    color: #9b8cfe;
}

.nav-icon .bi-journal-check {
    color: #56d4c9;
}

.nav-icon .bi-lightning-charge-fill {
    color: #ffb347;
}

.nav-icon .bi-graph-up,
.nav-icon .bi-graph-up-arrow {
    color: #4fd1a5;
}

.nav-icon .bi-translate {
    color: #7dd3fc;
}

.nav-icon .bi-text-paragraph {
    color: #a5b4fc;
}

.nav-icon .bi-play-btn-fill {
    color: #fda4af;
}

.nav-icon .bi-folder-fill {
    color: #f9c74f;
}

.nav-icon .bi-speedometer2 {
    color: #60a5fa;
}

.nav-icon .bi-file-earmark-plus,
.nav-icon .bi-file-earmark-text {
    color: #f59e0b;
}

.nav-icon .bi-question-circle,
.nav-icon .bi-info-circle {
    color: #38bdf8;
}

.nav-icon .bi-people,
.nav-icon .bi-people-fill {
    color: #22c55e;
}

.nav-icon .bi-clipboard-data {
    color: #34d399;
}

.nav-icon .bi-file-bar-graph {
    color: #a3e635;
}

.nav-icon .bi-shield-lock {
    color: #f87171;
}

.nav-icon .bi-gear-fill,
.nav-icon .bi-gear {
    color: #f97316;
}

.nav-icon .bi-journal-code {
    color: #c084fc;
}

.nav-icon .bi-box-arrow-in-right {
    color: #fb7185;
}

.nav-icon .bi-person-plus {
    color: #f472b6;
}

.nav-icon .bi-envelope {
    color: #93c5fd;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-section--student .nav-link-custom,
.nav-section--student .nav-button {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 12px;
    row-gap: 6px;
}

.nav-section--student .nav-link-locked-action {
    grid-template-columns: 35px minmax(0, 1fr);
}

.nav-section--student .nav-icon,
.nav-section--student .nav-button .nav-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin-right: 0;
}

.nav-section--student .nav-text {
    grid-column: 2;
    min-width: 0;
    align-self: center;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
    word-break: break-word;
}

.nav-section--student .expand-icon,
.nav-section--student .nav-badge {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin-left: 0;
    align-self: center;
    justify-self: end;
}

.nav-section--student .nav-lock-badge {
    grid-column: 2 / -1;
    grid-row: 2;
    margin-left: 0;
    justify-self: start;
    max-width: 100%;
    flex-wrap: wrap;
    line-height: 1.25;
}

.nav-section--student .nav-submenu-item {
    white-space: normal;
    line-height: 1.35;
    word-break: break-word;
}

.nav-badge {
    background: var(--accent-500);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.nav-badge.success {
    background: var(--success);
}

.nav-badge.warning {
    background: var(--warning);
}

.nav-badge.danger {
    background: var(--danger);
}

.nav-submenu {
    margin-top: 5px;
    margin-left: 47px;
    display: none;
}

.nav-submenu.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-submenu-item {
    padding: 8px 15px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 3px;
}

.nav-submenu-item:hover {
    background: rgba(46, 139, 131, 0.18);
    color: white;
    transform: translateX(3px);
}

.nav-submenu-item.active {
    color: white;
    background: rgba(46, 139, 131, 0.28);
}

.nav-submenu-section {
    margin-bottom: 8px;
}

.nav-submenu-label {
    padding: 6px 15px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
}

.nav-submenu-item--child {
    padding-left: 26px;
    font-size: 0.85rem;
}

.expand-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 20px;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

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

.user-role {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s;
    border-radius: 5px;
}

.btn-logout:hover {
    background: rgba(220, 38, 38, 0.12);
    transform: scale(1.1);
}

.progress-tracker {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
}

.progress-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-bar-container {
    background: rgba(0, 0, 0, 0.2);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-600) 0%, var(--primary-500) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

/* Scrollbar styling */
.nav-menu-container::-webkit-scrollbar {
    width: 6px;
}

.nav-menu-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.nav-menu-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.nav-menu-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    /* giống padding của .nav-link-custom */
    color: rgba(255, 255, 255, 0.85);
    background: none;
    /* remove default button bg */
    border: none;
    /* remove default button border */
    border-radius: 12px;
    /* giống a tag */
    font-weight: 500;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nav-button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-500);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-button:hover {
    background: rgba(46, 139, 131, 0.18);
    color: white;
    transform: translateX(3px);
}

.nav-button.active::before,
.nav-button.active {
    background: rgba(46, 139, 131, 0.28);
    color: white;
}

.nav-button .nav-icon {
    font-size: 1.2rem;
    width: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.nav-button .expand-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.nav-button .expand-icon.expanded {
    transform: rotate(90deg);
}

/* Teacher menu specific */
.teacher-menu .nav-icon {
    color: var(--primary-500);
}

/* Admin menu specific */
.admin-menu .nav-icon {
    color: var(--danger);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nav-link-custom,
    .nav-button,
    .nav-submenu-item,
    .nav-badge,
    .expand-icon {
        transition: none;
        animation: none;
    }

    .nav-submenu.show {
        animation: none;
    }
}
