/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0c12;
    color: #e4e4e7;
    line-height: 1.6;
}

/* ========== WIKI LAYOUT (Sidebar + Content) ========== */
.wiki-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 280px;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(4px);
    border-right: 1px solid rgba(255, 215, 0, 0.2);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    text-align: center;
}

.sidebar-logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffd700;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.sidebar-version {
    font-size: 0.8rem;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
    padding: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 1.5rem;
    color: #ccc;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border-left-color: #ffd700;
}

.sidebar-nav a.active {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border-left-color: #ffd700;
}

.sidebar-footer {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
    color: #666;
}

/* --- Main Content --- */
.wiki-content {
    flex: 1;
    padding: 2rem;
    background: linear-gradient(135deg, #0f111a 0%, #13151f 100%);
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3 {
    color: #ffd700;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    margin: 1.5rem 0 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.3rem;
    margin: 1rem 0 0.5rem;
}

/* ========== HERO on main page ========== */
.hero {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 1.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
}
.btn-primary {
    background: #ffd700;
    color: #1a1a2e;
}
.btn-primary:hover {
    background: #ffed4a;
    transform: translateY(-2px);
}
.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #ffd700;
    border: 1px solid #ffd700;
}
.btn-secondary:hover {
    background: rgba(255,215,0,0.2);
    transform: translateY(-2px);
}

/* ========== CARDS & GRID ========== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 16px;
    transition: 0.3s;
    border: 1px solid rgba(255,215,0,0.2);
}
.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.1);
}
.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.feature-card h3 {
    color: #ffd700;
    margin-bottom: 0.5rem;
}
.feature-card ul {
    margin-left: 1.2rem;
    color: #ccc;
}

/* ========== TABLES (с горизонтальной прокруткой на мобильных) ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    overflow: hidden;
}
.data-table th {
    background: #ffd700;
    color: #1a1a2e;
    padding: 0.8rem;
    text-align: left;
    font-weight: bold;
}
.data-table td {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.data-table tr:hover {
    background: rgba(255,215,0,0.1);
}
.command-name, .perm-name, .flag-name {
    font-family: monospace;
    color: #ffd700;
    font-weight: bold;
}
.flag-desc {
    color: #aaa;
    font-size: 0.9rem;
}

/* ========== CODE BLOCKS ========== */
.code-block {
    background: #0a0c15;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #ffd700;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.copy-btn {
    background: #ffd700;
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    transition: 0.2s;
}
.copy-btn:hover {
    background: #ffed4a;
    transform: scale(1.02);
}

/* ========== SECTION CARD ========== */
.section-card {
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.section-card h2 {
    margin-top: 0;
}
.tip {
    background: rgba(255,215,0,0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    color: #ffd700;
}

/* ========== PAGE HEADER ========== */
.page-header {
    margin-bottom: 2rem;
}
.page-header h1 {
    margin-bottom: 0.2rem;
}
.page-header p {
    color: #aaa;
}

/* ========== FOOTER (inside content) ========== */
.wiki-footer {
    text-align: center;
    padding: 2rem 0 1rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,215,0,0.2);
    color: #666;
}

/* ========== МОБИЛЬНАЯ И ПЛАНШЕТНАЯ АДАПТАЦИЯ ========== */
@media (max-width: 768px) {
    .wiki-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid rgba(255,215,0,0.2);
    }
    .sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    .sidebar-nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        border-left: none;
        background: rgba(255,215,0,0.1);
        border-radius: 20px;
        gap: 6px;
    }
    .sidebar-nav a.active {
        background: #ffd700;
        color: #1a1a2e;
    }
    .sidebar-header {
        padding: 0.8rem;
    }
    .sidebar-logo {
        font-size: 1.3rem;
    }
    .wiki-content {
        max-width: 100%;
        padding: 1rem;
    }
    .page-header h1 {
        font-size: 1.6rem;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    .feature-card {
        padding: 1rem;
    }
    .section-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    .code-block {
        font-size: 0.7rem;
        padding: 0.6rem;
    }
    .copy-btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    /* Таблицы - горизонтальная прокрутка */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .data-table td,
    .data-table th {
        padding: 0.5rem 0.6rem;
        font-size: 0.7rem;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .wiki-content {
        padding: 1.5rem;
    }
    .sidebar {
        width: 240px;
    }
    .data-table {
        font-size: 0.85rem;
    }
    .data-table td,
    .data-table th {
        padding: 0.6rem;
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a1a2e;
}
::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 4px;
}

/* ========== TEXT SELECTION (allow only in code/tables) ========== */
body {
    user-select: none;
    -webkit-user-select: none;
}
.code-block, .code-block *,
.data-table, .data-table *,
.command-name, .perm-name, .flag-name {
    user-select: text;
    -webkit-user-select: text;
}
/* ========== СВОРАЧИВАЕМАЯ ЛЕВАЯ ПАНЕЛЬ ДЛЯ ПК ========== */
@media (min-width: 769px) {
    .sidebar {
        width: 65px;
        transition: width 0.3s ease;
        overflow-x: hidden;
        white-space: nowrap;
    }
    /* Сайдбар расширяется при наведении на САМ САЙДБАР, а не на весь экран */
    .sidebar:hover {
        width: 260px;
    }
    
    /* Основной контент */
    .wiki-content {
        padding: 2rem;
        max-width: none;
    }
    
    /* СКРЫВАЕМ ТЕКСТ (буквы), оставляем ТОЛЬКО иконки */
    .sidebar-nav a span {
        display: none !important;  /* Полностью скрываем текст */
    }
    
    /* При наведении показываем текст */
    .sidebar:hover .sidebar-nav a span {
        display: inline-block !important;
        margin-left: 8px;
    }
    
    /* Иконка остаётся всегда видимой */
    .sidebar-nav a {
        display: flex;
        align-items: center;
        gap: 0;  /* Убираем отступ, так как текст скрыт */
        padding: 0.7rem 1rem;
        justify-content: flex-start;
    }
    
    /* При наведении добавляем отступ для текста */
    .sidebar:hover .sidebar-nav a {
        gap: 12px;
    }
    
    /* Логотип тоже должен сворачиваться */
    .sidebar-logo {
        font-size: 1.8rem;
        display: block;
        text-align: center;
    }
    
    /* При наведении показываем полный логотип */
    .sidebar:hover .sidebar-logo {
        font-size: 1.3rem;
        text-align: left;
    }
    
    /* Версия скрыта */
    .sidebar-version {
        display: none;
    }
    .sidebar:hover .sidebar-version {
        display: inline-block;
    }
    
    /* Футер скрыт */
    .sidebar-footer p {
        display: none;
    }
    .sidebar:hover .sidebar-footer p {
        display: block;
    }
}
/* ========== ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА ========== */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}
.lang-btn {
    background: rgba(10,14,23,0.95);
    border: 1px solid rgba(255,215,0,0.5);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.lang-btn:hover {
    background: rgba(255,215,0,0.2);
    transform: scale(1.05);
}
.lang-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    background: rgba(10,14,23,0.98);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 140px;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: none;
}
.language-switcher:hover .lang-dropdown {
    display: flex;
}
/* Создаём невидимый мост между кнопкой и меню */
.language-switcher::after {
    content: '';
    position: absolute;
    top: 48px;
    right: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}
.lang-dropdown a {
    padding: 10px 20px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}
.lang-dropdown a:hover {
    background: rgba(255,215,0,0.15);
    color: #ffd700;
}
.lang-dropdown a.active-lang {
    background: rgba(255,215,0,0.25);
    color: #ffd700;
    font-weight: bold;
}

@media (max-width: 768px) {
    .language-switcher {
        top: 10px;
        right: 10px;
    }
    .lang-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .lang-dropdown {
        top: 48px;
        min-width: 120px;
    }
    .lang-dropdown a {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    .language-switcher::after {
        top: 40px;
        height: 12px;
    }
}