/**
 * File: /public/assets/css/style.css
 * Purpose: Main stylesheet for the BookLog application.
 *
 * This file contains our theme definitions using CSS Variables,
 * reusable utility classes, and specific component styles adapted from the
 * Address Review project, all tailored for the Skeleton.css framework.
 *
 * Commenting Standard: Version 2.2
 */

/* ==========================================================================
   1. Theme & Color Definitions (CSS Variables)
   ========================================================================== */

/* This is the default theme, "Earthy Cream & Sage", as per our plan. */
:root {
    --bg-color: #FAF9F6;      /* Cream / Off-White */
    --text-color: #36454F;    /* Charcoal Gray */
    --primary-color: #8F9779; /* Muted Sage Green */
    --accent-color: #D2B48C;  /* Warm Tan */
    --border-color: #E1E1E1;  /* A light grey for borders */
    --card-bg-color: #ffffff; /* ADD THIS LINE */
    --card-text-color: #333333; /* ADD THIS LINE - a darker grey */
}

/* This theme is activated by adding class="theme-goodreads" to the <body> tag. */
body.theme-goodreads {
    --bg-color: #F4F1EA;      /* Goodreads Beige */
    --text-color: #333333;    /* Dark Text */
    --primary-color: #382110; /* Goodreads Brown */
    --accent-color: #00635D;  /* Goodreads Teal */
    --border-color: #DCD9CF;
}

/* This theme is activated by adding class="theme-dark" to the <body> tag. */
body.theme-dark {
    --bg-color: #212121;      /* Dark Gray */
    --text-color: #E0E0E0;    /* Light Gray Text */
    --primary-color: #8F9779; /* Muted Sage Green */
    --accent-color: #D2B48C;  /* Warm Tan */
    --border-color: #424242;  /* Darker Border */
    --card-bg-color: #2c2c2c; /* ADD THIS LINE */
    --card-text-color: var(--text-color);
}


/* ==========================================================================
   2. Global & Foundational Styles
   ========================================================================== */

/* --- Sticky Footer Logic --- */
/* This ensures the footer stays at the bottom of the page, even on short pages. */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* The .container class from Skeleton is told to grow to fill any available space. */
.container {
    flex-grow: 1;
}

/* --- General Typography & Links --- */
a {
    color: var(--primary-color);
}
a:hover {
    color: var(--accent-color);
}
hr {
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   3. Reusable Utility Classes
   ========================================================================== */

/* A simple utility for spacing out major sections on a page. */
.content-section {
    margin-top: 4rem;
    margin-bottom: 4rem;
}

/* Style for destructive action buttons (e.g., Delete, Suspend). */
.button.button-danger,
button.button-danger {
    color: #D33C3C;
    background-color: transparent;
    border-color: #D33C3C;
}
.button.button-danger:hover,
button.button-danger:hover {
    color: #FFF;
    background-color: #D33C3C;
    border-color: #D33C3C;
}

/* A utility to make a <button> look like a simple text link. */
.link-button {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font: inherit;
    vertical-align: baseline;
    text-align: left;
}
.link-button:hover {
    color: var(--accent-color);
}


/* ==========================================================================
   4. Component Styles
   ========================================================================== */
/* Override Skeleton's default primary button to use our theme color */
.button.button-primary,
button.button-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #FFF;
}
.button.button-primary:hover,
button.button-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}


/* --- Header & Navigation --- */
/* ADDED: Style for the new site logo */
/* --- Header Logo & Title --- */
.site-logo-link {
    display: flex;
    align-items: center; /* This vertically centers the logo and text */
    text-decoration: none;
    color: inherit;
}

.site-logo {
    height: 35px; /* Control the height of the logo */
    width: auto;
    margin-right: 10px; /* Space between the logo and the site title */
}

/* Removes default heading margin to help with vertical alignment */
.site-logo-link h4 {
    margin: 0;
}

