/* =========================================================
 *  header.css  -  Styling f&uuml;r den Seitenkopf
 * ========================================================= */

/* ---------- Minecraft-Font wird nur f&uuml;r Header und Banner verwendet ---------- */
@font-face {
    font-family:'Minecraft';
    font-style:normal;
    font-weight:400;
    font-display:swap;
    src:url('https://raw.githubusercontent.com/South-Paw/typeface-minecraft/master/files/minecraft.woff2') format('woff2'),
        url('https://raw.githubusercontent.com/South-Paw/typeface-minecraft/master/files/minecraft.woff')  format('woff');
}

/* ---------- color variables ---------- */
:root {
    --h-bg:        #1a1a1a;   /* header background */
    --h-fg:        #f0f0f0;   /* text             */
    --h-border:    #000000;   /* pixel border     */

    --h-btn:       #8e2de2;   /* button base      */
    --h-btn-dark:  #4d15a3;   /* button shadow    */

    --banner-bg:   #b60000;
    --banner-fg:   #ffffff;
}

[data-theme="light"] {
    --h-bg:     #fafafa;
    --h-fg:     #202020;
    --h-border: #000000;
    --h-btn:    #8e2de2;
    --banner-bg:#d40000;
}

/* ---------- header + banner: Minecraft-Font ---------- */
header,
#global-banner {
    font-family: 'Minecraft', monospace;
}

/* ---------- header layout ---------- */
header {
    background: var(--h-bg);
    color: var(--h-fg);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.9rem 1.4rem;
    flex-wrap: nowrap; /* Keine Zeilenumbr&uuml;che */
}

/* ---------- logo ---------- */
#logo-img {
    display: block;
    height: auto;
    max-width: 100%;
    image-rendering: pixelated;
}

/* ---------- navigation ---------- */
header nav {
    display: flex;
    flex-wrap: nowrap; /* alles in einer Zeile */
    align-items: center;
    gap: 0.9rem;
    margin-left: auto;
}

/* ---------- buttons / links ---------- */
header nav a,
header nav .btn,
#theme-toggle {
    border-radius: 3px;
    border: 3px solid var(--h-border);
    background: var(--h-btn);
    color: #ffffff;
    padding: 0.5rem 1.15rem;
    font-size: 1.05rem;
    letter-spacing: 0.35px;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
       0 0 0 1px var(--h-btn-dark) inset,
       0 3px 0 0 var(--h-btn-dark);
    line-height: 1;
    transition: filter 0.12s, transform 0.12s, box-shadow 0.12s;
}

header nav a:hover,
header nav .btn:hover,
#theme-toggle:hover {
    filter: brightness(1.15);
}

header nav a:active,
header nav .btn:active,
#theme-toggle:active {
    box-shadow:
       0 0 0 1px var(--h-btn-dark) inset,
       0 1px 0 0 var(--h-btn-dark);
    transform: translateY(2px);
}

/* theme toggle (sun/moon) */
#theme-toggle {
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    padding: 0;
}

/* avatar + name */
.user-block {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.05rem;
}
.user-block img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    image-rendering: pixelated;
}

/* banner top */
#global-banner {
    width: 100%;
    background: var(--banner-bg);
    color: var(--banner-fg);
    text-align: center;
    padding: 0.45rem 0.8rem;
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    white-space: nowrap;
}

/* Pulsierende Animation f&uuml;r LIVE-Banner */
.live-pulse {
    animation: livePulse 1.5s infinite;
}
@keyframes livePulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ---------- responsive ---------- */
@media(max-width:600px){
    header {
        flex-wrap: nowrap; /* Trotzdem in einer Zeile halten */
        justify-content: center;
        gap: 0.8rem;
    }
    header nav {
        margin-left: 0;
        justify-content: center;
    }
    header nav a,
    header nav .btn,
    #theme-toggle {
        font-size: 0.95rem;
        padding: 0.45rem 0.9rem;
    }
    .user-block span {
        display: none;
    }
}


/* ----------------------------------------------------------------------------
   Urspruengliches Header-Design (bitte nicht veraendern/löschen!)
   ---------------------------------------------------------------------------- */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: system-ui, sans-serif;
    box-sizing: border-box;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 1rem;
    border-bottom: 2px solid var(--border);
    background: var(--card);
}

.logo-wrap img {
    display: block;
    height: auto;
    max-width: 150px; 
}

