/* ============================================================================
   LEFT SIDEBAR - Wikipedia Dark Mode Theme (Collapsible)
   ============================================================================ */

/* Hamburger toggle button */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 32px;
    height: 32px;
    background: #202122;
    border: 1px solid #3a3b3c;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle:hover {
    background: #2a2b2c;
    border-color: #4a4b4c;
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #eaecf0;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Анимация гамбургера при открытом меню - крестик */
.sidebar-expanded .sidebar-toggle {
    gap: 0;
}

.sidebar-expanded .sidebar-toggle .hamburger-line:nth-child(1) {
    transform: translateY(2px) rotate(45deg);
}

.sidebar-expanded .sidebar-toggle .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.sidebar-expanded .sidebar-toggle .hamburger-line:nth-child(3) {
    transform: translateY(-2px) rotate(-45deg);
}

/* Left sidebar */
.left-sidebar {
    background: #27292a;
    border-right: 1px solid #3a3b3c;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.2);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-280px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

/* Expanded state */
.sidebar-expanded .left-sidebar {
    transform: translateX(0);
}

/* Adjust toggle button position when sidebar is expanded */
.sidebar-expanded .sidebar-toggle {
    left: 284px; /* 280px sidebar width + 4px margin */
}

/* Header with logo - centered */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #3a3b3c;
    background: #202122;
    text-align: center;
}

.logo {
    font-family: 'New Rocker', cursive;
    font-size: 1.8rem;
    color: #eaecf0;
    margin-bottom: 5px;
    text-shadow: 0 0 8px rgba(234, 236, 240, 0.15);
}

.version {
    font-size: 0.85rem;
    color: #a2a9b1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Tools menu */
.tools-menu {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.menu-section {
    margin-bottom: 24px;
}

.menu-section h3 {
    font-size: 0.75rem;
    color: #a2a9b1;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Universal menu button - Wikipedia style */
.menu-btn {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    color: #eaecf0;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    margin-bottom: 2px;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.15s ease;
}

.menu-btn:hover {
    background: #2a2b2c;
    color: #ffffff;
}

.menu-btn:hover::before {
    background: #3366cc;
}

.menu-btn:active {
    background: #323334;
}

/* Bottom section */
.menu-bottom {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #3a3b3c;
}

.menu-bottom .menu-section {
    margin-bottom: 10px;
}

/* Scrollbar for left panel */
.left-sidebar::-webkit-scrollbar {
    width: 10px;
}

.left-sidebar::-webkit-scrollbar-track {
    background: #27292a;
}

.left-sidebar::-webkit-scrollbar-thumb {
    background: #3a3b3c;
    border-radius: 5px;
    border: 2px solid #27292a;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
    background: #4a4b4c;
}