.site-logo {
    height: 88px; /* Increased by 2.5x */ /* Control the height of the logo */
    width: auto;
    margin-right: 10px;/* Space between the logo and the site title */
}
.site-header {
    margin-top: 2rem;
    padding-top: 1rem; /* Reduced */
    padding-bottom: 1rem; /* Reduced */
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

/* ADDED: A new rule to make the Site Title font larger, making the header taller. */
.site-header h4 {
    font-size: 2.2rem; /* Default is 2.0rem, this makes it noticeably taller. */
}

/* ADDED: A new rule to slightly increase the nav font size for better balance. */
.user-nav {
    font-size: 1.6rem; /* Default is 1.5rem */
}

.user-nav > * {
    margin: 0 5px; /* Adds space between nav items */
}

/* ADD THIS NEW RULE for the logged-out links */
.public-nav > * {
    margin: 0 5px; /* Adds space between nav items */
  
}

/* ADDED: Truncates long usernames in the header */
.user-nav strong {
    display: inline-block; /* Required for max-width to work */
    max-width: 150px;      /* Adjust this value as needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle; /* Helps with perfect vertical alignment */
}

/* --- Admin Panel Styles --- */

/* Admin navigation bar styling */
.admin-nav-container {
    background-color: #f5f5f5; /* Stays consistent across themes for clarity */
    border-bottom: 1px solid #ddd;
    margin-bottom: 3rem;
}
.admin-nav {
    display: flex;
     flex-wrap: wrap;
}
.admin-nav a {
    font-size: 1.4rem;
    text-decoration: none;
    font-weight: bold;
    color: #555;
    padding: 12px 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
     white-space: nowrap;
}
.admin-nav a:hover {
    color: var(--primary-color);
    background-color: #e9e9e9;
    border-bottom-color: var(--primary-color);
}

/* Style for animating a row that was just edited */
@keyframes highlight-fade {
    from { background-color: #d9edf7; } /* A light blue */
    to { background-color: transparent; }
}
.highlight-row {
    animation: highlight-fade 3s ease-out 1;
}

/* Base style for the role badges */
.role-badge {
    color: #fff;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* Specific colors for each role */
.role-Admin {
    background-color: #c9302c; /* Red */
}
.role-Moderator {
    background-color: #337ab7; /* Blue */
}
.role-User {
    background-color: #777; /* Grey */
}

/* Base style for the status badges */
.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: capitalize;
}
.status-active, .status-visible {
    background-color: #dff0d8; /* Light green */
    color: #3c763d;
    border: 1px solid #d6e9c6;
}
.status-suspended, .status-hidden {
    background-color: #f2dede; /* Light red */
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Nudge the header icons down for better vertical alignment with text */
.user-nav .profile-filter-icon svg,
.user-nav .notification-container svg {
    position: relative;
    top: 2px; 
}


/* ==========================================================================
   5. Responsive Styles
   ========================================================================== */

@media (max-width: 750px) {
    /* On smaller screens, stack the header elements vertically */
    .site-header .row {
        flex-direction: column;
    }
    .site-header .columns {
        width: 100%;
        margin-left: 0;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    .site-header .user-nav {
        justify-content: center;
    }
}

/* --- Page Header Styles --- */
/* A reusable style for main page titles, making them smaller than Skeleton's default. */
.page-title {
    font-size: 3.0rem; /* Smaller than Skeleton's 5.0rem H2 */
    font-weight: 600;
    margin-bottom: 2.5rem; /* Tighter spacing to the paragraph below */
}

/* A modifier for page titles to add an underline effect */
.page-title.underlined {
    padding-bottom: 1rem;
    border-bottom: 4px solid var(--primary-color);
    display: inline-block; /* ADD THIS LINE */
}
/* --- Form Spacing --- */
/* Adds vertical margin between the rows inside our forms for better spacing. */
form .row {
    margin-bottom: 1.5rem;
}


/* ==========================================================================
   7. Profile Page Styles (Final, Corrected)
   ========================================================================== */

/* This is the container for the avatar, username, and icon. */
.profile-header {
    display: flex;
    align-items: flex-end;
    margin-bottom: 4rem;
}

/* Styles for the avatar image. */
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 2rem;
    flex-shrink: 0;
}

/* Styles for the user's name. */
.profile-username {
    font-size: 3.0rem;
    font-weight: 600;
    margin: 0;
    flex-grow: 1; /* Pushes the icon to the far right */
}

/* Styles for the <a> tag that WRAPS our SVG icon. */
.profile-filter-icon {
    text-decoration: none;
    line-height: 1;
}

/* ADDED: A new style specifically for the SVG icon itself. */
.profile-filter-icon svg {
    /* UPDATED: Reduced size by ~10% for a more subtle look. */
    width: 22px;
    height: 22px;
    stroke: #999; /* The color of the line drawing */
    stroke-width: 2.5px;
    fill: none;
    transition: stroke 0.2s ease-in-out;
}

/* A hover effect for our new SVG icon. */
.profile-filter-icon:hover svg {
    /* CORRECTED: We now use the high-contrast --accent-color for a more noticeable effect. */
    stroke: var(--accent-color);
}


/* Styles for the book list. */
.book-list {
    list-style: decimal;
    padding-left: 2rem;
    margin-bottom: 0;
}
.book-list li {
    padding: 1.2rem 0;
    font-size: 1.6rem;
}
.book-list small {
    color: #777;
    margin-left: 0.5rem;
}

/* ==========================================================================
   8. Book List Header & Filter (Final)
   ========================================================================== */

/* This is the main container for the title and the filter controls. */
.book-list-header {
    display: flex;
    justify-content: space-between; /* Pushes the title and controls to opposite ends */
    align-items: center;
    margin-bottom: 1.5rem;
    /* This is the KEY to preventing the "jump". It guarantees a consistent height. */
    min-height: 40px;
}

/* We remove the default margin from the h3 to ensure perfect vertical alignment. */
.book-list-header h3 {
    margin-bottom: 0;
}

/* ADDED: A new container for the right-hand side controls (icon, input, close button) */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px; /* Adds a little space between the input and the close button */
}

/* This styles the filter input box that will appear when the icon is clicked. */
#book-filter-input {
    width: 250px;
    margin-bottom: 0;
    /* ADDED: These properties make the input box shorter and the text inside smaller. */
    height: 30px;
    padding: 3px 6px;
    font-size: 1.3rem;
}

/* ADDED: A style for our new close button. */
.close-filter-btn {
    font-size: 2.5rem;
    font-weight: bold;
    color: #999;
    text-decoration: none;
    line-height: 1; /* Helps with vertical alignment */
}
.close-filter-btn:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   9. Book List Item Styles (Final, Corrected)
   ========================================================================== */

/* This is the parent <ol> tag. We need to initialize the CSS counter here. */
.book-list {
    counter-reset: book-counter;
}

/* The .book-item (the <li>) is now a flex container for alignment. */
.book-item {
    display: flex;
    align-items: center; /* This vertically centers the text and the icons. */
    padding: 1.2rem 0;
    list-style-type: none; /* We hide the default, broken number. */
}

/* This is the professional standard for replacing the list number when using flexbox. */
.book-item::before {
    /* We get the current value of our counter and display it. */
    content: counter(book-counter) ".";
    /* We increment the counter for the next list item. */
    counter-increment: book-counter;
    font-weight: bold;
    margin-right: 1.5rem; /* Space between the number and the text. */
    color: var(--text-color);
}

/* This is the div that contains the book's text. */
.book-info {
    /* This is the KEY to fixing the alignment. It tells the text to grow and
       take up all available empty space, pushing the icons to the right. */
    /* flex-grow: 1; */
    /* These three properties prevent long titles from wrapping and breaking the layout. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* This is the container for our action icons. */
.book-actions {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    display: flex;
    gap: 15px;
    flex-shrink: 0;
    margin-left: 1.5rem; /* Adds space between the text and the icons. */
}

.book-item:hover .book-actions {
    opacity: 1;
    visibility: visible;
}

/* This styles the individual <a> links that wrap our SVG icons. */
.action-icon {
    line-height: 1;
}
.action-icon svg {
    width: 22px;
    height: 22px;
    stroke: #999;
    stroke-width: 2;
    fill: none;
    transition: stroke 0.2s ease-in-out;
}
.action-icon:hover svg {
    stroke: var(--text-color);
}

/* The delete icon turns red on hover. */
.action-icon.action-delete:hover svg {
    stroke: #D33C3C;
}

/* ==========================================================================
   10. Inline Confirmation Styles
   ========================================================================== */

/* This style is for the "Are you sure?" text, making it smaller and less prominent. */
.delete-confirm-text {
    font-size: 1.4rem; /* Slightly smaller than the 1.6rem book list font. */
    color: #777;
   /* margin-right: auto;  A flexbox trick to push the buttons to the right. */
}

/* This is our new utility class for smaller, more compact buttons. */
.button.button-small,
button.button-small {
    height: 32px;
    line-height: 32px;
    padding: 0 15px; /* Less horizontal padding. */
    font-size: 1.2rem; /* A smaller font. */
}

/* ==========================================================================
   11. Account Page Responsive Form Styles
   ========================================================================== */

/*
 * Default (Desktop) Styles:
 * By default, we show the form in the sidebar and hide the mobile version.
 */
.book-management-mobile {
    display: none;
}
.book-management-desktop {
    display: block;
}

/*
 * Responsive (Mobile) Styles:
 * When the screen is 750px or less, we reverse the display.
 */
@media (max-width: 750px) {
    .book-management-mobile {
        display: block;
        margin-bottom: 4rem; /* Add some space between the form and the book list */
    }
    .book-management-desktop {
        display: none;
    }

    /* Reduce the space between the mobile form rows */
    #inline-add-book-form-mobile .row {
        margin-bottom: 1.0rem;
    }

    /* Make the mobile labels smaller and tighten spacing */
    #inline-add-book-form-mobile label {
        font-size: 1.3rem;
        margin-bottom: 0.25rem;
    }

    /* Make the mobile text inputs shorter and the font inside them smaller */
    #inline-add-book-form-mobile input[type="text"] {
        height: 32px;
        padding: 4px 8px;
        font-size: 1.3rem;
    }
}

