/* ==========================================================================
   1. GLOBALE DEFINITIONEN & VARIABLEN
   Kern-Konfiguration und dynamische Farben
   ========================================================================== */
:root {
    /* Farbanimation für gesamtes Layout */
    animation: colorLoop 60s linear infinite normal;
    /* Standardschriftart */    
    --font-main: 'Lato', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Dynamische Farbauswahl via CSS-Property */
@property --dynamic-color {
    syntax: '<color>';
    initial-value: rgba(255, 255, 255, 0.7);

    inherits: true;
}

/* ==========================================================================
   2. ANIMATIONEN (KEYFRAMES)
   Zentrale Definitionen für Bewegungsabläufe
   ========================================================================== */
/* @keyframes colorLoop {
    0%, 100% { --dynamic-color: rgba(255, 255, 255, 0.7); }
    20%      { --dynamic-color: rgba(255, 255, 130, 0.7); }
    40%      { --dynamic-color: rgba(130, 255, 130, 0.7); }
    60%      { --dynamic-color: rgba(130, 130, 255, 0.7); }
    80%      { --dynamic-color: rgba(255, 130, 130, 0.7); }
} */

@keyframes colorLoop {
    0%, 100% { --dynamic-color: rgba(255, 255, 255, 0.75); }
    12.5%      { --dynamic-color: rgba(255, 127, 127, 0.75); }
    25%      { --dynamic-color: rgba(255, 255, 255, 0.75); }
    37.5%      { --dynamic-color: rgba(127, 255, 127, 0.75); }
    50%      { --dynamic-color: rgba(255, 255, 255, 0.75); }
    62.5%      { --dynamic-color: rgba(127, 127, 255, 0.75); }
    75%      { --dynamic-color: rgba(255, 255, 255, 0.75); }
    87.5%      { --dynamic-color: rgba(255, 255, 127, 0.75); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ==========================================================================
   3. BASE & RESET
   Grundlegende HTML-Formatierung
   ========================================================================== */
*, *:after, *:before {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    height: 100vh;                              
    width: 100vw;
    overflow: hidden;
}

/* ==========================================================================
   4. HEADER (TOP BAR)
   Navigation oben, Logo und Timer
   ========================================================================== */
header {
    display: flex;
    flex-shrink: 0;
    font-family: var(--font-main);
    height: 70px;
    background-color: #000000;
    z-index: 100;
}

header > div {
    height: 100%;
    display: flex;
    align-items: center;
}

/* Header Links: Logo */
.header_lft {
    flex-basis: 30%;
    justify-content: left;
    padding: 0 10px;
    color: var(--dynamic-color);
    border-bottom: 2px solid var(--dynamic-color);
    border-left: 3px solid  var(--dynamic-color);
    border-bottom-left-radius: 60px;
}

.logo h3 {
    font-size: 18pt;
    font-weight: bold;
    font-family: Verdana;
    margin: 0;
    padding-left: 40px;
    transition: all 0.4s ease-in-out;
}

.logo h3 span {
    font-weight: 200;
    font-size: 14pt;
    letter-spacing: 1px;
    margin-left: 5px;
}

.is-private .logo h3 {
    opacity: 0.85; 
    transform: scale(0.9); 
    filter: blur(0.125px); 
}

.is-public .logo h3 {
    opacity: 1;
    transform: scale(1);
    filter: blur(0.05px);
}

/* Header Mitte: Admin Timer */
.header_ctr {
    flex-basis: 40%;
    justify-content: center;
    padding: 0 10px;
    color: var(--dynamic-color);
    border-bottom: 2px solid var(--dynamic-color);
}

.admin-timer-box {
    display: none;
    opacity: 0;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid var(--dynamic-color);
    background: rgba(0, 0, 0, 0.3);
}

.timer-visible {
    display: inline-flex !important;
    animation: timerFadeIn 0.8s ease-out forwards;
}

/* Header Rechts: Hamburger Menü Icon */
.header_rht {
    flex-basis: 30%;
    justify-content: right;
    padding: 0 10px;
    color: var(--dynamic-color);
    border-bottom: 2px solid var(--dynamic-color);
}

.nav_ico {
    width: 30px;
    z-index: 999;
    transition: opacity 0.3s ease-in-out;
}

.is-public .nav_ico {
    opacity: 0.075;
}

.is-private .nav_ico {
    opacity: 0.75;
}

.nav_ico span {
    width: 30px;
    display: block;
    height: 2px;
    margin: 4px 0;
    background: var(--dynamic-color);
    transition: transform 0.3s, width 0.3s, margin 0.3s, opacity 0.3s;
}

.nav_ico span:first-child, .nav_ico span:last-child {
    width: 70%;
    margin: 0 15%;
}

.nav_ico.active span:nth-child(2) {
    opacity: 0;
}

.nav_ico.active span:first-child {
    transform: rotate(45deg);
    transform-origin: 10px 2px;
    width: 100%; margin: 0;
}

.nav_ico.active span:last-child {
    transform: rotate(-45deg);
    transform-origin: 5px -2px;
    width: 100%; margin: 0;
}

/* ==========================================================================
   5. MAIN CONTENT AREA
   Hauptbereich mit Hintergrundbild und Scroll-Logik
   ========================================================================== */
main {
    display: flex;
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    background-color: var(--dynamic-color);
}

main::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("../img/informatic.avif"); */
    background-size: cover;
    background-position: center;
    z-index: 5;
}

/* Hintergrund für portal.php */
main.portal::before {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("../img/informatic.avif");
}

/* Hintergrund für dash.php */
main.dash::before {
    background-image: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)), url("../img/car.avif");
}

