/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Light text */
    line-height: 1.6;
    display: flex; /* Use flexbox for layout */
}

a {
    color: #64b5f6; /* Light blue links */
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.container {
    display: flex;
    width: 100%;
    max-width: 1600px; /* Max width for larger screens */
    margin: 0 auto; /* Center container */
}

/* --- Navigation (Right Hand Side) --- */
.main-nav {
    background-color: #262626;
    padding: 20px 15px;
    width: 220px; /* Fixed width for RHS nav */
    order: 1; /* Move nav to the left */
    height: 100vh; /* Full height */
    position: sticky; /* Stick to the top */
    top: 0;
    overflow-y: auto; /* Allow scrolling if content exceeds height */
}

.main-nav ul {
    list-style: none;
}

.main-nav li {
    margin-bottom: 10px;
}

.main-nav a {
    display: block;
    padding: 8px 10px;
    color: #ccc;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active { /* Add .active class via PHP for current page */
    background-color: #3a3a3a;
    color: #fff;
    text-decoration: none;
}

/* Navigation dividers */
.main-nav hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #444;
    opacity: 0.5;
}

.mobile-menu-toggle {
    display: none; /* Hidden by default */
    background: #444;
    color: #eee;
    border: none;
    font-size: 1.5em;
    padding: 5px 10px;
    cursor: pointer;
    margin-bottom: 15px;
}

/* --- Main Content Area --- */
.main-content {
    flex-grow: 1; /* Take remaining space */
    padding: 20px 30px;
    order: 2; /* Place content on the right */
}


h1, h2, h3 {
    color: #ffffff;
    margin-bottom: 0.8em;
    border-bottom: 1px solid #444;
    padding-bottom: 0.3em;
}

/* --- Search --- */
.search-container {
    margin-bottom: 20px;
    position: relative; /* For positioning live results */
}
.search-container label {
    margin-right: 10px;
}
.search-container input[type="search"] {
    padding: 8px 12px;
    border: 1px solid #444;
    background-color: #2f2f2f;
    color: #e0e0e0;
    border-radius: 4px;
    min-width: 300px;
}

.search-results-live {
    position: absolute;
    top: 100%; /* Position below the input */
    left: 0;
    right: 0; /* Adjust if label pushes input */
    background-color: #333;
    border: 1px solid #555;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 10;
    max-height: 300px;
    overflow-y: auto;
    display: none; /* Hidden initially */
     margin-left: 90px; /* Approximate alignment - adjust as needed */
     max-width: 324px; /* Match input width roughly */
}
.search-results-live ul {
     list-style: none;
     padding: 0;
     margin: 0;
}
.search-results-live li a {
    display: block;
    padding: 8px 12px;
    color: #ccc;
}
.search-results-live li a:hover {
    background-color: #4a4a4a;
    color: #fff;
    text-decoration: none;
}
.search-results-live p { /* Style for 'No results' */
    padding: 8px 12px;
    font-style: italic;
    color: #999;
}
.search-results-live .view-all-results {
    text-align: center;
    padding: 8px;
    background-color: #404040;
    border-top: 1px solid #555;
}
.search-results-live .view-all-results a {
    font-weight: bold;
    color: #8bc34a; /* Different color for distinction */
}

/* Forms */
input, textarea, select, button {
    font-family: inherit;
    font-size: 1em;
    background-color: #2f2f2f;
    color: #e0e0e0;
    border: 1px solid #444;
    padding: 8px;
    border-radius: 4px;
}
button {
    cursor: pointer;
    background-color: #0d6efd; /* Example button color */
    border-color: #0d6efd;
    color: white;
    padding: 8px 15px;
}
button:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Utilities */
.error {
    color: #f44336; /* Red for errors */
    font-weight: bold;
}
.success {
     color: #4CAF50; /* Green for success */
     font-weight: bold;
}

/* --- Responsive (Mobile Menu) --- */
@media (max-width: 768px) {
    .container {
        flex-direction: column; /* Stack elements vertically */
    }

    .main-nav {
        width: 100%; /* Full width */
        order: 1; /* Nav on top */
        position: relative; /* Reset sticky */
        height: auto; /* Auto height */
        border-bottom: 1px solid #444;
    }

    .mobile-menu-toggle {
        display: block; /* Show the toggle button */
    }

    .main-nav ul {
        display: none; /* Hide the menu by default */
        flex-direction: column; /* Stack links vertically */
        width: 100%;
    }

    .main-nav ul.open { /* Class added by JS to show menu */
        display: flex;
    }

     .main-content {
        order: 2; /* Content below nav */
        padding: 15px;
    }

    .search-container input[type="search"] {
        min-width: 0; /* Allow shrinking */
        width: calc(100% - 100px); /* Adjust width */
    }
     .search-results-live {
        width: 100%;
        margin-left: 0;
        max-width: none;
    }
}