/**
 * Science Lab Header — QuizzMan Tools
 * Unified header matching the Science Lab design system.
 */

/* ── Body offset for fixed header ──────────────────────────── */
body {
    padding-top: 60px;
}

/* ── Lab Header ─────────────────────────────────────────────── */
.lab-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1001;
    height: 60px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid #e4dfd8;
    transition: background 0.3s, border-color 0.3s;
    /* override any generic header{} styles */
    margin: 0;
    padding: 0;
    display: block;
}

body.dark-mode .lab-header,
[data-theme="dark"] .lab-header {
    background: rgba(12, 14, 26, 0.92);
    border-bottom-color: #2a2e48;
}

/* Inner flex row */
.lab-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: relative;
}

/* ── Brand (left) ───────────────────────────────────────────── */
.lab-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.lab-header__logo {
    height: 36px;
    width: auto;
    border-radius: 8px;
    transition: transform 0.3s;
}

.lab-header__brand:hover .lab-header__logo {
    transform: scale(1.05);
}

.lab-header__titles {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.lab-header__name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: inherit;
}

.lab-header__sub {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
}

/* ── Center (QuizzMan link / QM group) ─────────────────────── */
.lab-header__center,
.lab-header__qm-group {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.lab-header__qm-logo {
    height: 28px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.lab-header__qm-logo:hover { opacity: 1; }

.lab-header__qm-texts {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.lab-header__qm-name {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b6914, #5c4a9e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .lab-header__qm-name,
[data-theme="dark"] .lab-header__qm-name {
    background: linear-gradient(135deg, #d4a843, #9b8ce0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lab-header__qm-sub {
    display: none; /* visible only on mobile */
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    color: #555;
}

body.dark-mode .lab-header__qm-sub,
[data-theme="dark"] .lab-header__qm-sub {
    color: #aaa;
}

/* ── Actions (right) ────────────────────────────────────────── */
.lab-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lab-header__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.7);
    color: #555;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.25s;
    text-decoration: none;
    font-family: inherit;
    /* reset button defaults */
    padding: 0;
    line-height: 1;
}

body.dark-mode .lab-header__btn,
[data-theme="dark"] .lab-header__btn {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #aaa;
}

.lab-header__btn:hover {
    background: rgba(139, 105, 20, 0.1);
    color: #8b6914;
    border-color: #8b6914;
}

body.dark-mode .lab-header__btn:hover,
[data-theme="dark"] .lab-header__btn:hover {
    background: rgba(212, 168, 67, 0.12);
    color: #d4a843;
    border-color: #d4a843;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .lab-header__brand { display: none; }
    .lab-header__center { display: none; }
    .lab-header__qm-group {
        display: flex;
        position: static;
        transform: none;
    }
    .lab-header__qm-sub { display: block; }
}
@media (max-width: 480px) {
    .lab-header__inner { padding: 0 16px; }
    .lab-header__btn { width: 34px; height: 34px; font-size: 0.85rem; }
    .lab-header__qm-logo { height: 28px; }
    .lab-header__qm-name { font-size: 0.88rem; }
    /* Page title below header */
    .page-title.compact { padding: 0.6rem 0; margin-bottom: 1rem; }
    .page-title.compact h1 { font-size: 1.1rem; gap: 0.35rem; }
    .page-title h1 { font-size: 1.2rem; }
}
