/* /app/frontend/css/style.css */

/* =============================================================================
   OPSWATER - HAUPTLAYOUT & STRUKTUR (STYLE.CSS)
   Architektur-Standard: Blaulicht-Schmiede / 10-Jahres-Wartbarkeit
   Verantwortlich: App-Container, Sidebar, Top-Bar & iFrame-Wrapper
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. IMPORT DES ZENTRALEN DESIGN-SYSTEMS
   WARUM: Lädt Farb-Tokens und Komponenten für jede Seite automatisch mit.
   ----------------------------------------------------------------------------- */
@import url('theme.css');
@import url('components.css');

/* -----------------------------------------------------------------------------
   2. BASIS-LAYOUT & HINTERGRUND
   WARUM: Fullscreen-Applikation mit fixiertem Feuerwehr-Hintergrundbild.
   ----------------------------------------------------------------------------- */
body {
    margin: 0;
    font-family: var(--font-family-base);
    height: 100vh;
    overflow: hidden;
    color: var(--text-main);
    background: url('../graphics/background.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* -----------------------------------------------------------------------------
   3. APP-CONTAINER & HAUPT-RAHMEN
   WARUM: 2-Spalten-Flexbox-Layout (Sidebar links, dynamischer Inhalt rechts).
   ----------------------------------------------------------------------------- */
.app-container {
    display: flex;
    height: 100vh;
    padding: 20px;
    gap: 20px;
    box-sizing: border-box;
}

/* -----------------------------------------------------------------------------
   4. SIDEBAR NAVIGATION
   WARUM: Feste linke Spalte für Modulwechsel, App-Branding & Logout.
   ----------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    border-radius: var(--radius-2xl);
    display: flex;
    flex-direction: column;
    padding: 25px;
    transition: all 0.3s ease;
    overflow-x: hidden;
    box-sizing: border-box;
    background: var(--glass-bg-default);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.sidebar-bottom-container {
    width: 100%;
    margin-top: auto;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-xl);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    transform: translateX(5px);
    border: 1px solid var(--glass-border);
}

.nav-item .icon { font-size: 1.2rem; }

/* Logout-Button: Auffällig rot am Ende der Navigation */
.logout-btn {
    margin-top: auto;
    background: var(--brand-gradient);
    color: #ffffff !important;
    justify-content: flex-start;
    box-shadow: 0 4px 15px rgba(227, 6, 19, 0.4);
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}
.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(227, 6, 19, 0.6);
}

/* -----------------------------------------------------------------------------
   5. RECHTER CONTENT-BEREICH (MAIN CONTENT & TOP-BAR)
   WARUM: Beherbergt die Kopfzeile und den flexiblen iFrame-Container.
   ----------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    border-radius: var(--radius-2xl);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: var(--glass-bg-default);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.top-bar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid var(--glass-border);
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
}

.user-avatar {
    width: 35px; height: 35px;
    background: var(--brand-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    color: #ffffff;
}

.org-badge {
    background: var(--brand-primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7em;
    margin-left: 5px;
    vertical-align: middle;
}

.content-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* -----------------------------------------------------------------------------
   6. BRANDING: ANIMIERTER WASSERTROPFEN (OPSEFFECT)
   WARUM: 6s Physik-Choreografie (Glühen -> Sprung -> Aufprall -> Wellenringe)
   ----------------------------------------------------------------------------- */
.opswater-drop-stage {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    vertical-align: middle;
}

.opswater-water-drop {
    display: inline-block;
    user-select: none;
    transform-origin: bottom center;
    animation: dropJumpPhysics 6s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
}

@keyframes dropJumpPhysics {
    /* 0% - 50%: Ruhige Schwebephase & Atmen mit Glow */
    0%, 48% {
        transform: translateY(0) scale(1, 1);
        filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8)) drop-shadow(0 0 14px rgba(14, 165, 233, 0.4));
    }
    25% {
        transform: translateY(-2px) scale(1.04, 0.98);
        filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.95)) drop-shadow(0 0 18px rgba(14, 165, 233, 0.6));
    }

    /* 52%: Vorbereitung / Einknicken */
    52% {
        transform: translateY(2px) scale(1.1, 0.9);
        filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.3));
    }

    /* 58%: Sprung nach oben */
    58% {
        transform: translateY(-16px) scale(0.9, 1.15);
        filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.1));
    }

    /* 64%: Fall nach unten */
    64% {
        transform: translateY(6px) scale(0.95, 1.1);
        filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.1));
    }

    /* 67%: Aufprall & Stauchung (Squish) */
    67% {
        transform: translateY(8px) scale(1.35, 0.65);
        filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.7));
    }

    /* 73%: Elastischer Rebound */
    73% {
        transform: translateY(-5px) scale(0.95, 1.08);
        filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.3));
    }

    /* 80%: Nachfedern */
    80% {
        transform: translateY(1px) scale(1.03, 0.97);
        filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.5));
    }

    /* 88% - 100%: Rückkehr in Ruhephase */
    88%, 100% {
        transform: translateY(0) scale(1, 1);
        filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8)) drop-shadow(0 0 14px rgba(14, 165, 233, 0.4));
    }
}

/* Wasserwellen-Ringe beim Aufprall */
.drop-ripple {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 44px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid rgba(56, 189, 248, 0.85);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
    opacity: 0;
    pointer-events: none;
    animation: rippleImpact 6s cubic-bezier(0.1, 0.7, 0.1, 1) infinite;
}

.drop-ripple-delayed {
    animation-delay: 0.18s;
}

@keyframes rippleImpact {
    0%, 65% {
        transform: translateX(-50%) scale(0.2);
        opacity: 0;
    }
    67% {
        transform: translateX(-50%) scale(0.3);
        opacity: 0.95;
    }
    82% {
        transform: translateX(-50%) scale(1.5);
        opacity: 0;
        border-width: 1px;
    }
    100% {
        transform: translateX(-50%) scale(1.8);
        opacity: 0;
    }
}