/* Стили для навигации и кнопок */
nav {
    background-color: #6666ff;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}
nav a {
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 18px;
    white-space: nowrap;
}
nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.login-button, .logout-button {
    padding: 14px 16px;
    font-size: 18px;
}

.user-info {
    padding: 14px 16px;
    font-size: 18px;
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0;
    margin-left: 10px;
}

/* Кнопка бургер-меню */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    gap: 4px;
}

.hamburger {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 0;
    transition: all 0.3s ease;
}

.nav-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(4px, 5px);
}

.nav-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Контейнер ссылок */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-left,
.nav-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        align-self: flex-start;
        margin: 10px;
        background-color: rgba(255, 255, 255, 0.2);
        border: 2px solid white;
        border-radius: 0;
        width: 44px;
        height: 36px;
        padding: 8px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        transition: background-color 0.3s;
    }

    .nav-toggle:hover {
        background-color: rgba(255, 255, 255, 0.3);
    }

    .hamburger {
        height: 4px;
        background-color: white;
        border-radius: 0;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-left,
    .nav-right {
        display: block;
        width: 100%;
    }

    nav {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }
    nav a {
        display: block;
        padding: 12px 16px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        text-align: left;
        white-space: normal;
    }
    .login-button, .logout-button, .user-info {
        margin-left: 0;
        margin-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    .user-info {
        order: -1;
        background-color: rgba(255, 255, 255, 0.15);
        font-size: 14px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    nav a {
        font-size: 14px;
        padding: 10px 12px;
    }
    .login-button, .logout-button, .user-info {
        font-size: 14px;
        padding: 10px 12px;
    }
}