/* =============================================
   header.css — стили для хедера MGLA
   Подключить: <link rel="stylesheet" href="{{ url_for('static', filename='css/header.css') }}">
   ============================================= */

/* ---------- Базовый хедер ---------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100000;
    padding: 18px 0;
    position: relative;
}

/* ---------- Левая зона ---------- */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* ---------- Бургер ---------- */
.burger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.burger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.burger-btn img {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1); /* чёрная SVG → белая */
}

/* ---------- Лого ---------- */
header .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

header .logo img {
    height: 48px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: all 0.4s ease;
}

header .logo:hover img {
    transform: scale(1.1) rotate(-3deg);
    filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

/* ---------- Центральная навигация (десктоп) ---------- */
.header-center {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-center .nav-link {
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.header-center .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ---------- Правая зона (авторизация) ---------- */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-right .auth-btn {
    background: #2C2C2C;
    color: #fff;
    text-decoration: none;
    padding: 9px 17px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.5s ease;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.header-right .auth-btn:hover {
    background: #5a5a5a;
}

/* ---------- Профиль (правый блок) ---------- */
.profile-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.profile-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.profile-details {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.profile-level,
.profile-class {
    font-weight: 500;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.logout-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* ---------- Бургер-дропдаун ---------- */
.burger-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(20, 20, 20, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 200px;
    padding: 8px 0;
    z-index: 200000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
}

.burger-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.burger-dropdown a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.burger-dropdown a:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- Обёртка с позиционированием для дропдауна ---------- */
.burger-wrapper {
    position: relative;
}

/* =============================================
   МОБИЛЬНЫЕ (≤ 768px)
   ============================================= */
@media (max-width: 768px) {

    header {
        padding: 12px 0;
    }

    /* Центральная навигация — скрыта на мобильных */
    .header-center {
        display: none;
    }

    /* Логотип по центру */
    .header-mobile-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    header .logo img {
        height: 38px;
    }

    /* Профиль — убираем текстовую часть на маленьких экранах */
    .profile-info {
        display: none;
    }

    .profile-link {
        padding: 6px 8px;
    }

    .profile-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .logout-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .header-right .auth-btn {
        padding: 7px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-right .auth-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* =============================================
   ДЕСКТОП (> 768px)
   ============================================= */
@media (min-width: 769px) {
    /* На десктопе мобильный класс центрирования не нужен */
    .header-mobile-logo {
        position: static;
        transform: none;
    }
}
