/* styles.css */

/* Top bar with permission text */
#top-bar {
    width: 100%;
    background-color: #222;
    color: #eaeaea;
    text-align: center;
    padding: 8px 15px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

/* App container to handle SPA layout similar to old frameset */
#app-container {
    display: flex;
    flex-direction: row;
    margin-top: 32px; /* Leave space for top-bar */
    height: calc(100vh - 32px);
    overflow: hidden;
}

/* Sidebar for TOC */
#sidebar {
    width: 280px;
    min-width: 280px;
    background-color: #efefef; 
    padding: 15px 15px 30px 15px;
    box-sizing: border-box;
    overflow-y: auto;
    border-right: 1px solid #aaa;
    font-size: 14px;
}

/* Force TOC styling to ensure aesthetics match the original */
#sidebar .pHeading1TOC {
    font-family: "Times New Roman", Times, serif;
    font-size: 16px;
    margin-left: 0;
    margin-top: 8px;
    margin-bottom: 2px;
}

#sidebar .pHeading2TOC {
    font-family: "Times New Roman", Times, serif;
    font-size: 16px;
    margin-left: 15px;
    margin-top: 2px;
    margin-bottom: 2px;
}

#sidebar a {
    color: #0000ee;
    text-decoration: none;
    line-height: 1.4;
}

#sidebar a:hover {
    text-decoration: underline;
    color: #0000aa;
}

/* Main Content area */
#main-content {
    flex-grow: 1;
    padding: 40px 60px 80px 60px;
    box-sizing: border-box;
    overflow-y: auto;
    background-color: #ffffff;
}

/* Ensure content looks good */
.spa-page {
    /* handled by JS but define smooth transition if desired */
}

/* Specific overrides to keep aesthetics but remove unwanted frame quirks */
body, html {
    margin: 0;
    padding: 0;
    overflow: hidden; /* we handle scrolling inside #sidebar and #main-content */
}

/* Responsive Mobile Layout */
@media screen and (max-width: 768px) {
    #top-bar {
        font-size: 11px;
        padding: 8px 5px;
    }
    
    #app-container {
        flex-direction: column;
        overflow: visible; /* Mobile browsers handle full page scroll better */
        height: auto;
    }
    
    body, html {
        overflow: auto; 
    }
    
    #sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 35vh; /* Let TOC be scrollable at top */
        border-right: none;
        border-bottom: 2px solid #ccc;
        padding: 10px;
    }
    
    #main-content {
        padding: 20px 15px;
        overflow-y: visible; /* Scroll naturally with body */
    }
}
