/* ==================================================
   GLOBAL PREMIUM GLASSMORPHISM THEME - THE FINAL FIX
   ================================================== */

/* 1. Basis & Hintergrund */
body {
    background: linear-gradient(-45deg, #040a16, #081629, #0a1f3d, #06142e) !important;
    background-size: 400% 400% !important;
    animation: gradientBG 15s ease infinite !important;
    color: #ffffff !important;
    margin: 0;
    
    /* NEU: Wir pinnen den Body fest, damit nichts mehr hinter den Footer rutscht! */
    height: 100vh !important;
    overflow: hidden !important; 
}

/* Modal-Fix: Reset, wenn Modal offen ist */
body.modal-open {
    transform: none !important;
}

/* FIX: Sidebar-Verhalten im #wrapper komplett killen */
#wrapper {
    background: transparent !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.topbar-center-logo {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 50px;
        display: flex;
        justify-content: center;
        align-items: center;
        pointer-events: none; /* Klicks auf den unsichtbaren Container ignorieren */
        z-index: 10;
    }
    .topbar-center-logo a {
        pointer-events: auto; /* Klicks auf das Logo/Text erlauben */
        text-decoration: none;
        color: #fff;
        display: flex;
        align-items: center;
        gap: 15px;
        transition: all 0.3s ease;
    }
    .topbar-center-logo a:hover {
        transform: scale(1.03);
        text-shadow: 0 0 15px rgba(255,255,255,0.4);
    }
    @media (max-width: 768px) {
        /* Auf dem Handy verstecken, damit es sich nicht mit dem Menü-Button überschneidet */
        .topbar-center-logo { display: none !important; }
    }
    
#page-wrapper {
    background: transparent !important;
    margin: 0 !important;
    width: 100% !important;
    padding-top: 70px !important; /* Platz für Top-Nav */
    padding-left: 20px !important;
    padding-right: 20px !important;
    
    /* NEU: Der Wrapper wird jetzt zum echten Scroll-Fenster! */
    box-sizing: border-box !important;
    height: calc(100vh - 50px) !important; /* Exakt Bildschirmhöhe MINUS die 50px Footer! */
    overflow-y: auto !important; /* Der Scrollbalken wandert hierhin */
    /*padding-bottom: 30px !important; /* /* Etwas Luft unter der letzten Tabelle */
    
    position: relative;
    z-index: 1;
}

/* 2. Top-Navigation & 3D Logout */
.navbar-inverse {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    z-index: 1030 !important;
}

.top-logout-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    margin-top: 7px !important;
    margin-right: 15px !important;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    text-decoration: none !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    transform-style: preserve-3d;
    z-index: 1031 !important;
}

.top-logout-btn:hover {
    /* Perspective direkt im Transform angewendet! */
    transform: perspective(1000px) translateY(-3px) translateZ(30px) rotateX(10deg) !important;
    background-color: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(51, 166, 204, 0.6) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 10px rgba(51, 166, 204, 0.3) !important;
}

.top-logout-btn i {
    color: #d9534f !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    backface-visibility: hidden;
}

.top-logout-btn:hover i {
    transform: translateZ(15px) scale(1.1) !important;
}

/* 3. Panels & Animationen */
.panel {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 15px !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
    margin-bottom: 25px;
    overflow: visible !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    transform-style: preserve-3d;
    transform: perspective(1500px) translateZ(0); /* Basis-Perspective */
}

.panel:hover {
    transform: perspective(1500px) translateY(-5px) rotateX(2deg) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    
    /* NEU: Zwingt das Panel beim Hovern über ALLE anderen Elemente */
    z-index: 50 !important; 
    position: relative !important;
}

/* NEU: Verhindert, dass Tabellen oder Charts im Panel den 3D-Effekt zerstören */
.panel .panel-body {
    transform-style: preserve-3d !important;
    transform: translateZ(20px) !important; /* Hebt den Inhalt im 3D-Raum leicht an */
}

