/* Partial: _header.css.j2 — Unified header styles (both modes) */

/* Edit header base (overrides shared _header.css.j2 values) */
.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 10px 20px;
    padding-right: 56px;  /* reserve space for hamburger */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
    z-index: 100;
    position: relative;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--header-title);
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-badge {
    padding: 2px 6px;
    background: var(--version-badge-bg);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--version-badge-text);
}

.repo-name-badge {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.7;
}

.header-stats {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.stat-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    user-select: none;
    cursor: pointer;
    transition: opacity 0.15s, box-shadow 0.15s;
}

.stat-badge:hover { box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }
.stat-badge.dimmed { opacity: 0.3; text-decoration: line-through; }

.stat-badge.prd { background: var(--level-prd-bg); color: var(--level-prd-text); }
.stat-badge.ops { background: var(--level-ops-bg); color: var(--level-ops-text); }
.stat-badge.dev { background: var(--level-dev-bg); color: var(--level-dev-text); }
.stat-badge.main { background: var(--stat-main-bg); color: white; }
.stat-badge.tests { background: var(--stat-tests-bg); color: var(--stat-tests-text); }
.stat-badge.results { background: var(--stat-results-bg); color: white; }
.stat-badge.active { box-shadow: 0 0 0 2px var(--primary); }
.stat-badge.repo { background: var(--stat-repo-bg); color: white; }

.stat-sep { color: var(--stat-sep); font-size: 0.8rem; }

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-width: 300px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 7px 12px 7px 32px;
    border: 1px solid var(--search-border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--search-bg);
    transition: border-color 0.15s, background 0.15s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--search-focus-border);
    background: var(--search-focus-bg);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-box::before {
    content: "\1F50D";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--search-results-bg);
    border: 1px solid var(--search-results-border);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}

.search-results.visible {
    display: block;
}

.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--search-result-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-item:hover {
    background: var(--search-result-hover);
}

.search-result-id {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8rem;
    color: var(--search-result-id);
    flex-shrink: 0;
}

.search-result-title {
    font-size: 0.8rem;
    color: var(--search-result-title);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-level {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Edit Mode Toggle */
.edit-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid var(--edit-toggle-border);
    border-radius: 6px;
    background: var(--edit-toggle-bg);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--edit-toggle-text);
    transition: all 0.2s;
    user-select: none;
}

.edit-toggle:hover {
    border-color: var(--edit-toggle-hover-border);
}

.edit-toggle.active {
    border-color: var(--edit-toggle-active-border);
    background: var(--edit-toggle-active-bg);
    color: var(--edit-toggle-active-text);
}

.edit-toggle-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--edit-toggle-indicator);
    transition: background 0.2s;
}

.edit-toggle.active .edit-toggle-indicator {
    background: var(--edit-toggle-indicator-active);
}

/* Hamburger Menu — pinned top-right of header */
.hamburger-menu {
    position: absolute;
    top: 10px;
    right: 12px;
}

.hamburger-btn {
    font-size: 1.2rem;
    padding: 6px 10px;
    line-height: 1;
}

.hamburger-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: var(--hamburger-bg);
    border: 1px solid var(--hamburger-border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 300;
    padding: 4px 0;
    margin-top: 4px;
}

.hamburger-dropdown.visible { display: block; }

.hamburger-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--hamburger-item-text);
    text-align: left;
    transition: background 0.1s;
}

.hamburger-item:hover { background: var(--hamburger-item-hover-bg); }

.hamburger-label {
    padding: 4px 14px 2px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--hamburger-label);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hamburger-divider {
    height: 1px;
    background: var(--hamburger-divider);
    margin: 4px 0;
}

/* Font size controls */
.font-size-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

.font-size-btn {
    padding: 2px 8px !important;
    font-size: 0.8rem !important;
    min-width: 32px;
    text-align: center;
}

#font-size-display {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 36px;
    text-align: center;
    color: var(--font-size-display);
}

/* Theme controls */
.theme-controls {
    display: flex;
    gap: 4px;
    cursor: default;
}

.theme-btn {
    padding: 4px 10px !important;
    font-size: 1rem !important;
    border-radius: 4px;
    min-width: 36px;
    text-align: center;
}

.theme-btn.active {
    background: var(--theme-btn-active-bg) !important;
    border-color: var(--theme-btn-active-border) !important;
    color: var(--theme-btn-active-text) !important;
}

/* Filter toggle button — styled like stat-badge (outline off, filled on) */
.filter-toggle-btn {
    padding: 3px 10px !important;
    font-size: 0.8rem !important;
    font-weight: 600;
    line-height: 1;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.filter-toggle-btn:hover {
    background: var(--primary);
    color: white;
}
.filter-toggle-btn.active {
    background: var(--primary);
    color: white;
}

/* Stale banner */
.stale-banner {
    background: var(--warning-bg, #fff3cd);
    color: var(--warning-text, #664d03);
    border-bottom: 1px solid var(--warning-border, #ffecb5);
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.stale-banner.hidden { display: none; }
.stale-banner .btn-sm {
    padding: 2px 10px;
    font-size: 0.8rem;
}
.stale-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.6;
}
.stale-dismiss:hover { opacity: 1; }

/* Help bar */
.help-bar {
    background: var(--info-bg, #cff4fc);
    color: var(--info-text, #055160);
    border-bottom: 1px solid var(--info-border, #b6effb);
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.help-bar.hidden { display: none; }
.help-bar-label {
    font-weight: 600;
    white-space: nowrap;
}
.help-bar-text {
    flex: 1;
}
#help-mode-btn.active {
    background: var(--info-bg, #cff4fc);
    font-weight: 600;
}