/* ==========================================================================
   13. Autocomplete Search Results Styles
   ========================================================================== */

/* This is the wrapper div we added around the 'Title' input in the HTML.
   It acts as the positioning anchor for our results list. */
.autocomplete-container {
    position: relative;
}

/* This is the list that will hold the search results. */
.autocomplete-results {
    position: absolute;
    top: 100%; /* Position it directly below the input field */
    left: 0;
    right: 0;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: 99; /* Ensure it appears above other page content */
    max-height: 300px;
    overflow-y: auto; /* Make long lists scrollable */
}

/* This is a single suggestion item in the list. */
.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.4rem;
}

/* Add a highlight when the user hovers over an item. */
.autocomplete-item:hover {
    background-color: var(--border-color);
}

/* Style for the book title within a suggestion. */
.autocomplete-item strong {
    font-weight: 600;
    color: var(--text-color);
}

/* Style for the author name within a suggestion. */
.autocomplete-item small {
    color: #777;
    margin-left: 0.5rem;
}


/* ==========================================================================
   14. Pagination Styles
   ========================================================================== */

/* This is the main container for the pagination links */
.pagination {
    text-align: center; /* This will center the links on the page */
    margin-top: 3rem;   /* Adds some extra space above the pagination block */
}

/* This styles all the individual links and the current page number */
.pagination a,
.pagination .current-page {
    font-size: 1.6rem;         /* Makes the font slightly larger */
    padding: 8px 12px;         /* Adds clickable/touchable space inside the border */
    margin: 0 4px;             /* Adds breathing room between each number/link */
    text-decoration: none;
    border-radius: 4px;        /* Gives the links slightly rounded corners */
    transition: all 0.2s ease-in-out;
}

