:root {
    --primary-bg: #2c3e50; /* Dunkelblau */
    --secondary-bg: #34495e; /* Etwas heller */
    --light-bg: #ecf0f1; /* Helles Grau */
    --text-light: #ffffff;
    --text-dark: #333333;
    --border-color: #bdc3c7;
    --accent-color: #3498db; /* Blau */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--light-bg);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Kopfzeile (Header) --- */
.site-header {
    background-color: var(--primary-bg);
    color: var(--text-light);
    padding: 1rem 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-header h1 {
    margin: 0;
    font-size: 2rem;
}

/* --- Navigation --- */
.site-nav {
    background-color: var(--secondary-bg);
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Für mobile Ansicht */
}

.site-nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    padding: 1rem 1.5rem;
    display: block;
    transition: background-color 0.2s ease-in-out;
}

.site-nav ul li a:hover, .site-nav ul li a.active {
    background-color: var(--accent-color);
}

/* --- Hauptcontainer --- */
.site-wrapper {
    display: flex;
    flex: 1; /* Wichtig, damit der Footer unten bleibt */
    padding: 1rem;
    gap: 2rem;
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* --- Hauptinhalt (Main) --- */
.site-content {
    flex: 3; /* Nimmt mehr Platz ein */
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* --- Seitenleiste (Sidebar) --- */
.site-sidebar {
    position: sticky;
    top: 1rem; /* Abstand von oben beim Scrollen */
    flex: 1; /* Nimmt weniger Platz ein */
    align-self: flex-start;
    min-width: 350px;
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.site-sidebar h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 0.5rem;
}

/* --- Fußzeile (Footer) --- */
.site-footer {
    background-color: var(--primary-bg);
    color: var(--text-light);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--accent-color);
    text-decoration: none;
}

.menu {
  width: 100%;
}

.menu-item {
  display: block;
  padding: 10px 16px;
  color: white;
  background-color: #1f2c3d;
  text-decoration: none;
  cursor: pointer;
}

/* Anpassungen */
.submenu {
  display: block;
  background-color: #2c3e50;
}

.submenu h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 0.5rem;
}

.submenu a {
  display: block;
  padding: 8px 24px;
  color: white;
  text-decoration: none;
}

.submenu a:hover {
  background-color: #3d566e;
}

.submenu h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 0.5rem;
}

.layout {
  display: flex;
  flex-direction: row; /* Standard Desktop: Sidebar links */
}

/* Login Hover: grün */
.site-nav ul li a.login-link:hover {
    background-color: #27ae60;
    color: #ffffff;
}

/* Logout Hover: rot */
.site-nav ul li a.logout-link:hover {
    background-color: #e74c3c;
    color: #ffffff;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    display: none; /* nur mobil sichtbar */
}

.cke_notification, .cke_notification_message {
    display: none !important;
}

/* --- Responsive Anpassungen --- */
@media (max-width: 768px) {
    .site-header {
        text-align: left;

         /* NEU: Flexbox, damit Titel links, Burger rechts */
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .site-header h1 {
        margin: 0;
        font-size: 1rem;
    }
    .site-wrapper {
        flex-direction: column;
    }
    
    /* Anpassungen */   
    .layout {
        flex-direction: column;
    }

    .site-sidebar {
        order: -1;
        animation: slideFadeIn 0.4s ease-out;
        position: static !important;
        width: 100%;
        min-width: unset;
        margin-bottom: 0;
        box-sizing: border-box; /* <--- Ergänzt */
    }

    .site-content {
        order: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .menu-toggle {
        display: block;
    }

    .site-nav ul {
        display: none;
        flex-direction: column;
        background-color: var(--secondary-bg);
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .site-nav ul.show {
        display: flex;
    }

    .site-nav ul li a {
        padding: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}


@keyframes slideFadeIn {
  0% {
    opacity: 0;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}