/* Navigation Sidebar Styles */

.nav-header {
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.nav-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.nav-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Nav Menu */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Navigation Icons */
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    width: 1rem;
    height: 1rem;
    color: var(--text-light);
    flex-shrink: 0;
}

/* Nav Item Base */
.nav-item {
    position: relative;
}

.nav-item > a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    line-height: 1.4;
    position: relative;
}

.nav-item > a:hover {
    background-color: var(--bg-light);
    transform: translateX(2px); /* Леко преместване надясно при hover */
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05);
}

.nav-item > a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Welcome Item - Special Case */
.nav-item.welcome-item > a {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    background-color: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--secondary-color);
    color: var(--primary-color);
}

.nav-item.welcome-item > a:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

/* Module Items - Level 0 (Main Directories) */
.nav-item.module-item > a {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.875rem 1rem;
    background-color: rgba(0, 0, 0, 0.02);
    border-left: 3px solid var(--accent-color);
    color: var(--primary-color);
}

.nav-item.module-item.expanded > a {
    background-color: rgba(0, 0, 0, 0.04);
    border-left-color: var(--secondary-color);
}

.nav-item.module-item.expanded > a .nav-icon {
    transform: rotate(90deg);
}

.nav-item.module-item > a:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

/* Section Items - Level 1 (Subdirectories) */
.nav-item.section-item > a {
    font-weight: 500;
    padding-left: 1.75rem;
    font-size: 0.9rem;
    color: var(--text-color);
    border-left: 2px solid transparent;
    margin-left: 0.5rem;
}

.nav-item.section-item.expanded > a {
    background-color: rgba(0, 0, 0, 0.02);
    border-left-color: var(--secondary-color);
}

.nav-item.section-item.expanded > a .nav-icon {
    transform: rotate(90deg);
}

.nav-item.section-item > a:hover {
    background-color: rgba(0, 0, 0, 0.03);
    border-left-color: var(--text-light);
}

/* Section Topic Items - Level 1 (Direct Topics without children) */
.nav-item.section-topic-item > a {
    padding-left: 1.75rem;
    font-size: 0.9rem;
    color: var(--text-color);
    border-left: 2px solid transparent;
    margin-left: 0.5rem;
}

.nav-item.section-topic-item > a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

/* Topic Items - Level 2 (Subtopics/Files) */
.nav-item.topic-item > a {
    padding-left: 2.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    border-left: 1px solid transparent;
    margin-left: 1rem;
}

.nav-item.topic-item > a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    border-left-width: 2px;
    padding-left: calc(2.5rem - 1px); /* Компенсираме увеличената border */
    font-weight: 500;
}

/* Готови теми - по-тъмен цвят и по-удебелен шрифт */
/* Премахнато - темите няма да са bold докато не бъдат маркирани като готови */
.nav-item.topic-item.completed > a,
.nav-item.section-topic-item.completed > a {
    color: #1f2937 !important; /* Тъмно сиво/черно */
    font-weight: 400 !important; /* Нормален font-weight */
    opacity: 1 !important;
}

.nav-item.topic-item.completed > a:hover,
.nav-item.section-topic-item.completed > a:hover {
    color: var(--primary-color) !important;
    font-weight: 500 !important; /* По-лек при hover */
    background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Неготови теми - блед цвят */
.nav-item.topic-item.pending > a,
.nav-item.section-topic-item.pending > a {
    color: #9ca3af !important; /* Светло сиво */
    opacity: 0.5 !important;
    font-weight: 400 !important;
}

.nav-item.topic-item.pending > a:hover,
.nav-item.section-topic-item.pending > a:hover {
    color: #6b7280 !important;
    opacity: 0.7 !important;
}

/* Активна готова тема - още по-тъмен цвят */
.nav-item.topic-item.completed.active > a,
.nav-item.section-topic-item.completed.active > a {
    color: white !important;
    font-weight: 500 !important; /* По-лек font-weight */
    background-color: var(--primary-color) !important;
}

/* Активна неготова тема - остава блед */
.nav-item.topic-item.pending.active > a,
.nav-item.section-topic-item.pending.active > a {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500 !important;
    background-color: var(--primary-color) !important;
}

/* Active Item */
.nav-item.active > a {
    background-color: var(--primary-color);
    color: white;
    border-left-color: var(--accent-color);
}

.nav-item.active > a .nav-icon {
    color: white;
}

/* Submenus */
.nav-submenu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.01);
}

.nav-item.expanded > .nav-submenu {
    display: block;
}

/* Nested submenus have slightly darker background */
.nav-submenu .nav-submenu {
    background-color: rgba(0, 0, 0, 0.02);
}

/* ===== RESPONSIVE STYLES ===== */

@media (max-width: 992px) {
    .nav-close-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .nav-header {
        padding: 0.75rem 1rem;
    }
    
    .nav-header h2 {
        font-size: 1.05rem;
    }
    
    .nav-item.welcome-item > a,
    .nav-item.module-item > a {
        font-size: 0.95rem;
        padding: 0.75rem 0.875rem;
    }
    
    .nav-item.section-item > a,
    .nav-item.section-topic-item > a {
        font-size: 0.875rem;
        padding-left: 1.5rem;
    }
    
    .nav-item.topic-item > a {
        font-size: 0.825rem;
        padding-left: 2.25rem;
    }
}

@media (max-width: 480px) {
    .nav-header {
        padding: 0.6rem 0.75rem;
    }
    
    .nav-header h2 {
        font-size: 1rem;
    }
    
    .nav-item.welcome-item > a,
    .nav-item.module-item > a {
        font-size: 0.9rem;
        padding: 0.7rem 0.75rem;
    }
    
    .nav-item.section-item > a,
    .nav-item.section-topic-item > a {
        font-size: 0.85rem;
        padding-left: 1.25rem;
    }
    
    .nav-item.topic-item > a {
        font-size: 0.8rem;
        padding-left: 1.75rem;
    }
}