/* This adds a hover effect to the clickable links */
.pagination a:hover {
    background-color: var(--border-color);
}

/* This makes the current, non-clickable page number stand out */
.pagination .current-page {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: bold;
    cursor: default;
}


/* Custom styling for the Report icon to make it slightly smaller */
.book-actions a[title="Report this book"] svg {
    width: 17px; /* 24px * 0.70 = 16.8px, rounded to 17px */
    height: 17px; /* Maintain aspect ratio */
}

/* Increase the default height of the report comments text area */
#comments {
    min-height: 150px;
    height: 150px;
}

/* Style for blockquotes on the view report page */
blockquote.report-blockquote {
    background-color: var(--border-color);

    border-left: 5px solid var(--border-color);
    padding: 10px 20px;
    margin: 0 0 1rem 0;
}

/* ==========================================================================
   15. Notification List Styles (Card Design)
   ========================================================================== */

.notification-list {
    list-style: none;
    margin-left: 0;
}

/* This is the base style for each notification "card" */
.notification-item {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--card-text-color); /* ADD THIS LINE */
}

.notification-item p {
    margin-bottom: 0.25rem;
}

.notification-item small {
    color: #777;
}

/* Unread notifications have bold text and a colored left border */
.notification-unread {
    border-left: 4px solid var(--primary-color);
}
.notification-unread p {
    font-weight: bold;
}

