﻿/* =========================================
   MasterTeacherAi Header
   FULL REPLACEMENT: wwwroot/css/header-center.css
   ========================================= */

/* --- Header shell --- */
.mt-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(8,12,20,.95), rgba(8,12,20,.88));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 10px 30px rgba(0,0,0,.30);
}

html.light .mt-header {
    background: rgba(255,255,255,.90);
    border-bottom: 1px solid rgba(0,0,0,.10);
    box-shadow: 0 10px 30px rgba(0,0,0,.10);
}

/* --- Container --- */
.mt-header .container {
    max-width: none;
    width: 100%;
    padding-inline: 24px;
}

/* --- Main row: true 3 zones --- */
.mt-header-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    align-items: center;
    gap: 18px;
    padding: 12px 0;
    direction: ltr;
}

/* --- Left --- */
.mt-header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    grid-column: 1;
}

/* --- Center wrapper --- */
.mt-header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    grid-column: 2;
}

/* --- Right --- */
.mt-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    grid-column: 3;
    direction: inherit;
}

/* --- Brand --- */
.mt-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    user-select: none;
}

.mt-brand-dot {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    background: rgba(58,130,255,.30);
    border: 1px solid rgba(58,130,255,.45);
    flex: 0 0 auto;
}

.mt-brand-text {
    font-weight: 800;
    letter-spacing: .2px;
    white-space: nowrap;
    color: rgba(255,255,255,.92);
}

html.light .mt-brand-text {
    color: rgba(0,0,0,.86);
}

/* --- Nav --- */
.mt-header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    white-space: nowrap;
    flex-wrap: nowrap;
    direction: inherit;
}

[dir="rtl"] .mt-header-nav {
    direction: rtl;
}

.mt-nav-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: rgba(255,255,255,.88);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    transition: background .15s ease, color .15s ease, opacity .15s ease;
}

    .mt-nav-link:hover {
        background: rgba(255,255,255,.08);
        color: #fff;
    }

html.light .mt-nav-link {
    color: rgba(0,0,0,.80);
}

    html.light .mt-nav-link:hover {
        background: rgba(0,0,0,.06);
    }

/* --- Subjects badge --- */
.mt-nav-subjects {
    position: relative;
}

.mt-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-inline-start: 6px;
    border-radius: 999px;
    background: #6d5dfc;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
}

/* --- Pills --- */
.mt-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    font-size: 13px;
    line-height: 1;
    color: rgba(255,255,255,.90);
    white-space: nowrap;
}

html.light .mt-pill {
    border: 1px solid rgba(0,0,0,.12);
    background: rgba(0,0,0,.04);
    color: rgba(0,0,0,.80);
}

.mt-pill-link {
    text-decoration: none;
    color: inherit;
}

/* --- Generic pill buttons --- */
.mt-pill-btn {
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 800;
    font-size: 12px;
    color: rgba(255,255,255,.92);
    opacity: .95;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

    .mt-pill-btn:hover {
        background: rgba(255,255,255,.12);
        border-color: rgba(255,255,255,.24);
    }

html.light .mt-pill-btn {
    color: rgba(0,0,0,.78);
    border: 1px solid rgba(0,0,0,.12);
    background: rgba(0,0,0,.04);
}

    html.light .mt-pill-btn:hover {
        background: rgba(0,0,0,.07);
        border-color: rgba(0,0,0,.18);
    }

.mt-pill-btn.is-active {
    opacity: 1;
    background: rgba(58,130,255,.85);
    color: #fff;
}

html.light .mt-pill-btn.is-active {
    background: rgba(58,130,255,.28);
    color: rgba(0,0,0,.90);
}

/* --- Settings --- */
.mt-settings-wrap {
    position: relative;
    flex: 0 0 auto;
}

.mt-settings-toggle {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mt-settings-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.mt-settings-menu {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    min-width: 240px;
    padding: 14px;
    border-radius: 16px;
    z-index: 1500;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html.dark .mt-settings-menu {
    background: rgba(20, 26, 39, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #eef2ff;
}

html.light .mt-settings-menu {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #1f2937;
}

.mt-settings-section + .mt-settings-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.mt-settings-label {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 8px;
    opacity: 0.8;
}

.mt-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mt-settings-option {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease, outline-color .2s ease;
}

html.dark .mt-settings-option {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

html.light .mt-settings-option {
    background: rgba(15, 23, 42, 0.08);
    color: #1f2937;
}

.mt-settings-option:hover {
    transform: translateY(-1px);
}

.mt-settings-option.is-active {
    outline: 2px solid rgba(59, 130, 246, 0.55);
}

.mt-settings-info {
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 700;
}

html.dark .mt-settings-info {
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
}

html.light .mt-settings-info {
    background: rgba(15, 23, 42, 0.06);
    color: #1f2937;
}

/* --- Smooth theme transitions --- */
html, body,
.mt-header,
.mt-nav-link,
.mt-pill,
.mt-pill-group,
.mt-pill-btn,
.mt-settings-menu,
.mt-settings-option,
.mt-settings-info {
    transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

/* --- Mobile --- */
@media (max-width: 1200px) {
    .mt-header-nav {
        gap: 14px;
    }

    .mt-nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 980px) {
    .mt-header-row {
        grid-template-columns: 1fr;
        gap: 12px;
        direction: inherit;
    }

    .mt-header-left,
    .mt-header-center,
    .mt-header-right {
        grid-column: auto;
    }

    .mt-header-left {
        justify-content: flex-start;
    }

    .mt-header-center {
        justify-content: center;
    }

    .mt-header-nav {
        justify-content: center;
        flex-wrap: wrap;
        white-space: normal;
        gap: 12px;
    }

    .mt-header-right {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .mt-settings-menu {
        min-width: 220px;
        inset-inline-end: 0;
    }
}

@media (max-width: 640px) {
    .mt-header .container {
        padding-inline: 14px;
    }

    .mt-brand-text {
        font-size: 15px;
    }

    .mt-brand-dot {
        width: 36px;
        height: 36px;
    }

    .mt-pill,
    .mt-pill-btn {
        font-size: 12px;
    }

    .mt-settings-toggle {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
}
