/* Базовые переменные */
:root {
    --header-height: 48px;
    --header-padding: 0 20px;
    --icon-size: 24px;
}

/* Navigation header */
.nav-header {
    display: flex;
    align-items: center;
    padding: var(--header-padding);
    background-color: #242424;
    border-bottom: 1px solid #333;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Контейнер для навигационных кнопок */
.nav-buttons-container {
    display: flex;
    gap: 8px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

/* Кнопки навигации */
.nav-button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--br);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 36px;
}

.nav-button .button-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.nav-button .button-text {
    display: block;
}

.nav-button:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.nav-button.active {
    background-color: rgba(52, 152, 219, 0.2);
}

.nav-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 8px;
    height: 100%;
    flex-shrink: 0;
}

/* Иконки в шапке */
.nav-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-button {
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    border-radius: var(--br);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: var(----background-secondary);
}

.icon-button svg {
    width: var(--icon-size);
    height: var(--icon-size);
}

/* Стили для кнопок в шапке */
.nav-icons .icon-action-button {
    background-color: transparent !important;
    color: var(--text-color);
}

.nav-icons .icon-action-button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-1px);
}

/* Переключатель языка */
.language-switcher {
    position: relative;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background-color: #242424;
    border: 1px solid #333;
    border-radius: var(--br);
    padding: 4px 0;
    min-width: 150px;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lang-dropdown.active {
    display: block;
}

.lang-dropdown a {
    display: flex;
    padding: 8px 16px;
    color: #e0e0e0;
    text-decoration: none;
    transition: background-color 0.2s;
    align-items: center;
    gap: 5px;
}

.lang-dropdown a:hover {
    background-color: var(----background-secondary);
}

/* Стили для языкового переключателя */
.language-switcher .icon-action-button {
    background-color: transparent !important;
    color: var(--text-color);
}

.language-switcher .icon-action-button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Аккаунт */
.account-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background-color: #242424;
    border: 1px solid #333;
    border-radius: var(--br);
    min-width: 200px;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.account-dropdown.active {
    display: block;
}

.account-info {
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.account-name {
    font-weight: 500;
    color: #e0e0e0;
    font-size: 14px;
}

.account-id {
    color: #888;
    font-size: 12px;
    margin-top: 2px;
}

.account-divider {
    height: 1px;
    background-color: #333;
    margin: 4px 0;
}

.account-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #e0e0e0;
    text-decoration: none;
    gap: 12px;
    transition: background-color 0.2s;
}

.account-item:hover {
    background-color: var(----background-secondary);
}

.account-item svg {
    width: 16px;
    height: 16px;
    color: #888;
}

.account-item:hover svg {
    color: #e0e0e0;
}

.account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Стили для кнопки аккаунта */
#account-button {
    background-color: transparent !important;
    color: var(--text-color);
}

#account-button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Стили для кнопки настроек */
#settings-button {
    background-color: transparent !important;
    color: var(--text-color);
}

#settings-button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Кнопка сохранения */
.save-button {
    background-color: #2ecc71;
    color: white;
    padding: 8px 16px;
    border-radius: var(--br);
    transition: all 0.2s ease;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.save-button:hover {
    background-color: #27ae60;
}

.save-button .button-icon {
    width: 18px;
    height: 18px;
    display: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
}

.save-button .button-text {
    display: block;
    font-size: 14px;
    font-weight: 500;
}

/* Медиа-запросы */
@media (max-width: 640px) {
    .nav-header {
        padding: 0 12px;
        gap: 4px;
    }

    .nav-buttons-container {
        gap: 4px;
    }

    .nav-button,
    .save-button {
        padding: 8px;
        width: 36px;
        min-width: 36px;
        justify-content: center;
        aspect-ratio: 1;
    }

    .nav-button .button-text,
    .save-button .button-text {
        display: none;
    }

    .nav-button .button-icon,
    .save-button .button-icon {
        display: block;
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .nav-actions {
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .nav-header {
        padding: 0 8px;
    }
}

/* Утилиты */
.void {
    display: none;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    position: absolute;
    overflow: hidden;
    clip: rect(0 0 0 0);
    visibility: hidden;
}

/* Тултипы */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: var(--br);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

[data-tooltip]:hover::before {
    opacity: 1;
}

.lang-flag {
    width: 24px;
    height: 16px;
    flex-shrink: 0;
}

.lang-dropdown a:hover {
    background-color: var(--hover-color);
}

.lang-dropdown a.active {
    background-color: var(--primary-color);
    color: white;
}

.language-switcher:hover .lang-dropdown {
    display: block;
}

.icon-action-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}