/**
 * Global Header Styles
 * Include this in all pages for consistent header styling
 * Matches the editor (index_modular.html) exactly
 */

/* Header Container */
.header {
    height: 70px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 25px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo img {
    height: 40px;
}

/* Actions container (right side) */
/* Optionaler Mittelteil „← Dashboard | Titel“ — dieselbe Form wie im
   Editor (editor.css .header-center / .header-dashboard-btn), für Seiten
   mit dem gemeinsamen Kopf (components/header.html, header_zurueck). */
.header-mitte {
    display: flex; align-items: center; margin: 0 auto; min-width: 0;
    height: 42px; background: #fff; border: 1px solid #dee2e6; border-radius: var(--radius-md, 6px);
}
.header-mitte__zurueck {
    display: flex; align-items: center; gap: 5px; padding: 0 10px; height: 100%;
    color: #64748b; text-decoration: none; border-right: 1px solid #dee2e6;
    font-size: 0.875rem; font-weight: 500; white-space: nowrap; transition: all .15s ease;
    border-radius: var(--radius-md, 6px) 0 0 var(--radius-md, 6px);
}
.header-mitte__zurueck i { font-size: 0.85rem; }
.header-mitte__zurueck:hover { color: var(--primary-blue, #4274a5); background: #f0f7ff; }
.header-mitte__titel { padding: 0 14px; font-size: 0.9rem; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-mitte + .header-actions { margin-left: 0; }

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Unified button styling for all header dropdowns - matches editor exactly */
.header-dropdown-btn {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 12px !important;
    border-radius: 6px !important;
}

/* „Registrieren“ ohne Anmeldung (öffentliche Seiten): Hausblau, Schrift wie die
   übrigen Kopfknöpfe (Bootstrap btn-sm). */
.header-actions .header-registrieren { font-size: .875rem; font-weight: 400; }
@media (max-width: 768px) {
    /* Ohne Anmeldung vier Knöpfe (Sprache, Hilfe, Anmelden, Registrieren) in einer Zeile */
    .header-actions--oeffentlich { gap: 6px; }
    .header-actions--oeffentlich .header-dropdown-btn { padding: 0 7px !important; font-size: .8125rem; }
}

/* ── Mobile (<=768px): Zweireihiger Header ──
   Auf schmalen Displays passt Logo + 4 Action-Buttons nicht in eine
   Zeile. Statt zu kollidieren bauen wir den Header zweireihig:
   Zeile 1: Logo (zentriert)
   Zeile 2: alle Action-Buttons (Lang/Notifications/Help/User-Menu)
   `--header-height` wird angehoben, damit dashboard.css' margin-top
   und sidebar-top automatisch mitskaliert (Variable wird dort gelesen). */
@media (max-width: 768px) {
    :root {
        --header-height: 120px;
    }
    .header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
        gap: 6px;
        height: var(--header-height);
    }
    .header-logo img {
        height: 32px;
    }
    .header-actions {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
}