/* Moderation notifications have a distinct background and border color */
.notification-moderation {
    background-color: #fff8e1; /* Light yellow */
    border-color: var(--accent-color); /* Theme's tan color */
}

/* Special rule for an unread moderation notification */
.notification-moderation.notification-unread {
    border-left: 4px solid #c9302c; /* A distinct red for high priority */
}

/* ==========================================================================
   16. Appeal Chat Styles
   ========================================================================== */

.appeal-thread {
    list-style: none;
    margin-left: 0;
    margin-top: 2rem;
}

.appeal-message {
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 1rem;
    max-width: 80%;
    clear: both;
}

.appeal-message p {
    margin-bottom: 0.5rem;
}
.appeal-message small {
    font-size: 1.1rem;
    color: #888;
}

/* Style for messages from the user */
.message-user {
    background-color: #d9edf7; /* Light blue */
    float: left;
}

/* Style for messages from a Moderator */
.message-moderator {
    background-color: #f5f5f5; /* Light grey */
    float: right;
}

/* Style for messages from an Admin */
.message-admin {
    background-color: #fff8e1; /* Light yellow */
    float: right;
}

/* MODIFIED: Add custom, high-contrast link styles for inside notifications */
.notification-item a {
    color: #00635D; /* A dark, high-contrast teal */
    text-decoration: underline;
}

/* A slightly darker teal for the hover state */
.notification-item a:hover {
    color: #004c47;
}

/* A muted, dark grey for visited links */
.notification-item a:visited {
    color: #555;
}

/* Container for the notification icon and its badge */
.notification-container {
    position: relative; /* This is the anchor for the badge */
    display: inline-block; /* Ensures it sizes correctly */
}

/* The mail icon itself */
.notification-container svg {
    height: 1em;
    width: auto;
    fill: currentColor;
    position: relative;
    top: 0.15em;
    margin-left: 4px;
}

/* The new superscript badge */
.notification-badge {
    position: absolute;
    top: -5px;      /* Position it slightly above the icon's top edge */
    right: -7px;    /* Position it slightly past the icon's right edge */
    background-color: #c9302c;
    color: white;
    border-radius: 50%; /* Makes it a perfect circle */
    padding: 1px 5px;
    font-size: 1rem;    /* Very small font */
    font-weight: bold;
    line-height: 1.2;
}


/* ==========================================================================
   17. Admin Filter Pill Styles
   ========================================================================== */

/* The container for a group of filter pills */
.filter-pills {
    display: flex;
    flex-wrap: wrap; /* Allows pills to wrap onto the next line on small screens */
    gap: 8px; /* The space between each pill */
    align-items: center;
}

/* Style for each individual pill/button */
.filter-pills a {
    display: inline-block;
    padding: 5px 15px; /* Vertical and horizontal padding */
    border: 1px solid var(--border-color);
    border-radius: 20px; /* High radius creates the pill shape */
    text-decoration: none;
    font-size: 1.3rem; /* Smaller font size */
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    color: var(--text-color); /* A dark charcoal grey */
}

/* Hover state for inactive pills */
.filter-pills a:hover {
    background-color: var(--border-color);
    border-color: #ccc;
}

/* Active/selected state for a pill */
.filter-pills a.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}


/* This applies vertical alignment to the search icon specifically */
.public-nav .profile-filter-icon {
    vertical-align: middle;
}

/* ==========================================================================
   18. Search Modal Styles
   ========================================================================== */

/* The semi-transparent background overlay for the modal */
.modal-overlay {
    position: fixed; /* Sits on top of all other content, relative to the viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* High z-index to ensure it's on top */
}

/* The actual modal pop-up box */
/* The actual modal pop-up box */
.modal-content {
    background-color: var(--bg-color);
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: var(--text-color); /* ADDED: Ensures text color matches the theme */
    padding: 2rem;
    border-radius: 5px;
    width: 90%;
    max-width: 320px; /* MODIFIED: Reduced from 500px for a more compact look */
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 8px; /* ADD THIS LINE */
}

