﻿
/*

    Yeah, it can be the controls. Bootstrap inputs/selects are `width:100%`, and some (like color input, long selects) can push the column wider unless you allow the column to shrink.

Try these tiny fixes—no refactor:

```html
<div class="row g-4 align-items-start flex-nowrap">  <!-- stop wrapping -->
  <div class="col-6" style="min-width:0;"> … </div> <!-- allow shrink -->
  <div class="col-6" style="min-width:0;"> … </div>
</div>
```
.col-6 > * {
    min-width: 0;
}


.form-control,
.form-select,
.form-control-color {
    max-width: 100%;
}


.row.g-4.align-items-start {
    --bs-gutter-x: 1rem;
}

```

If you want stacking on phones but not wrap-caused stacking: use `col-md-6` on both and keep `flex-nowrap` + `min-width:0`.



*/



body {
    background-color: #f6f6f6;
}

.sidebar {
    width: 250px;
    position: fixed;
    top: 80px; /* Adjust for fixed header height */
    left: 0;
    height: calc(100vh - 80px); /* Adjust height for fixed header */
    background-color: #fff;
    padding-top: 20px;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    z-index: 999; /* Ensure sidebar is below header but above main content */
}

.main-content {
    margin-left: 250px;
    padding: 20px;
    padding-top: 80px; /* Offset for the fixed header */
    flex-grow: 1; /* Allow it to grow */
    box-sizing: border-box; /* Include padding in element's total width and height */
}

.top-navbar {
    background-color: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed; /* Keep top bar fixed */
    top: 80px; /* Position below the main header */
    left: 250px; /* Offset for the fixed sidebar */
    right: 0;
    z-index: 1000;
}


.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-bar {
    flex-grow: 1;
    margin: 0 20px;
}

    .search-bar .input-group {
        max-width: 700px;
        margin: 0 auto;
    }

.book-section-list .list-group-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap; /* Allow wrapping for buttons on smaller screens */
    transition: background-color 0.2s ease-in-out;
    cursor: pointer; /* Indicate it's clickable */
}

    .book-section-list .list-group-item:hover {
        background-color: #f5f5f5;
    }

    .book-section-list .list-group-item .form-check {
        margin-right: 15px;
    }

.book-section-list .section-title {
    flex-grow: 1;
    font-weight: bold;
    margin-right: 10px;
    min-width: 150px; /* Ensure title has some width */
}

.book-section-list .section-summary {
    flex-grow: 2;
    color: #555;
    /* text-truncate; */ /* Use text-truncate if you want to keep it on one line */
    margin-right: 10px;
}

.book-section-list .last-edited {
    width: 100px; /* Fixed width for date */
    text-align: right;
    font-size: 0.9em;
    color: #777;
    white-space: nowrap; /* Prevent date from wrapping */
    margin-left: auto; /* Push to the right */
}

.book-section-actions {
    display: flex;
    gap: 5px; /* Spacing between buttons */
    margin-left: 15px; /* Space from date */
}

    .book-section-actions .btn {
        padding: 5px 10px;
        font-size: 0.85em;
    }


.sidebar .nav-link {
    padding: 8px 20px;
    color: #333;
    display: flex;
    align-items: center;
}

    .sidebar .nav-link.active {
        background-color: #e8f0fe;
        color: #1a73e8;
        border-radius: 0 50px 50px 0;
        font-weight: 600;
    }

    .sidebar .nav-link i {
        margin-right: 15px;
        width: 20px;
    }

.generate-btn {
    background-color: #cfe2ff;
    color: #000;
    border-radius: 25px;
    padding: 10px 20px;
    font-weight: 500;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.302), 0 1px 3px 1px rgba(60,64,67,0.149);
    margin-bottom: 20px;
    margin-left: 20px;
}

.categories-header {
    padding: 10px 20px;
    font-weight: bold;
    color: #555;
    font-size: 0.9em;
}

.label-item {
    padding: 5px 20px 5px 40px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .label-item:hover {
        background-color: #f5f5f5;
    }

    .label-item .badge {
        min-width: 25px;
        text-align: center;
    }



.nav-tabs .nav-link {
    color: #5f6368;
    border: none;
    transition: color 0.2s ease-in-out, border-bottom 0.2s ease-in-out;
}


    .nav-tabs .nav-link.active {
        color: #1a73e8;
        border-bottom: 2px solid #1a73e8;
        font-weight: 500;
    }

.top-right-icons .btn {
    background: none;
    border: none;
    color: #5f6368;
    padding: 8px;
}

    .top-right-icons .btn:hover {
        background-color: #f0f0f0;
        border-radius: 50%;
    }

.profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #4285f4;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1em;
}

/* Styles for the Section Editor */
.section-editor-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section-editor-textarea {
    width: 100%;
    min-height: 400px;
    border: 1px solid #ddd;
    padding: 15px;
    font-family: 'Georgia', serif; /* Simulates a book-like font */
    font-size: 1.1em;
    line-height: 1.6;
    resize: vertical;
}

/* Preview Draft specific styles */
.book-preview-area {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-height: 600px;
    overflow-y: auto;
    font-family: 'Georgia', serif;
    line-height: 1.7;
    font-size: 1.05em;
    text-align: justify;
}

    .book-preview-area h1, .book-preview-area h2, .book-preview-area h3 {
        font-family: 'Playfair Display', serif; /* A more elegant font for titles */
        margin-top: 1.5em;
        margin-bottom: 0.8em;
        text-align: center;
    }

    .book-preview-area .chapter-content {
        margin-bottom: 2em;
    }

/* Export/Download specific styles */
.export-option-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.2s ease-in-out;
}

    .export-option-card:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

    .export-option-card i {
        font-size: 2em;
        color: #0d3b66;
        margin-right: 15px;
    }

.export-info {
    flex-grow: 1;
}

.export-actions button {
    min-width: 100px;
}
