/* ============================================================
   HEADER — Modern light design + responsive
   ============================================================ */

header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(44,95,191,0.08);
    height: var(--header-h);
}

.navbar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ---- Logo ---- */
.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--blue-dark);
    letter-spacing: -0.5px;
    transition: opacity 0.2s;
}
.logo a:hover { opacity: 0.85; }

.role-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    vertical-align: middle;
}
.role-badge.admin   { background: #fef3c7; color: #b45309; }
.role-badge.teacher { background: #e0f2fe; color: #0369a1; }
.role-badge.student { background: var(--accent-soft); color: var(--accent); }

/* ---- Nav links ---- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    flex: 1;
    justify-content: center;
}

/* ---- Header Search ---- */
.header-search {
    margin-right: 15px;
}

.header-search form {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 6px 14px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.header-search form:focus-within {
    background: #ffffff;
    border-color: rgba(91, 162, 207, 0.4);
    box-shadow: 0 0 0 3px rgba(91, 162, 207, 0.1);
}

.header-search span {
    font-size: 18px;
    color: #94a3b8;
    margin-right: 6px;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-primary);
    width: 250px;
    transition: width 0.3s ease;
}

.header-search input::placeholder {
    color: #94a3b8;
}

.nav-links li a {
    display: block;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
    position: relative;
}
.nav-links li a:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

/* ---- Account ---- */
.account {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.account:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.account p {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}
.account span.material-symbols-outlined {
    font-size: 22px;
    color: var(--accent);
}

/* ---- Burger button (mobile) ---- */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}
.burger-btn:hover { background: var(--accent-soft); }
.burger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Language Switch ---- */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 15px;
}
.lang-switch a {
    padding: 0 !important;
    font-weight: 500;
}
.lang-switch a.active-lang {
    font-weight: 800;
    color: var(--accent);
}
.lang-separator {
    color: #94a3b8;
    font-size: 0.9em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .burger-btn {
        display: flex;
        order: 3;
    }

    .account {
        order: 2;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.97);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px 20px;
        border-bottom: 1px solid var(--border);
        gap: 2px;
        box-shadow: var(--shadow-md);
        z-index: 998;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li a {
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
    }

    .account p {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo a {
        font-size: 1.15rem;
    }
}