/* The 'x' close button in the corner of the modal */
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2.5rem;
    color: #aaa;
    text-decoration: none;
    line-height: 1;
}
.modal-close:hover {
    color: var(--text-color);
}


/* ==========================================================================
   19. Markdown Editor Styles
   ========================================================================== */

/* --- Tabbed Interface --- */
.editor-tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: -1px; /* Neatly overlaps the pane's border */
}

.tab-btn {
    padding: 10px 15px;
    border: 1px solid transparent;
    border-bottom: none;
    background-color: #f1f1f1;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: bold;
}

.tab-btn.active {
    background-color: var(--card-bg-color);
    border-color: var(--border-color);
}

.editor-panes .tab-pane {
    display: none; /* Hide all panes by default */
}

.editor-panes .tab-pane.active {
    display: block; /* Show only the active pane */
}

/* --- Toolbar & Editor --- */
.markdown-toolbar {
    background-color: #f5f5f5;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.markdown-btn {
    margin: 2px;
    font-size: 1.3rem;
    height: 30px;
    line-height: 30px;
}

/* Make the textarea attach neatly to the toolbar */
#content_markdown {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
}

/* --- Preview Pane --- */
.markdown-preview {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px 20px;
    background-color: var(--card-bg-color);
    min-height: 400px; /* Give it a similar height to the editor */
    overflow-y: auto;
}


/* ==========================================================================
   20. Blog Post Styles
   ========================================================================== */

/* This creates the "card" for each individual blog post */
.blog-post {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2.5rem 3rem;
    margin-bottom: 3rem;
}

/* With cards, the <hr> separators are no longer needed, so we hide them */
.blog-post + hr {
    display: none;
}

.post-meta {
    color: #757575;
    font-size: 1.4rem;
    margin-bottom: 2rem;
}

.post-content {
    line-height: 1.7; /* Increased line spacing for better readability */
}

/* Make headings inside a post stand out */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2.5rem;
}

.blog-post > h3 {
    margin-top: 0;
}

/* Reduce the spacing around the HR in the share modal */
#share-modal hr {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   19. Footer Styles
   ========================================================================== */

/* This rule adds the same spacing to the footer links as the header links */
.footer-links > * {
    margin: 0 5px;
}

/* ==========================================================================
   20. About Page Styles
   ========================================================================== */

/* This container will hold our two columns (image and text) */
.about-hero-row {
    display: flex;
    flex-wrap: wrap; /* Allows columns to stack on mobile */
    align-items: center; /* Vertically aligns the content of both columns */
    margin-top: 4rem;
}

/* This styles the text column */
.about-text-column {
    display: flex;
    flex-direction: column;
    justify-content: center; /* This is what vertically centers the text */
}

/* This styles the image within its column */
.about-hero-image {
    width: 100%;
    height: auto;
    border-radius: 4px; /* Adds a slight rounded corner to the image */
    border: 1px solid var(--border-color); /* ADD THIS LINE */
    min-height: 300px; /* ADD THIS LINE */
}

/* ==========================================================================
   21. Homepage Sidebar (NEW)
   ========================================================================== */

/* This is the container for the "Recently Added" / "Popular" list on the homepage. */
.homepage-sidebar {
    /* This is the key: it reserves a minimum space on the page.
       300px is a guess; it's about the height of 5 books + title. */
    min-height: 300px;
  
    
    /* A little padding to match the card look */
    /* padding: 1rem 2rem;
    border-radius: 4px; */
}


/* ==========================================================================
   24. Live Search Toggle Link (NEW)
   ========================================================================== */

.live-search-toggle {
  margin-left: 8px; /* Space between "Title" and the link */
  font-size: 1.2rem; /* Make the toggle link smaller */
  font-weight: normal; /* Override potential bold from label */
}

a.live-search-link {
  text-decoration: none; /* Optional: remove underline */
  color: #888; /* Muted color for default (disabled) state */
}

a.live-search-link.enabled {
  color: var(--primary-color); /* Use theme color when enabled */
  font-weight: bold;
}

/* ==========================================================================
   25. Book Count Badge (MODIFIED for Smaller Size)
   ========================================================================== */