/* Repariert den Hover, falls SVG-Charts die Maus blockieren */
.panel svg {
    pointer-events: none !important; 
}
.panel .morris-hover {
    pointer-events: auto !important; /* Tooltips beim Chart sollen natürlich noch gehen */
}

.panel-stagger {
    opacity: 0;
    transform: perspective(1500px) translateZ(-100px);
}

body.animations-ready .panel-stagger {
    opacity: 1;
    animation: panelFlyIn3D 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes panelFlyIn3D {
    0% { opacity: 0; transform: perspective(1500px) translateZ(-200px) translateY(30px); }
    100% { opacity: 1; transform: perspective(1500px) translateZ(0) translateY(0); }
}

/* 4. Fixed Footer & Dock System */
.custom-fixed-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 50px !important;
    z-index: 1032 !important; 
    
    display: flex !important;
    align-items: center !important;
    
    /* WICHTIG: Keine Farbe oder Blur direkt auf dem Haupt-Container! */
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ==================================================
   DER ULTIMATIVE SCROLL-FIX: Die separate Glas-Ebene
   ================================================== */
.custom-fixed-footer::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: -1 !important; /* Legt das Glas HINTER deine Footer-Inhalte */
    
    /* Hier kommt jetzt dein Milchglas rein */
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3) !important;
}

/* Der innere Container übernimmt weiterhin den 3D-Raum für die Buttons */
.footer-flex-layout {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 20px !important;
    
    /* 3D-Raum nach innen verlagert */
    transform-style: preserve-3d !important;
    perspective: 1000px !important; 
}

.footer-left-section { flex: 1; display: flex; align-items: center; z-index: 20; }
.footer-right-section { flex: 1; display: flex; justify-content: flex-end; align-items: center; z-index: 20; }
.footer-center-section {
    position: absolute; left: 0; right: 0; top: 0; bottom: 0;
    display: flex; justify-content: center; align-items: center;
    pointer-events: none; z-index: 10;
}

/* 5. Dock Buttons */
.footer-dock-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    margin-right: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
    opacity: 0;
    transform: translateY(40px) rotateX(-15deg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    transform-style: preserve-3d;
}

body.animations-ready .footer-dock-btn {
    animation: dockFlyIn3D 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes dockFlyIn3D {
    0% { opacity: 0; transform: translateY(80px) translateZ(-100px) rotateX(-45deg); }
    100% { opacity: 1; transform: translateY(0) translateZ(0) rotateX(0deg); }
}

.footer-dock-btn:hover {
    transform: translateY(-12px) translateZ(40px) rotateX(10deg) !important;
    background-color: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(51, 166, 204, 0.6) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 10px rgba(51, 166, 204, 0.3) !important;
}

.footer-dock-btn i {
    font-size: 20px !important;
    color: #fff !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.footer-dock-btn:hover i { transform: translateZ(20px) scale(1.2) !important; }

.footer-dock-btn.active {
    background-color: rgba(51, 166, 204, 0.2) !important;
    border: 1px solid #33a6cc !important;
    transform: translateY(-4px) translateZ(15px);
    opacity: 1 !important;
}

/* 6. Timer & Copyright */
.footer-timer {
    font-family: 'Segoe UI', Roboto, sans-serif !important;
    font-size: 15px !important;
    font-variant-numeric: tabular-nums !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

#footer-session-timer {
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    margin-left: 5px;
}

.footer-center-section span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: auto;
}

/* ==================================================
   7. LOGIN PAGE & INPUT REPAIR
   ================================================== */

/* Die Animation für den pulsierenden Schatten und die Helligkeit */
@keyframes glass-shadow-pulse {
    0% {
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), 
                    inset 0 0 10px rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.15);
        transform: translateY(0) scale(1);
    }
    50% {
        /* MASSIVER SCHATTEN: Mehr Blur (80px) und tiefere Deckkraft (0.7) */
        box-shadow: 0 35px 90px 20px rgba(0, 0, 0, 0.7), 
                    /* STÄRKERER GLANZ: Mehr Inset-Leuchten für den Glaseffekt */
                    inset 0 0 35px rgba(255, 255, 255, 0.3);
        
        /* HELLERER RAND: Der Rahmen leuchtet beim Pulsieren auf */
        border-color: rgba(255, 255, 255, 0.5);
        
        /* MEHR BEWEGUNG: Die Karte hebt sich um 10px und skaliert minimal */
        transform: translateY(-10px) scale(1.01);
    }
    100% {
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), 
                    inset 0 0 10px rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.15);
        transform: translateY(0) scale(1);
    }
}