nav {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.navlink {
    color: var(--fg);
    text-decoration: none;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

.navlink:hover {
    background: rgba(255,255,255,0.1);
}

.btn {
    background: var(--acc);
    color: #000;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.85;
}

.user-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
}

.user-block img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    image-rendering: pixelated;
}

#theme-toggle {
    background: none;
    color: var(--fg);
    border: none;
    font-size: 1.2rem;
    width: 2.2rem;
    height: 2.2rem;
    cursor: pointer;
    border-radius: 6px;
}

#theme-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* Global-Banner */
#global-banner {
    width: 100%;
    margin: 0 auto;
    text-align: center;
    font-family: system-ui, sans-serif;
    font-size: 1rem;
    background: var(--acc);
    color: #000;
    padding: 0.4rem 1rem;
    box-sizing: border-box;
    position: relative;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
}
#global-banner span {
    white-space: nowrap;
}

/* Live-Pulse-Effekt */
.live-pulse {
    animation: pulseBanner 1.5s infinite;
}
@keyframes pulseBanner {
    0%   { filter: brightness(0.8); }
    50%  { filter: brightness(1.1); }
    100% { filter: brightness(0.8); }
}

/* ----------------------------------------------------------------------------
   NEUE OVERLAYS (Vollflächig). Blockieren komplett die Seite, 
   wenn man kein Admin ist (s. header.php). 
   ---------------------------------------------------------------------------- */

/* Allgemeine Basis (gleiche Struktur, verschiedene Klassen) */
.mega-overlay-base {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999999; /* extrem hoch, damit man nix dahinter anklicken kann */
    background: rgba(0,0,0,1); /* komplette Verdunkelung */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Scroll hinterm Overlay unterbinden */
}

/* Unsichtbarer Twitch-Login-Button unten rechts */
.mega-stealth-login {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 40px;
    height: 40px;
    opacity: 0;
    cursor: pointer;
    border: none;
    background: none;
    /* pointer-events bleiben aktiv, damit man klicken kann */
}

/* Wartungs-Overlay */
.mega-maint-overlay .mega-maint-box {
    background: #222;
    padding: 2rem 3rem;
    border-radius: 14px;
    border: 2px solid #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.mega-maint-title {
    font-family: "Minecraft", monospace;
    font-size: 1.6rem;
    color: var(--acc);
}
.mega-maint-message {
    font-size: 1.2rem;
    color: #fff;
    text-align: center;
    max-width: 400px;
    line-height: 1.4;
}
.mega-maint-countdown {
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
    color: #ccc;
}
.mega-maint-spinner {
    width: 50px; 
    height: 50px; 
    border: 6px solid #999; 
    border-top: 6px solid var(--acc); 
    border-radius: 50%; 
    animation: spinMaint 1s linear infinite;
}
@keyframes spinMaint {
    0%   { transform:rotate(0); }
    100% { transform:rotate(360deg); }
}

/* Planungs-Overlay */
.mega-plan-overlay .mega-plan-box {
    background: #222;
    padding: 2rem 3rem;
    border-radius: 14px;
    border: 2px solid #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}
.mega-plan-title {
    font-family: "Minecraft", monospace;
    font-size: 1.6rem;
    color: var(--acc);
}
.mega-plan-message {
    font-size: 1.2rem;
    color: #fff;
    text-align: center;
    max-width: 400px;
    line-height: 1.4;
}
.mega-plan-progress {
    position: relative;
    width: 300px;
    height: 24px;
    border: 2px solid #444;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
}
.mega-plan-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--acc);
    width: 0%;
    transition: width 0.4s;
}
.mega-plan-label {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 24px;
    color: #000;
    font-family: system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
}
.mega-plan-countdown {
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
    color: #ccc;
}

/* Willkommens-Overlay */
.mega-welcome-overlay .mega-welcome-box {
    background: #222;
    padding: 2rem 3rem;
    border-radius: 14px;
    border: 2px solid #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}
.mega-welcome-head {
    font-family: "Minecraft", monospace;
    font-size: 1.6rem;
    color: var(--acc);
}
.mega-welcome-text {
    font-size: 1.3rem;
    color: #fff;
    text-align: center;
    line-height: 1.5;
    max-width: 400px;
}
.mega-welcome-overlay.fade-out {
    animation: fadeOverlay 1s forwards;
}
@keyframes fadeOverlay {
    100% {
        opacity: 0;
        visibility: hidden;
    }
}
