body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    height: 100vh;
    background-color: #f4f4f9;
}

* {
    box-sizing: border-box;
}

/* Sidebar */
#sidebar {
    width: fit-content;
    min-width: 80px;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ddd;
    overflow-y: auto;
}

#reader-view {
    display: flex;
    height: 100vh;
}

#book-list-view {
    height: 100vh;
    padding: 24px;
}

#sidebar h2 {
    padding: 15px 5px;
    font-size: 0.7rem;
    text-align: center;
    text-transform: uppercase;
    border-bottom: 1px solid #34495e;
    margin: 0;
    opacity: 0.7;
}

.page-link {
    padding: 15px 0;
    cursor: pointer;
    transition: background 0.3s;
    border-bottom: 1px solid #34495e;
    text-align: center;
    font-size: 1.1rem;
    white-space: nowrap;
}

.page-link:hover { background-color: #34495e; }
.page-link.active { background-color: #3498db; font-weight: bold; }

/* Main Layout */
#main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Language Toggle Bar */
#top-bar {
    background: white;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.toggle-container {
    display: flex;
    background: #eee;
    border-radius: 20px;
    padding: 4px;
}

.lang-btn {
    border: none;
    padding: 8px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    background: transparent;
    transition: 0.3s;
}

.lang-btn.active {
    background: #27ae60; /* Changed to green for a fresh look */
    color: white;
}

/* Content Area */
#content-container {
    flex-grow: 1;
    padding: 0;
    overflow-y: auto;
    display: flex;
    justify-content: flex-start;
}

#page-content {
    max-width: none;
    width: 100%;
    background: white;
    padding: 4px;
    box-shadow: none;
    border: 2px solid #ddd;
    line-height: 1.8;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#page-header {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    gap: 16px;
    padding: 0;
}

#page-number {
    color: #2c3e50;
    opacity: 0.75;
}

#page-title {
    text-align: center;
    flex: 1;
    margin: 0;
    font-weight: normal;
}

#page-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Assamese text sometimes needs a slightly larger font size for readability */
.assamese-text {
    font-size: 1.2rem;
    line-height: 2;
}

h1 { color: #2c3e50; margin-top: 0; }