.glass-login-card {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 20px !important;
    padding: 40px !important;
    width: 90% !important;
    max-width: 400px !important;
    
    /* TIMING: 6s statt 10s macht das Pulsieren "lebendiger" */
    animation: glass-shadow-pulse 6s infinite ease-in-out !important;
    
    transform-style: preserve-3d;
    transition: all 0.5s ease;
}

.login-fullscreen-bg {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100vh;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 9999;
    perspective: 2000px; /* Erhöht für besseren 3D-Effekt */
}

/*
.login-fullscreen-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    display: flex; align-items: center; justify-content: center; z-index: 9999;
    perspective: 1000px;
}

.glass-login-card {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 20px !important;
    padding: 40px !important;
    width: 90% !important;
    max-width: 400px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}
*/

/*.glass-login-card:hover { 
    transform: rotateY(3deg) rotateX(3deg) !important; 
}*/

/* --- NEU: Icon & Titel Reparatur --- */
.login-icon {
    font-size: 50px !important;
    color: #33a6cc !important;
    margin-bottom: 15px !important;
    text-shadow: 0 0 15px rgba(51, 166, 204, 0.4) !important;
}

.glass-login-card h2 {
    color: #ffffff !important;
    margin-bottom: 30px !important;
    font-weight: 300 !important;
    letter-spacing: 2px !important;
}

/* --- NEU: Eingabefelder Reparatur --- */
.modern-input-group { 
    position: relative !important; 
    margin-bottom: 25px !important; 
    width: 100% !important; 
    text-align: left !important; 
}

.modern-input-group i { 
    position: absolute !important; 
    left: 15px !important; 
    top: 50% !important; 
    transform: translateY(-50%) !important; 
    color: rgba(255, 255, 255, 0.6) !important; 
    z-index: 11 !important; 
}

.modern-input { 
    width: 100% !important; 
    padding: 15px 15px 15px 45px !important; /* 45px Platz links für das Icon! */
    border-radius: 10px !important; 
    background: rgba(0, 0, 0, 0.4) !important; 
    border: 1px solid rgba(255, 255, 255, 0.15) !important; 
    color: #ffffff !important;
    font-size: 15px !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important; /* Verhindert, dass das Feld über den Rand bricht */
}

.modern-input:focus {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid #33a6cc !important;
    box-shadow: 0 0 15px rgba(51, 166, 204, 0.4) !important;
    outline: none !important;
}

/* --- NEU: Button Reparatur --- */
.btn-glass-login {
    width: 100% !important; 
    padding: 15px !important; 
    border-radius: 10px !important; 
    background: #33a6cc !important;
    border: none !important; 
    color: #ffffff !important; 
    font-weight: bold !important; 
    letter-spacing: 1px !important;
    cursor: pointer !important; 
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(51, 166, 204, 0.4) !important;
    margin-top: 10px !important;
}

.btn-glass-login:hover {
    background: #288ba8 !important;
    box-shadow: 0 6px 20px rgba(51, 166, 204, 0.6) !important;
    transform: translateY(-2px) !important;
}

/* 8. Tabellen & Morris */
.table { color: #fff !important; border-spacing: 0 5px !important; border-collapse: separate !important; }
.table tbody tr { background: rgba(255, 255, 255, 0.03) !important; transition: 0.3s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.1) !important; transform: scale(1.002); }

.morris-hover { background: rgba(10, 25, 49, 0.9) !important; backdrop-filter: blur(10px); border-radius: 10px; color: white !important; }

