/* Styles specific to the Navigation Menu (Sidebar) */

/* Navigation Container (Scrollable part within the sidebar) */
.nav-scrollable {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(100vh - 60px); /* passt ggf. an, je nach Gesamthöhe/Topbar */
    display: flex;
    flex-direction: column;
    background-color: var(--secondary-background); /* Should match sidebar background */
    padding-top: 0.5rem; /* Keep increased space above the first nav item */
    box-sizing: border-box;
}

/* Webkit Scrollbar */
.nav-scrollable::-webkit-scrollbar {
    width: 6px;
}

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

.nav-scrollable::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 7px;
    transition: background-color 0.3s ease;
}

.nav-scrollable:hover::-webkit-scrollbar-thumb {
    background-color: rgba(var(--accent-color-rgb), 0.3);
}

/* Firefox Scrollbar */
.nav-scrollable {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

.nav-scrollable:hover {
    scrollbar-color: rgba(var(--accent-color-rgb), 0.3) transparent;
}


/* Navigation Items */
.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.2rem; /* Reduced padding */
}

.nav-link {
    color: var(--primary-text) !important;
    background: transparent;
    border-radius: 7px;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.2rem; /* Adjusted padding */
    margin: 0.2rem 0.5rem; /* Added horizontal margin */
    text-decoration: none;
    /* white-space: nowrap; Removed to allow wrapping */
}

/* Style for the text span inside the nav link */
.nav-link span {
    white-space: normal; /* Allow text wrapping */
    word-break: break-word; /* Break long words if necessary */
    flex-grow: 1; /* Allow text to take available space */
    text-align: left; /* Ensure text aligns left */
}


.nav-link:hover {
    color: var(--accent-color) !important;
    background: rgba(var(--accent-color-rgb), 0.1);
    transform: translateX(5px);
}

.nav-link.active {
    color: var(--accent-color) !important;
    background: rgba(var(--accent-color-rgb), 0.15);
    font-weight: 500;
    box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.1);
}

/* Section Styling */
.nav-section {
    margin: 0.5rem 0 0.8rem 0; /* Reduzierter unterer Abstand */
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.05);
    padding-bottom: 0.8rem;
}

.nav-section:last-child {
    border-bottom: none; /* No border for the last section */
    margin-bottom: 1rem; /* Ensure some space at the bottom */
}


.section-header {
    color: var(--accent-color);
    font-size: 0.85rem; /* Slightly smaller */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 1rem 1.2rem 0.6rem 1.2rem; /* Adjusted padding */
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.3rem; /* Reduced margin */
}

.section-header.secure,
.section-header.classified {
    /* Keep text-shadow if desired, but color is already accent */
    text-shadow: 0 0 8px rgba(var(--accent-color-rgb), 0.2);
}

/* MudBlazor Icon Styling */
.nav-icon {
    color: currentColor !important; /* Inherit color from parent (.nav-link or .section-header) */
    transition: transform 0.3s ease;
    font-size: 1.1rem !important; /* Slightly smaller icons */
    min-width: 20px; /* Adjusted min-width */
    opacity: 0.8; /* Slightly less prominent */
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    transform: translateX(3px);
    opacity: 1; /* Full opacity on hover/active */
}

.section-header .nav-icon {
    font-size: 1.2rem !important; /* Keep section header icons slightly larger */
    opacity: 1;
}

/* Styles for the new sidebar header */
.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem; /* Consistent padding */
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.1); /* Separator line */
    margin-bottom: 0; /* Remove bottom margin, handled by padding/border */
    height: auto; /* Let content determine height, but use min-height */
    min-height: var(--top-bar-height); /* Ensure it's at least the old top bar height */
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent header from shrinking */
    /* position: absolute; Removed */
    /* top: 0; Removed */
    /* left: 0; Removed */
    /* right: 0; Removed */
    /* z-index: 1; Removed */
    overflow: hidden; /* Prevent potential overflow issues */
}

.sidebar-logo {
    height: 2rem; /* Same as old navbar-logo */
    width: auto;
    margin-right: 1rem;
    object-fit: contain;
}

/* Remove default link styling from header */
.sidebar-header-link {
    text-decoration: none;
    color: inherit; /* Inherit color from children */
    display: block; /* Ensure it takes up block space */
}

.sidebar-header-link:hover {
    /* Optional: Add subtle hover effect if desired, e.g., background change on .sidebar-header */
}


/* New styles for the title container and lines */
.sidebar-title-container {
    display: flex;
    flex-direction: column;
    line-height: 1.2; /* Adjust line height for stacked text */
    overflow: hidden; /* Prevent text overflow */
}

.sidebar-title-main {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 8px rgba(var(--accent-color-rgb), 0.2);
}

