/* static/css/global_styles.css */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Top Navbar */
.top-navbar {
    background-color: #333;
    color: #fff;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-navbar .logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}
.top-navbar .logo img {
    margin-right: 0.5rem;
    vertical-align: middle;
}
.top-navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}
.top-navbar ul li {
    margin-left: 15px;
    position: relative;
}
.top-navbar ul li a {
    color: #fff;
    text-decoration: none;
}
.top-navbar li ul {
    position: absolute;
    background-color: #333;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    min-width: 180px;
    top: 100%;
    left: 0;
    z-index: 10;
}
.top-navbar li ul li {
    margin-left: 0;
}
.top-navbar li ul li a {
    padding: 0.3rem 0.5rem;
    display: block;
}
.top-navbar li.show > ul {
    display: flex;
}
.top-navbar ul li a:hover,
.top-navbar .link-button:hover {
    text-decoration: underline;
}
.top-navbar .link-button {
    background: none;
    border: none;
    color: #fff; /* Match link color */
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-size: 1em; /* Ensure it matches other nav items */
}


/* Main Layout with Sidebars */
.main-layout {
    display: flex;
    flex-grow: 1; /* Allows this section to take up available space */
    width: 100%;
    max-width: 1400px; /* Optional: constrain overall width */
    margin: 0 auto; /* Center layout if max-width is set */
    background-color: #fff;
}

.left-sidebar {
    background-color: #e9e9e9;
    padding: 1rem;
    width: 200px; /* Fixed width for sidebar */
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    border-right: 1px solid #ddd;
}
.left-sidebar h3 {
    margin-top: 0;
    color: #555;
}
.left-sidebar ul {
    list-style: none;
    padding: 0;
}
.left-sidebar ul li a {
    text-decoration: none;
    color: #337ab7;
    display: block;
    padding: 0.3rem 0;
}
.left-sidebar li ul {
    padding-left: 15px;
}
.left-sidebar li {
    margin-bottom: 0.2rem;
}
.left-sidebar ul li a:hover {
    text-decoration: underline;
}


.main-content {
    padding: 1.5rem;
    flex-grow: 1; /* Main content takes remaining space */
    overflow-y: auto; /* Add scroll if content overflows */
}
.main-content h1, .main-content h2 {
    color: #333;
}

.right-sidebar {
    background-color: #f0f0f0;
    padding: 1rem;
    width: 220px; /* Fixed width for sidebar */
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    border-left: 1px solid #ddd;
}
.right-sidebar h3, .right-sidebar h4 {
    margin-top: 0;
    color: #555;
}
.right-sidebar .update-item, .right-sidebar .ad-placeholder {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}


/* Footer */
.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 1rem;
    margin-top: auto; /* Pushes footer to the bottom if content is short */
}
.site-footer p {
    margin: 0.3rem 0;
}
.site-footer a {
    color: #ecf0f1;
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}

/* Utility class for link-like buttons (already used in top-navbar) */
.link-button {
    background: none;
    border: none;
    color: #337ab7; /* Default link color */
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font: inherit;
}
.link-button:hover {
    color: #23527c; /* Darker link color on hover */
}

/* Nested navigation (used in top and side navs) */
.nav-with-submenu ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.nav-with-submenu li {
    position: relative;
}

.nav-with-submenu li ul {
    display: none;
    padding-left: 15px;
}

.nav-with-submenu li.show > ul {
    display: block;
}

.nav-with-submenu a.toggle-submenu::after {
    content: '▸';
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.nav-with-submenu li.show > a.toggle-submenu::after {
    transform: rotate(90deg);
}

/* Responsive considerations (very basic examples) */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    .left-sidebar, .right-sidebar {
        width: 100%;
        border-left: none;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    .top-navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .top-navbar ul {
        margin-top: 0.5rem;
        flex-direction: column;
    }
    .top-navbar ul li {
        margin-left: 0;
        margin-bottom: 0.3rem;
    }
}
