﻿/* ==============================================================================
   AMETIST IOT PLATFORM — api_menu.css
   API Documentation Sidebar & Toggle Navigation
   Cosmic Glassmorphism Theme (ametist-tech.ru Style)
   ============================================================================== */

/* ===== ОСНОВНЫЕ СТИЛИ ===== */
.api-navigation-wrapper {
    position: relative;
    z-index: 1000;
}

/* ===== КНОПКА ПЕРЕКЛЮЧЕНИЯ ===== */
.nav-toggle {
    position: fixed;
    top: 92px;
    left: 16px;
    z-index: 1001;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    padding: 12px 18px;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.45);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.nav-toggle:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.65);
    background: linear-gradient(135deg, #9333ea, #c084fc);
    color: #ffffff;
}

.nav-toggle.active {
    background: linear-gradient(135deg, #ef4444, #f87171);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.nav-toggle.active:hover {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.toggle-text {
    font-size: 0.88rem;
}

/* ===== БОКОВАЯ ПАНЕЛЬ ===== */
.api-sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    width: 320px;
    height: 100vh;
    background: rgba(14, 10, 36, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(124, 58, 237, 0.25);
    border-right: 1px solid rgba(124, 58, 237, 0.3);
    z-index: 1002;
    transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.api-sidebar.active {
    left: 0;
}

.api-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #7c3aed, #a855f7, #38bdf8);
}

/* Заголовок сайдбара */
.sidebar-header {
    background: rgba(124, 58, 237, 0.08);
    padding: 28px 22px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
    text-align: center;
    position: relative;
}

.close-nav {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 1.5rem;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.25s ease;
}

.close-nav:hover {
    background: rgba(124, 58, 237, 0.3);
    border-color: #a855f7;
    color: #ffffff;
    transform: rotate(90deg);
}

.sidebar-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.5));
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
}

.sidebar-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
}

/* Навигация */
.sidebar-nav {
    padding: 0;
}

.sidebar-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    transition: all 0.25s ease;
}

.nav-item:last-child {
    border-bottom: none;
}

.nav-item:hover {
    background: rgba(124, 58, 237, 0.08);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.25s ease;
    position: relative;
    gap: 12px;
}

.nav-link:hover {
    color: #c084fc;
    background: rgba(124, 58, 237, 0.12);
    padding-left: 24px;
}

.nav-icon {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-number {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
    border: 1px solid rgba(168, 85, 247, 0.4);
    transition: all 0.25s ease;
}

.nav-link:hover .nav-number {
    transform: scale(1.12);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.6);
}

.nav-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

/* Футер сайдбара */
.sidebar-footer {
    padding: 20px 22px;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
    position: sticky;
    bottom: 0;
    background: rgba(14, 10, 36, 0.98);
}

.progress-info {
    text-align: center;
}

.progress-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.08);
    height: 5px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #7c3aed, #a855f7, #34d399);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Активный пункт меню */
.nav-item.active {
    background: rgba(124, 58, 237, 0.18);
    border-left: 4px solid #a855f7;
}

.nav-item.active .nav-link {
    color: #ffffff;
    font-weight: 700;
}

.nav-item.active .nav-number {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 2px 12px rgba(52, 211, 153, 0.5);
    border-color: #34d399;
}

/* ===== ОВЕРЛЕЙ ===== */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 2, 12, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .api-sidebar {
        width: 290px;
        left: -290px;
    }
    
    .nav-toggle {
        top: 86px;
        left: 12px;
        padding: 9px 14px;
        font-size: 12px;
    }
    
    .sidebar-header {
        padding: 20px 15px;
    }
    
    .nav-link {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .nav-text {
        font-size: 0.85rem;
    }
    
    .nav-number {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .nav-icon {
        font-size: 1rem;
        width: 18px;
    }
}

/* Стили для скроллбара */
.api-sidebar::-webkit-scrollbar {
    width: 5px;
}

.api-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.api-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border-radius: 4px;
}
