/* ============================================
   MOBILE SIDEBAR MENU - Современный дизайн
   ============================================ */

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
}

.menu-bar {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover .menu-bar {
    background: #0ea5e9;
}

.mobile-menu-btn.active .menu-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .menu-bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .menu-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Sidebar Container */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    pointer-events: none;
    transition: all 0.3s ease;
}

.mobile-sidebar.active {
    pointer-events: auto;
}

/* Overlay */
.mobile-sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar.active .mobile-sidebar-overlay {
    opacity: 1;
}

/* Sidebar Panel */
.mobile-sidebar-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-color);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-sidebar.active .mobile-sidebar-panel {
    transform: translateX(0);
}

/* Header */
.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.mobile-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.mobile-sidebar-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.mobile-sidebar-close:hover {
    background: var(--border-color);
    color: #0ea5e9;
}

.mobile-sidebar-close:active {
    transform: scale(0.95);
}

/* User Section */
.mobile-sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

.mobile-user-name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-user-email {
    font-size: 13px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation */
.mobile-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
}

.mobile-nav-item:hover {
    background: var(--border-color);
    color: #0ea5e9;
}

.mobile-nav-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.mobile-nav-item:hover .mobile-nav-icon {
    opacity: 1;
}

/* Expandable Groups */
.mobile-nav-group {
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-toggle {
    justify-content: space-between;
}

.mobile-nav-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav-arrow {
    transition: transform 0.3s ease;
    opacity: 0.5;
}

.mobile-nav-toggle.active .mobile-nav-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.mobile-nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--card-bg);
}

.mobile-nav-submenu.active {
    max-height: 400px;
}

.mobile-nav-subitem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px 12px 52px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mobile-nav-subitem:hover {
    background: var(--border-color);
    color: #0ea5e9;
}

.mobile-nav-icon-dot {
    font-size: 16px;
}

/* Bottom Section */
.mobile-sidebar-bottom {
    border-top: 1px solid var(--border-color);
    padding: 16px 20px 20px;
    background: var(--card-bg);
}

/* Controls */
.mobile-controls-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.mobile-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-control-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* Theme Toggle */
.mobile-theme-btn {
    display: flex;
    background: var(--border-color);
    border-radius: 12px;
    padding: 4px;
    border: none;
    cursor: pointer;
    position: relative;
}

.mobile-theme-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    outline: none;
    -webkit-tap-highlight-color: transparent;
    border: none;
    background: transparent;
    cursor: pointer;
}

.mobile-theme-option:focus {
    outline: none;
}

[data-theme="light"] .mobile-theme-option[data-theme-icon="light"],
[data-theme="dark"] .mobile-theme-option[data-theme-icon="dark"] {
    background: white;
    color: #0ea5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .mobile-theme-option[data-theme-icon="dark"] {
    background: #0ea5e9;
    color: white;
}

/* Language Buttons */
.mobile-language-btns {
    display: flex;
    gap: 8px;
}

.mobile-lang-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    background: transparent;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-lang-btn:hover {
    border-color: #0ea5e9;
    transform: scale(1.05);
}

.mobile-lang-btn:focus {
    outline: none;
}

.mobile-lang-btn.active {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
}

/* Auth Buttons */
.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.mobile-btn-primary {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
}

.mobile-btn-primary:hover {
    background: #0284c7;
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.mobile-btn-outline {
    background: transparent;
    color: var(--text-color);
    border-color: var(--border-color);
}

.mobile-btn-outline:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.05);
}

.mobile-btn:active {
    transform: scale(0.98);
}

/* Dark Theme Adjustments */
[data-theme="dark"] .mobile-sidebar-panel {
    background: #1a1f2e;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .mobile-sidebar-header {
    background: #242938;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .mobile-sidebar-bottom {
    background: #242938;
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .mobile-nav-group {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .mobile-nav-submenu {
    background: #1a1f2e;
}

[data-theme="dark"] .mobile-theme-btn {
    background: rgba(255, 255, 255, 0.05);
}

/* Responsive - Show on screens < 1280px (включая iPad Air) */
@media (max-width: 1279px) {
    .mobile-menu-btn {
        display: flex;
    }

    /* Hide desktop navigation */
    .main-nav {
        display: none;
    }

    /* Hide desktop user actions */
    .header-actions {
        display: none;
    }
}

/* Scrollbar Styling */
.mobile-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.mobile-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.mobile-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #0ea5e9;
}

/* Animation for menu items */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-sidebar.active .mobile-nav-item,
.mobile-sidebar.active .mobile-nav-group {
    animation: slideInRight 0.3s ease forwards;
}

.mobile-sidebar.active .mobile-nav-item:nth-child(1) { animation-delay: 0.05s; }
.mobile-sidebar.active .mobile-nav-item:nth-child(2) { animation-delay: 0.1s; }
.mobile-sidebar.active .mobile-nav-group:nth-child(3) { animation-delay: 0.15s; }
.mobile-sidebar.active .mobile-nav-item:nth-child(4) { animation-delay: 0.2s; }
.mobile-sidebar.active .mobile-nav-item:nth-child(5) { animation-delay: 0.25s; }
.mobile-sidebar.active .mobile-nav-item:nth-child(6) { animation-delay: 0.3s; }
