/* =========================
   GLOBALE EINSTELLUNGEN
========================= */

html {
    box-sizing: border-box;
    background-color: #000000;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* =========================
   HINTERGRUND
========================= */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('/template/gs_new/background2.png');
    background-position: center 10%;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-attachment: fixed;
    z-index: 0; /* ✅ FIX */
}

/* =========================
   BODY / GRID
========================= */

body {
    position: relative;
    display: grid;
    grid-template-columns: minmax(180px, 300px) 1fr minmax(180px, 300px);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header header header"
        "nav main aside"
        "footer footer footer";
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* =========================
   INHALTSEBENEN
========================= */

header,
nav,
main,
aside,
footer,
section,
article,
table,
form,
#pagination {
    position: relative;
    z-index: 5; /* ✅ FIX: über Zug */
}

/* =========================
   HEADER
========================= */

header {
    grid-area: header;
    width: 100%;
    height: 800px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    mix-blend-mode: screen; /* ✅ FIX */
    animation: fadeIn 3s ease-in-out;
    margin-right: 550px;
    margin-top: -257px;
    background-image: url('/template/gs_new/Schrift.pn');
    background-repeat: no-repeat;
    background-position: 65% center;
    background-size: contain;
    background-color: #00000061;
    z-index: 5;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

header ul {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    list-style: none;
    display: flex;
    gap: 10px;
    padding: 0;
    margin: 0;
    z-index: 30;
}

header li a {
    display: block;
    width: 120px;
    height: 38px;
    line-height: 38px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    color: #fff;
    background-color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
}

header li a:hover,
header li .selected {
    color: #00ffff;
    background-color: #005555;
    box-shadow: 0 6px 12px rgba(0, 255, 255, 0.3);
}

/* =========================
   NAV / MAIN / ASIDE
========================= */

nav,
aside {
    color: #ffffff;
    font-size: 17px;
    text-align: center;
    padding: 20px;
    background-color: #00000061;
}

nav { grid-area: nav; }
main { grid-area: main; }
aside { grid-area: aside; }

nav article[name]::before,
aside article[name]::before {
    content: attr(name);
    display: block;
    width: 100%;
    height: 40px;
    line-height: 30px;
    color: #e0ffff;
    font-size: 18px;
    font-family: Georgia, serif;
    font-style: oblique;
    font-weight: bold;
    border-radius: 15px;
    border: 5px solid transparent;
    background-size: cover;
    animation: borderAnimation 12s infinite linear;
    margin-bottom: 15px;
}

nav li a,
aside li a {
    display: block;
    width: calc(100% - 10px);
    height: 24px;
    line-height: 24px;
    font-weight: bold;
    text-decoration: none;
    color: #ffffff;
    margin: 5px auto;
    background-color: #222;
    border-radius: 5px;
    transition: all 0.3s ease;
    margin-left: -14px;
}

nav li a:hover,
nav li .selected,
aside li a:hover,
aside li .selected {
    color: #00ffff;
    background-color: #004444;
}

/* =========================
   HAUPTINHALT
========================= */

main,
section {
    color: #ffffff;
    background-color: #00000061;
    padding: 20px;
    text-align: center;
}

main article[name]::before,
section article[name]::before {
    content: attr(name);
    display: block;
    width: 100%;
    height: 35px;
    line-height: 35px;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    background-repeat: no-repeat;
    background-size: cover;
    margin-bottom: 15px;
}

main a,
section a {
    font-weight: bold;
    text-decoration: none;
    color: #ffffff;
    transition: color 0.3s ease;
}

main a:hover,
section a:hover {
    color: #00ffff;
}

/* =========================
   FOOTER
========================= */

footer {
    grid-area: footer;
    width: 100%;
    height: 120px;
    background-size: cover;
    background-image: url('/template/gs_new/2controller.png');
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    mix-blend-mode: screen;
    z-index: 5;
}

footer ul {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
}

footer li a {
    display: block;
    width: 120px;
    height: 38px;
    line-height: 38px;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    background-color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

footer li a:hover,
footer li .selected {
    color: #00ffff;
    background-color: #005555;
    box-shadow: 0 6px 12px rgba(0, 255, 255, 0.3);
}

footer p {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 14px;
    text-align: center;
    margin: 0;
}

footer a {
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #00ffff;
}

/* =========================
   ZUG / LICHT / SCHATTEN
========================= */

.train-stage {
    position: fixed;
    inset: 0;
    z-index: 1; /* ✅ hinter Content */
    pointer-events: none;
    overflow: hidden;
}

.train {
    position: absolute;
    width: 520px;
    max-width: 70vw;
    height: auto;
    display: block;
    transform-origin: center center;
    will-change: left, top, transform;
    z-index: 2;
}

.train-shadow {
    position: absolute;
    width: 300px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    filter: blur(18px);
    will-change: left, top, transform, opacity;
    z-index: 1;
}

.train-light {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 200, 120, 0.45) 0%,
        rgba(255, 200, 120, 0.18) 35%,
        rgba(255, 200, 120, 0) 75%
    );
    mix-blend-mode: screen;
    will-change: left, top, transform, opacity;
    z-index: 2;
}

/* =========================
   ANIMATION TITELRAHMEN
========================= */

@keyframes borderAnimation {
    0%   { border-color: rgba(70, 160, 220, 0.55); }
    25%  { border-color: rgba(110, 80, 170, 0.55); }
    50%  { border-color: rgba(230, 120, 70, 0.55); }
    75%  { border-color: rgba(220, 180, 80, 0.55); }
    100% { border-color: rgba(70, 160, 220, 0.55); }
}

/* =========================
   TABLET
========================= */

@media (max-width: 1023px) and (min-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "nav"
            "main"
            "aside"
            "footer";
    }

    header {
        height: 500px;
        margin-top: -100px;
        margin-right: 0;
        background-position: center;
    }

    nav,
    aside {
        padding: 10px;
    }

    main,
    section {
        padding: 15px;
    }

    header ul,
    footer ul {
        flex-direction: column;
        gap: 5px;
    }

    .train {
        width: 420px;
        max-width: 78vw;
    }

    .train-light {
        width: 220px;
        height: 220px;
    }

    .train-shadow {
        width: 240px;
        height: 34px;
    }
}

/* =========================
   HANDY
========================= */

@media (max-width: 767px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "nav"
            "aside"
            "footer";
    }

    header {
        height: 350px;
        margin-top: -80px;
        margin-right: 0;
        background-position: center;
        background-size: cover;
    }

    nav,
    aside {
        padding: 8px;
    }

    main,
    section {
        padding: 10px;
        font-size: 13px;
    }

    header ul,
    footer ul {
        flex-direction: column;
        gap: 4px;
    }

    header li a,
    footer li a {
        width: 100px;
        font-size: 12px;
    }

    .train {
        width: 300px;
        max-width: 82vw;
    }

    .train-light {
        width: 170px;
        height: 170px;
    }

    .train-shadow {
        width: 180px;
        height: 28px;
    }
}