/* ==========================================================
   ÖFFENTLICHES NAVIGATIONSMENÜ - CSS
   Responsive Sidebar mit Hamburger-Menü für Mobile
   ========================================================== */

/* ========== Basis-Styles ========== */

/* Mobile Hamburger Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    width: 50px;
    height: 50px;
    background: var(--white, #ffffff);
    border: 2px solid var(--border-color, #e1e8ed);
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color, #333);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--accent-color, #3498db);
    border-color: var(--accent-color, #3498db);
}

.mobile-menu-toggle:hover span {
    background: #ffffff;
}

/* Hamburger Animation wenn aktiv */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* ========== Sidebar Navigation ========== */
.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--white, #ffffff);
    border-right: 1px solid var(--border-color, #e1e8ed);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

/* Scrollbar Styling */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color, #e1e8ed);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--text-light, #666);
}

/* ========== Sidebar Header ========== */
.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color, #e1e8ed);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-color, #2c3e50);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    white-space: nowrap;
}

/* Close Button (nur mobile) */
.sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== Sidebar Search ========== */
.sidebar-search {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color, #e1e8ed);
    display: flex;
    gap: 0.5rem;
}

.sidebar-search-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--background, #f8f9fa);
    color: var(--text-color, #333);
    transition: all 0.2s ease;
}

.sidebar-search-input:focus {
    outline: none;
    border-color: var(--accent-color, #3498db);
    background: var(--white, #ffffff);
}

.sidebar-search-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--accent-color, #3498db);
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.sidebar-search-btn:hover {
    background: var(--primary-color, #2c3e50);
}

/* ========== Sidebar Menu ========== */
.sidebar-menu {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    flex: 1;
}

/* ========== Menu Items ========== */
.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-color, #333);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 0.75rem;
}

.menu-link:hover {
    background: var(--background, #f8f9fa);
    color: var(--accent-color, #3498db);
}

.menu-item.active > .menu-link {
    background: var(--accent-color, #3498db);
    color: #ffffff;
    border-left: 4px solid var(--primary-color, #2c3e50);
}

.menu-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.menu-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.menu-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

/* Untermenü offen - Arrow Animation */
.menu-item.has-submenu.open > .menu-link .menu-arrow {
    transform: rotate(180deg);
}

/* ========== Submenu ========== */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--background, #f8f9fa);
}

.menu-item.has-submenu.open > .submenu {
    max-height: 500px;
}

.submenu-item {
    position: relative;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem 0.75rem 3rem;
    color: var(--text-light, #666);
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.submenu-link:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--accent-color, #3498db);
    padding-left: 3.25rem;
}

.submenu-item.active .submenu-link {
    color: var(--accent-color, #3498db);
    font-weight: 600;
    background: rgba(52, 152, 219, 0.1);
}

.submenu-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.submenu-text {
    flex: 1;
}

/* ========== Sidebar Footer ========== */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color, #e1e8ed);
    background: var(--background, #f8f9fa);
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.theme-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--border-color, #e1e8ed);
    background: var(--white, #ffffff);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent-color, #3498db);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-btn.active {
    background: var(--accent-color, #3498db);
    border-color: var(--accent-color, #3498db);
}

/* ========== Content Wrapper (für Seiten mit Sidebar) ========== */
body.has-sidebar {
    margin-left: 280px;
}

body.has-sidebar .main-content {
    min-height: 100vh;
    padding: 2rem;
}

/* ========== Responsive Styles ========== */

/* Tablet und kleiner */
/*@media (max-width: 1024px) {
    .sidebar-nav {
        width: 260px;
    }
    
    body.has-sidebar {
        margin-left: 260px;
    }
}
*/
/* Mobile */
@media (max-width: 2000px) {
    /* Zeige Hamburger Button */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Sidebar verstecken und als Overlay anzeigen */
    .sidebar-nav {
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 1060;
    }
    
    .sidebar-nav.active {
        transform: translateX(0);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    }
    
    /* Zeige Close Button auf Mobile */
    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Kein margin für body auf mobile */
    body.has-sidebar {
        margin-left: 0;
    }
    
    /* Verhindere Scrollen wenn Menü offen */
    body.menu-open {
        overflow: hidden;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
    .sidebar-nav {
        width: 85%;
        max-width: 320px;
    }
    
    .sidebar-logo {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
}

/* ========== Dark Theme Support ========== */
[data-theme="dark"] .sidebar-nav {
    background: var(--white, #1e1e1e);
    border-right-color: var(--border-color, #2d2d2d);
}

[data-theme="dark"] .sidebar-header {
    background: var(--primary-color, #1a252f);
}

[data-theme="dark"] .sidebar-search-input {
    background: var(--background, #121212);
}

[data-theme="dark"] .submenu {
    background: var(--background, #121212);
}

[data-theme="dark"] .sidebar-footer {
    background: var(--background, #121212);
}

/* ========== Print Styles ========== */
@media print {
    .sidebar-nav,
    .mobile-menu-toggle,
    .mobile-menu-overlay {
        display: none !important;
    }
    
    body.has-sidebar {
        margin-left: 0 !important;
    }
}

/* ========== Accessibility ========== */
.menu-link:focus,
.submenu-link:focus,
.theme-btn:focus,
.sidebar-search-input:focus,
.sidebar-search-btn:focus {
    outline: 2px solid var(--accent-color, #3498db);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .sidebar-nav,
    .menu-link,
    .submenu-link,
    .submenu,
    .menu-arrow,
    .theme-btn,
    .mobile-menu-toggle span,
    .mobile-menu-overlay {
        transition: none;
    }
}
