/* КОРНЕВЫЕ ПЕРЕМЕННЫЕ */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --accent-blue: #22d3ee;
    --accent-blue-rgb: 34, 211, 238;
    --accent-green: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    
    --container-width: 1320px;
    --form-max-width: 900px;
    --transition: 0.2s ease;
}

/* СВЕТЛАЯ ТЕМА */
[data-bs-theme="light"] {
    --bg-dark: #f1f5f9;
    --bg-card: #ffffff;
    --accent-blue: #0891b2;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #e2e8f0;
}

/* БАЗОВЫЕ СТИЛИ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    transition: color var(--transition);
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition);
}

.knowledge-base-title, .breadcrumb-item, .section-header {
    color: var(--text-main) !important;
}

.text-muted, .small-text {
    color: var(--text-muted) !important;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable; 
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
    transition: background-color var(--transition), color var(--transition);
}

/* ШАПКА САЙТА */
.main-header {
    height: 80px;
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;   
    align-items: center;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
    position: relative;                                         
}

.logo {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.logo a {
    color: var(--accent-blue);
    font-size: 22px;
    font-weight: 800;
}

/* ЦЕНТРАЛЬНАЯ НАВИГАЦИЯ */
.main-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    flex: 0 0 auto;
    z-index: 10;                      
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 35px;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 500;
    padding: 8px 0;                   
}

.main-nav a:hover { color: var(--accent-blue); }

/* БЛОК ПРОФИЛЯ */
.user-profile {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    position: relative;
    height: 80px;
    align-items: center;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
    height: 80px;
    transition: background var(--transition);
    cursor: pointer;
}

.profile-trigger:hover { background: var(--border-color); }

.username-text { color: var(--text-main); font-weight: 500; }

.avatar-placeholder, .avatar-large {
    background-color: #3b82f6;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder { width: 48px; height: 48px; }
.avatar-large { width: 64px; height: 64px; margin: 0 auto 10px; }


/* ВЫПАДАЮЩЕЕ МЕНЮ */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 80px;
    right: 0;
    width: 240px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1001;
}

.profile-trigger:hover + .dropdown-menu,
.dropdown-menu:hover { display: block; }

.dropdown-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-user-name {
    color: var(--text-main) !important; 
    font-size: 1.1rem;           
    font-weight: 600;            
    margin-top: 10px;            
    margin-bottom: 0;
}

.dropdown-list {
    list-style: none;
    padding: 5px 0;
    margin: 0;
}

.dropdown-list li a,
.dropdown-list li button {
    width: 100%;
    padding: 12px 20px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-list li a:hover,
.dropdown-list li button:hover {
    background: var(--border-color);
    color: var(--accent-blue);
}

.logout-link { color: #ef4444 !important; }

/* ОБЛАСТЬ КОНТЕНТА */
.content-wrapper { padding: 40px 0; flex-grow: 1; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* КАРТОЧКИ МОДУЛЕЙ */
.module-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition);
    margin-bottom: 15px;
}

a.module-item:hover {
    border-color: var(--accent-blue);
    background-color: var(--border-color);
    transform: translateX(8px);
}

.module-item.completed-highlight {
    border-color: var(--accent-green) !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
}

.module-item-left, .module-item-right { display: flex; align-items: center; }

.module-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-muted);
    margin-right: 25px;
    min-width: 40px;
    opacity: 0.5;
}

.module-title { font-weight: 600; font-size: 1.15rem; color: var(--text-main); margin: 0; }

/* БЛОКИ КНОПОК */
.btn-primary {
    background: #0891b2;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    color: #ffffff !important;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary:hover {
    background: var(--accent-blue);
    color: #ffffff !important;
}

/* ФОРМЫ ВВОДА */
input[type="text"], input[type="password"], input[type="email"], select, textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    outline: none;
    transition: border-color var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-blue);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    color: var(--text-main);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
}

/* ПЕРЕКЛЮЧАТЕЛИ ТЕМ */
.theme-selection { display: flex; gap: 15px; margin-top: 20px; }

.theme-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.3s;
}

/* Вот этот кусочек мы добавили, чтобы лучи солнца не обрезались */
.theme-btn svg {
	width: 22px !important;    
    	height: 22px !important;
    	padding: 2px;
    	overflow: visible !important;
}

.theme-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }

.theme-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #0f172a;
}

/* ФУТЕР БЛОКИ */
.main-footer {
    background-color: var(--bg-card);
    padding: 40px 0;
    margin-top: auto;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer-link {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-link:hover {
    color: var(--accent-blue);
}

/* КАРТОЧКИ ПРЕИМУЩЕСТВ */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 280px;
    transition: all var(--transition);
    color: var(--text-main);
}

.feature-card i, .feature-card span:first-child {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--accent-blue);
}

.feature-card h3 { margin-bottom: 10px; font-weight: 700; }
.feature-card p { margin-bottom: 20px; color: var(--text-muted); }

/* ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--bg-card);
    color: var(--accent-blue);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.show { opacity: 1; visibility: visible; }

.border-dashed {
    border-style: dashed !important;
    border-color: var(--border-color) !important;
}

.accent-text {
    color: var(--accent-blue);
}

/* МОБИЛЬНАЯ АДАПТАЦИЯ */
.mobile-nav-item {
    display: none; 
}
.desktop-only-btn {
    display: block; 
}
.mobile-only-btn {
    display: none; 
}

@media (max-width: 768px) {
    .main-nav {
        display: none; 
    }
    
    .mobile-nav-item {
        display: block; 
    }
    
    .desktop-only-btn {
        display: none; 
    }
    
    .mobile-only-btn {
        display: flex; 
        align-items: center;
        color: var(--text-main);
        height: 100%;
        padding: 0 15px;
    }
}