/* Tooltip Fix */
[data-tooltip]::after {
    content: attr(data-tooltip); position: absolute !important;
    background: rgba(0, 0, 0, 0.9) !important; color: #fff !important;
    padding: 6px 12px !important; border-radius: 6px !important;
    font-size: 11px !important; opacity: 0 !important; pointer-events: none !important;
    z-index: 999999 !important; transition: 0.2s;
    transform: translateX(-50%) translateY(10px) translateZ(50px) !important;
}
.footer-dock-btn[data-tooltip]::after { bottom: 60px; left: 50%; }
.footer-dock-btn[data-tooltip]:hover::after { opacity: 1 !important; transform: translateX(-50%) translateY(0) translateZ(50px) !important; }

/* Delays */
body.animations-ready .footer-dock-btn:nth-child(n) { animation-delay: calc(var(--n, 1) * 0.1s); }
body.animations-ready .footer-dock-btn:nth-child(1) { animation-delay: 0.1s; }
body.animations-ready .footer-dock-btn:nth-child(2) { animation-delay: 0.2s; }
body.animations-ready .footer-dock-btn:nth-child(3) { animation-delay: 0.3s; }
body.animations-ready .footer-dock-btn:nth-child(4) { animation-delay: 0.4s; }
body.animations-ready .footer-dock-btn:nth-child(5) { animation-delay: 0.5s; }
body.animations-ready .footer-dock-btn:nth-child(6) { animation-delay: 0.6s; }

/* ==================================================
   9. MODAL GLASSMORPHISM & Z-INDEX REPAIR
   ================================================== */

/* Modal Backdrop (Die dunkle Ebene über der Seite) */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.85) !important;
    z-index: 99990 !important;
}

/* Der unsichtbare Rahmen des Modals */
.modal {
    z-index: 99995 !important;
    transform: none !important;
}

/* Haupt-Container des Modals (Das eigentliche Fenster) */
.modal-content {
    background: rgba(10, 25, 49, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8) !important;
    transform: none !important; 
}

/* Transparente Hintergründe für die Unter-Bereiche */
.modal-header, .modal-body, .modal-footer { background: transparent !important; }
.modal-header { border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; }
.modal-footer { border-top: 1px solid rgba(255, 255, 255, 0.1) !important; }

/* FIX: ALLE inneren weißen Hintergründe killen */
.modal-body * { background-color: transparent !important; }

/* FIX: Ausnahmen für Buttons & Input-Felder */
.modal-body .form-control,
.modal-body input,
.modal-body select,
.modal-body textarea,
.modal-body .input-group-addon {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.modal-body .btn-default { background-color: rgba(255, 255, 255, 0.1) !important; border: 1px solid rgba(255, 255, 255, 0.2) !important; color: #fff !important; }
.modal-body .btn-primary { background-color: #33a6cc !important; border: none !important; color: #fff !important; }
.modal-body .btn-success { background-color: #5cb85c !important; border: none !important; color: #fff !important; }
.modal-body .btn-danger  { background-color: #d9534f !important; border: none !important; color: #fff !important; }

/* FIX: Schriftfarben rigoros auf Weiß zwingen */
.modal-content, .modal-content p, .modal-content span, .modal-content div, 
.modal-content label, .modal-content h1, .modal-content h2, .modal-content h3, 
.modal-content h4, .modal-content h5, .modal-content h6, .modal-content td, 
.modal-content th, .modal-content li, .modal-content a {
    color: #ffffff !important; text-shadow: none !important;
}

/* Schließen-Kreuz (X) reparieren */
.modal-header .close { color: #ffffff !important; text-shadow: none !important; opacity: 0.7 !important; background: transparent !important; }
.modal-header .close:hover { opacity: 1 !important; color: #d9534f !important; }
.modal-body .form-control:focus { border-color: #33a6cc !important; box-shadow: 0 0 10px rgba(51, 166, 204, 0.3) !important; outline: none !important; }

/* ==================================================
   LOADING OVERLAY GLASS-EFFECT
   ================================================== */
.loadingoverlay {
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}