.book-count-badge {
  display: inline-block;
  background-color: var(--primary-color);
  color: #FFF;
  /* SHRUNK: Padding reduced for a tighter fit */
  padding: 2px 7px;
  /* SHRUNK: Border-radius reduced to match smaller size */
  border-radius: 9px;
  /* SHRUNK: Font-size reduced by ~30% */
  font-size: 1.1rem;
  font-weight: 600;
  vertical-align: middle;
  /* SHRUNK: Margin reduced to keep spacing proportional */
  margin-left: 7px;
  line-height: 1.4;
}

/* ==========================================================================
   26. Cookie Consent Banner (Themed)
   ========================================================================== */

.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* THEME: Use primary color for background */
  background-color: var(--primary-color);
  /* THEME: Use light color (site background) for text contrast */
  color: var(--bg-color);
  padding: 15px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* THEME: Add a subtle border matching the site */
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -1px 4px rgba(0,0,0,0.1); /* Optional softer shadow */
}

.cookie-consent-banner p {
  margin: 0;
  font-size: 1.4rem;
}

.cookie-consent-banner button {
  margin: 0 0 0 20px;
  flex-shrink: 0;
  /* Ensure button text contrasts with its own background (already handled by .button-primary) */
  /* No color changes needed here if using .button-primary */
}

/* Optional: Ensure links inside banner contrast well */
.cookie-consent-banner p a {
    color: var(--bg-color); /* Match banner text color */
    text-decoration: underline;
}
.cookie-consent-banner p a:hover {
    color: #FFF; /* Slightly brighter on hover */
}

/* Responsive adjustments from your previous CSS */
@media (max-width: 750px) {
  .cookie-consent-banner {
    flex-direction: column; /* Stack items vertically */
    text-align: center;
  }
  .cookie-consent-banner button {
    margin-top: 10px; /* Add space above button when stacked */
    width: 100%; /* Make button full width */
    margin-left: 0; /* Remove left margin when stacked */
  }
}


a.book-info-link {
  text-decoration: none;
  color: inherit; /* Make link inherit text color */
}
a.book-info-link:hover {
  text-decoration: underline; /* Underline only on hover */
  color: var(--primary-color); /* Optional: Highlight on hover */
}
.book-subtitle {
    color: #777; /* Keep subtitle muted */
}

/* ==========================================================================
   26. Responsive Font Size for Book List (NEW)
   ========================================================================== */

/* Apply smaller font size on screens 550px wide or less */
@media (max-width: 550px) {
  .book-info {
    font-size: 1.4rem; /* Reduce from default size (likely 1.6rem or similar) */
  }
  /* Optional: Reduce size of action icons slightly too */
  .book-actions .action-icon svg {
    width: 18px;
    height: 18px;
  }
}

/*
 * Header Navigation Alignment Fix
 * Aligns only the "problematic" elements (icons, badges, and the
 * bolded username) to the middle, letting the text links and
 * vertical bars align normally to the baseline.
 */
.user-nav > a.profile-filter-icon,
.user-nav > strong,
.user-nav > span.notification-container {
    vertical-align: middle;
}


.user-nav a {
    text-decoration: none;
}
.user-nav a:hover {
    text-decoration: underline;
}


/*
 * Custom Tooltip
 * Used for the 'Enable Live Search' link
 */
.tooltip-trigger {
  position: relative; /* Anchors the tooltip */
  
}

/* The tooltip popup box */
.tooltip-trigger::after {
  content: attr(data-tooltip); /* Gets text from the 'data-tooltip' attribute */
  position: absolute;
  
  /* Position it above the link */
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);

  /* Style it */
  background-color: var(--text-color); /* Uses your site's main text color */
  color: var(--bg-color);            /* Uses your site's main background color */
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 1.4rem;      /* Use a standard font size */
  font-weight: normal;  /* Ensure it's not bold */
  white-space: nowrap;  /* Keep "might be slow" on one line */
  z-index: 10;

  /* Hide it by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-in-out;
}

/* Show it on hover */
.tooltip-trigger:hover::after {
  opacity: 1;
  visibility: visible;
}


/*
 * Improves legibility of the book count badge
 * by adding space between characters.
 */
.book-count-badge {
    letter-spacing: 1px;
}