.sidebar-title-sub {
    color: rgba(var(--primary-text-rgb), 0.8); /* Slightly dimmer sub-title */
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Styles for a hamburger menu button (now likely inside sidebar or main content) */
.menu-toggle-button {
    /* Styles for the button to show/hide sidebar on mobile/tablet */
    display: none; /* Hidden by default */
    background: none;
    border: none;
    color: var(--primary-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto; /* Pushes it to the right */
}

/* Responsive adjustments for sidebar header */
@media (max-width: 1024px) {
    /* Keep header visible, maybe adjust padding */
    .sidebar-header {
        padding: 0.8rem 1rem;
        /* height: calc(...); Removed - Let content define height */
        min-height: calc(var(--top-bar-height) - 0.4rem); /* Adjust min-height */
    }

    .nav-scrollable {
        /* top: calc(...); Removed */
        padding-top: 1rem; /* Adjust padding if header height changes */
    }

    .sidebar-title-main {
        font-size: 1rem; /* Adjust main title size */
    }

    .sidebar-title-sub {
        font-size: 0.8rem; /* Adjust sub title size */
    }

    /* Hamburger button logic might change depending on where it's placed */
    .menu-toggle-button {
        display: block !important; /* Force display on smaller screens */
    }

    /* Ensure title stays on one line */
    .sidebar-title-container {
        flex-direction: row;
        align-items: baseline; /* Align text nicely */
        gap: 0.5rem; /* Add space between main and sub title */
        white-space: nowrap; /* Prevent the container row itself from wrapping */
    }
}

@media (max-width: 480px) {
    .sidebar-header {
        padding: 0.6rem 0.8rem;
        /* height: var(...); Removed - Let content define height */
        min-height: var(--top-bar-height); /* Use mobile top-bar height for min-height */
    }

    .nav-scrollable {
        /* top: var(...); Removed */
        padding-top: 0.8rem; /* Adjust padding if header height changes */
    }

    .sidebar-title-container {
        /* Ensure title stays on one line even on smallest screens (though sub is hidden) */
        /* line-height: 1.1; Remove line-height */
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem; /* Gap won't show as sub is hidden, but consistent */
        white-space: nowrap;
    }

    .sidebar-title-main {
        font-size: 0.9rem;
    }

    .sidebar-title-sub {
        /* display: none; Keep sub-title visible */
        font-size: 0.75rem; /* Maybe make it slightly smaller */
    }

    .sidebar-logo {
        margin-right: 0.5rem; /* Restore some margin */
    }

    .menu-toggle-button {
        font-size: 1.3rem;
    }
}

/* Unauffällige Version-Section am unteren Rand des NavMenus */
.nav-version-section {
    margin-top: auto;
    padding: 0.5rem 1.2rem 1.2rem 1.2rem;
    font-size: 0.9rem;
    color: var(--primary-text, #DBCFB9);
    opacity: 0.88;
    text-align: center;
    background: var(--secondary-background, #191a20);
    letter-spacing: 0.01em;
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    align-items: center;
    border-top: none;
}

.nav-version-centered {
    width: 100%;
    text-align: center;
    font-family: inherit;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    opacity: 0.85;
    margin-bottom: 0.2em;
    margin-top: 0;
    padding: 5px 10px;
}

.nav-version-label {
    font-weight: 500;
    display: inline;
    margin-right: 0.5em;
    color: var(--primary-text, #DBCFB9);
    opacity: 0.9;
}

.nav-version-value {
    display: inline;
    margin-right: 0.5em;
    color: var(--primary-text, #DBCFB9);
    opacity: 0.9;
}

.nav-version-commit {
    display: inline;
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: 0.5em;
    color: var(--primary-text, #DBCFB9);
}

.nav-version-outdated {
    color: var(--accent-color, #E4A738);
    margin-top: 0.3em;
    font-size: 0.8rem;
}

.nav-version-reload-btn {
    margin-top: 0.25em;
    background: none;
    color: var(--primary-text, #DBCFB9);
    border: none;
    font-size: 0.75rem;
    opacity: 0.85;
    padding: 2px 10px 2px 7px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.3em;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.18s, color 0.18s, opacity 0.18s;
    outline: none;
    box-shadow: none;
}

.accent-color {
    color: var(--accent-color, #E4A738);
}

.outdated-marker {
    color: var(--error-color, #FF5252);
    font-size: 0.9em;
}

.version-text {
    font-size: 0.75rem; /* Gleiche Größe wie der Button-Text */
}

.client-version {
    margin-bottom: 3px;
}

.server-version {
    margin-top: 2px;
    margin-bottom: 2px;
}

.nav-version-reload-btn:hover, .nav-version-reload-btn:focus {
    background: rgba(228, 167, 56, 0.12);
    opacity: 1;
    color: var(--accent-color, #E4A738);
}

.nav-version-reload-text {
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    font-weight: 500;
}
