/* Basic Reset & Body Styles */
html {
    box-sizing: border-box;
    /* scroll-behavior: smooth; */ /* CSS smooth scrolling is less reliable with iframes */
}
*, *:before, *:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #e9e9e9;
    color: #333;
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
}

/* Main Layout Container */
.container {
    display: flex;
    width: 100%;
}

/* Navigator Sidebar */
.navigator {
    width: 300px;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
    background-color: #000000;
    color: #e0e0e0;
    padding: 1rem; /* Adjusted padding slightly */
    border-right: 1px solid #444;
    font-size: 0.9rem;
    display: flex; /* Use flexbox for header/list structure */
    flex-direction: column;
}

.navigator-header {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
    margin-bottom: 1rem;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.navigator-header h1, .navigator-header h2 {
    margin: 0 0 0.5rem 0; /* Added bottom margin */
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #ffffff;
    text-align: center;
}

/* Search Container and Input */
.search-container {
    margin-top: 0.5rem; /* Reduced top margin */
}

#navigator-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #555;
    background-color: #2f3237; /* Slightly lighter input background */
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
}

#navigator-search::placeholder {
    color: #888;
}

/* Navigator Lists - Make the UL scrollable within the remaining space */
.navigator ul#navigator-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1; /* Allow list to take remaining space */
    overflow-y: auto; /* Make the list itself scrollable */
    margin-top: 0.5rem; /* Add some space above the list */
}


.navigator ul ul { /* Nested lists */
    padding-left: 18px;
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
    border-left: 1px solid #444;
}

.navigator li {
    margin-bottom: 0.1rem;
}

/* Class to hide list items */
.navigator li.hidden {
    display: none;
}


/* Navigator Links */
.navigator a {
    text-decoration: none;
    color: #b0b0b0;
    display: block;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.navigator a:hover {
    background-color: #000000;
    color: #ffffff;
}

/* Active link style */
.navigator a.active {
    font-weight: bold;
    color: #4dabf7;
    background-color: #000000;
    border-left: 3px solid #4dabf7;
    padding-left: 7px;
}

/* Content Area & Iframe */
.content {
    flex-grow: 1;
    height: 100vh;
    overflow: hidden;
}

.content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .navigator {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .navigator {
        width: 100%;
        height: auto;
        max-height: 45vh;
        position: sticky;
        top: 0;
        z-index: 100;
        border-right: none;
        border-bottom: 1px solid #444;
        /* Ensure header and list structure works in column layout */
        overflow: hidden; /* Prevent parent scrollbar, rely on ul scroll */
    }
    .navigator ul#navigator-list {
         max-height: calc(45vh - 100px); /* Adjust based on header/search height */
         overflow-y: auto;
    }
    .content {
        height: auto;
        min-height: 55vh;
        overflow: auto;
    }
     .content iframe {
         min-height: 55vh;
     }
}