/* Scroll-Bereich für Inhalte */
section {
    flex-grow: 1;
    position: relative;
    overflow-y: auto;
    overscroll-behavior: contain;
    height: 100%;
    padding: 10px 20px 20px 30px; 
    z-index: 10;
}

section::-webkit-scrollbar {
    width: 8px;
}

section::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--dynamic-color), transparent 60%);
    border-radius: 10px;
}

article {
    width: calc(100% - 10px);
    font-size: 16pt;
    font-family: Verdana;
    color: var(--dynamic-color);
}

#content-area {
    opacity: 0;
}

/* Lade-Indikator */
.loader-container {
    display: none;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
}

.loader {
    width: 40px; height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--dynamic-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   6. SIDEBAR NAVIGATION
   Ausfahrbare Sidebar und Overlay
   ========================================================================== */
.side_nav-overlay {
    position: absolute;
    z-index: 988;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
}

.side_nav-overlay.active {
    background: rgba(0,0,0,0.7);
    pointer-events: auto;
}

.side_nav {
    position: absolute;
    right: 0; top: 0;
    padding-top: 5px;
    background: #000;
    width: 180px;
    height: auto;
    max-height: 100%;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
    z-index: 999;
}

.side_nav.active {
    transform: translateX(0%);
    pointer-events: auto;
    box-shadow: -2px 1px 10px color-mix(in srgb, var(--dynamic-color), transparent 50%);
}

.side_nav ul { list-style: none; padding: 0; margin: 0; }

.side_nav ul li a {
    display: block;
    padding: 15px 30px;
    border-bottom: 1px solid color-mix(in srgb, var(--dynamic-color), transparent 50%);
    color: var(--dynamic-color);
    text-decoration: none;
    transition: all 0.3s;
    font-family: var(--font-main);
    background: linear-gradient(to right, var(--dynamic-color), var(--dynamic-color)) no-repeat right center / 0 100%;
}

.side_nav ul li a:hover { background-size: 100% 100%; color: #000; }

/* ==========================================================================
   7. FOOTER (BOTTOM BAR)
   System-Infos und Badges
   ========================================================================== */
footer {   
    display: flex;
    flex-shrink: 0;
    font-family: var(--font-main);
    height: 50px;
    background: #000;
    z-index: 100;
}

footer > div {
    height: 100%;
    display: flex;
    align-items: center;
}

.footer_lft, .footer_ctr, .footer_rht {
    flex-basis: 33.33%;
    padding: 0 10px;
    color: var(--dynamic-color);
    border-top: 2px solid var(--dynamic-color);
    font-size: 0.8rem;
}

.footer_lft {
    justify-content: left;
}

.footer_ctr {
    justify-content:
    center; text-align: center;
}

.footer_rht {
    justify-content: right;
    text-align: right;
}

.version-info, .ip-info, .refresh-info {
    opacity: 0.75;
    letter-spacing: 0.5px;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bg-green {
    background-color: #28a745;
}

.bg-blue {
    background-color: #007bff;
}

.bg-grey {
    background-color: #007bff;
}

/* ==========================================================================
   8. UI-KOMPONENTEN: LOGIN
   Formular-Layout für Authentifizierung
   ========================================================================== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    z-index: 50;
}

.login-card {
    background: color-mix(in srgb, var(--dynamic-color), transparent 95%);
    padding: 2.5rem;
    border-radius: 15px;
    border: 2px solid var(--dynamic-color);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--dynamic-color), transparent 80%);
    backdrop-filter: blur(8px);
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.login-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid color-mix(in srgb, var(--dynamic-color), transparent 60%);
    border-radius: 5px;
    transition: all 0.3s;
}

.login-card input:focus {
    border-color: var(--dynamic-color);
    outline: none;
    background: rgba(255, 255, 255, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--dynamic-color);
    color: #000;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s;
}
.btn-submit:hover {
    transform: scale(1.03);
}

/* OTP / 2FA Spezifisch */
.otp-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--dynamic-color);
    color: var(--dynamic-color);
    padding: 12px;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 8px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* ==========================================================================
   9. UI-KOMPONENTEN: FEHLER & FEEDBACK
   Boxen für Error-Meldungen und Warnungen
   ========================================================================== */
.error-box {
    border: 2px solid var(--dynamic-color);
    background: color-mix(in srgb, var(--dynamic-color), transparent 95%);
    padding: 40px;
    border-radius: 10px;
    color: var(--dynamic-color);
    text-align: center;
    max-width: 500px;
    margin: 50px auto;
    backdrop-filter: blur(10px);
    animation: shake 0.5s ease-in-out;
}

.error-box h2 {
    color: #ff4d4d;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.error-msg {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ff4d4d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}