/* assets/css/navbar.css */

/* --- ОСНОВНОЙ КОНТЕЙНЕР --- */
.navbar {
    height: 70px;
    width: 100%;

    /* ЛОГИКА ПРИЛИПАНИЯ */
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    z-index: 1000;

    /* ВИЗУАЛ */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);

    /* РАСПОЛОЖЕНИЕ */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-sizing: border-box;
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* ТЕМНАЯ ТЕМА */
[data-theme="dark"] .navbar {
    background: rgba(11, 15, 25, 0.85); /* Полупрозрачный темный */
}

/* --- МЕНЮ (ДЕСКТОП) --- */
.navbar-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* --- ГАМБУРГЕР (КНОПКА) --- */
.navbar-toggle {
    display: none; /* Скрыт на ПК */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1003;
}

.navbar-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Анимация крестика */
.navbar-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.navbar-toggle.active span:nth-child(2) { opacity: 0; }
.navbar-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* --- КНОПКА ТЕМЫ --- */
.theme-toggle-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--border); background: transparent;
    cursor: pointer; position: relative; overflow: hidden;
    transition: all 0.3s ease; padding: 0;
    color: var(--text-main);
}
.theme-toggle-btn:hover {
    background: var(--bg-input); border-color: var(--primary);
}
.theme-icon {
    width: 20px; height: 20px; position: absolute;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* --- АДАПТИВНОСТЬ (МОБИЛЬНЫЕ) --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0 15px;
    }

    .navbar-toggle {
        display: flex;
    }

    /* Выпадающее меню */
    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%; /* Прилипает к низу шапки */
        left: 0;
        width: 100%;
        flex-direction: column;

        /* Сплошной фон, чтобы не просвечивало */
        background-color: var(--bg-body);

        padding: 20px;
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        border-bottom: 1px solid var(--border);
        z-index: 1002;
        box-sizing: border-box;
        text-align: center;
    }

    .navbar-menu.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    .nav-divider-vertical {
        width: 100% !important;
        height: 1px !important;
        margin: 10px 0 !important;
    }

    .navbar-menu .nav-link,
    .navbar-menu .btn {
        width: 100%;
        justify-content: center;
    }

    #navbarThemeSwitch {
        margin: 10px auto 0;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}