/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$/*
8==D~~                                                    8==D~~
8==D~~                 WELCOME! :D                        8==D~~
8==D~~                                                    8==D~~
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/


/* General Styles */

@font-face {
  font-family: 'Comfortaa';
  src: url('../fonts/Comfortaa/Comfortaa-VariableFont_wght.ttf') format('truetype-variations'),
       url('../fonts/Comfortaa/static/Comfortaa-Regular.ttf') format('truetype');
  font-weight: 200 300 400 500 600 700 800 900;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype-variations'),
       url('../fonts/Inter/static/Inter_24pt-Regular.ttf') format('truetype');
  font-weight: 100 900;
  font-optical-sizing: auto;
  font-display: swap;
}
/* f34848 */
:root {
    --primary: #f34848;
    --primary-hover: color-mix(in srgb, var(--primary) 85%, black);
    --danger-red: #e53535;
}

h2, h3, h4, p {
    margin-top: 0;
}

h2 {
    font-size: x-large;
    font-weight: 500;
    color: #581C1C;
    line-height: 1.25;
}

h3 {
    font-size: large;
    font-weight: 500;
    color: #581C1C;
    line-height: 1.3;
}

h4 {
    font-size: medium;
    font-weight: 500;
    color: #808080;
    line-height: 1.3;
}

p {
    font-size: medium;
    font-weight: 300;
    color: #555555;
    line-height: 1.5;
    opacity: 0.85;
}


li {
    list-style: none;
    margin: 8px 0;
    color: #581C1C !important;
    font-weight: 500 !important;
    font-size: medium !important;
    display: block !important;
    padding: 6px 10px !important;
}

ul { padding:0;
margin: 0;}


a {
    text-decoration: none;
    color: #535fe8;
}

/* Global Styling */

#navbar, .sidebar, .admin-page-wrapper {
        box-shadow: inset 3px 4px 4px 0 rgba(0, 0, 0, 0.15);
}



/* LAYOUT & NAVBAR */
body {
    display: flex;
    overflow-x: hidden;
    margin: 0;
    background-color: black;
    padding: 0;
    font-family: 'Inter', sans-serif;
}
.app-wrapper { 
    display: flex; 
    flex-direction: row;
    width: 100%; 
    height: calc(100vh - 20px); 
    overflow: hidden; 
    border-radius: 43px;
    background-color: var(--primary);
    gap:12px;
    border-style: solid;
    border-width: 10px;
    border-color:transparent;
}

#page-scripts {
    display: none;
}

#navbar { 
    margin: 0px;
    border-radius: 40px;
    width: auto; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0;
    background: rgba(255, 255, 255, .99); 
    border-right: 1px solid #ddd; 
}
#navbar-menus-wrapper { 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1;
    justify-content: space-between;
    padding: 10px 0;
}

.nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    gap: 5px;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 100px;
    border: 0px;
    background-color: transparent;
}
.nav-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button-icon svg {
    fill: black;
}

.nav-button-text {
    font-family: 'Comfortaa', sans-serif;
    font-size: small;
    font-weight: 500;
    color: black;
}

.navigation-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
  }

.user-popover-menu {
    min-width: 250px;
    position: absolute;
    bottom: 0;
    left: calc(100% + 15px);
    background-color:rgba(255, 255, 255, 0.75);
    padding:20px;
    margin:10px;
    backdrop-filter: blur(10px);
    border-radius:10px;
    border-color:#581C1C;
    box-shadow: -1px 2px 10px #00000033;
    z-index: 51;
}


.user-popover-menu h3 {
    margin-top:0;
    padding-top:0px;
    font-size:large;
}


details[open] .user-popover-menu {
    animation: pop-in 0.05s cubic-bezier(0.04, 0, 0.2, 1.25) forwards;
}

.user-popover-arrow {
    position: absolute;
    bottom: 12px;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(255, 255, 255, 0.75);
}

.user-popup-button {
    display:flex;
    justify-content: left;
    align-items: center;
    margin:0px;
    border-radius: 50px;
    padding:5px 5px;
    border-color: transparent;
    background-color: transparent;
    gap: 10px;
    font-weight: 400;
    font-size: medium;
    text-decoration: none;
    color: #581C1C;
    cursor: pointer;
    }


@keyframes pop-in {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

}

@keyframes professional-fade {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.user-popover {position: relative}



      
.navbar-left-vertical { 
    padding: 15px; }

.nav-head { 
    font-weight: bold; 
    padding: 10px 0; 
    border-bottom: 1px solid #eee; 
    margin-bottom: 5px; }




.content-layout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}


.main-content-area {
    display:flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    margin:0;
    padding:0;
    position:relative;
}

.main-content-wrapper { 
    flex-grow: 1; 
    padding: 0px 0 10px 0; 
    overflow-y: auto; 
    display: block; 
    overflow-x: hidden;
    margin: 0;
    border-radius: 40px;
}

.main-content {
    flex-grow: 1;
    padding: 70px 0 40px 0;
    overflow-y: auto;
    display: flex;
    overflow-x: hidden;
    margin: 0;
    border-radius: 40px;
    flex-direction: column;
    gap: 128px;
    margin: -10px 0;
    height: calc(100% + 20px);
    box-sizing: border-box;
}



/*===================/*
/*    /* SIDEBAR */  /*
/*===================*/

.sidebar {
    width: 230px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    height: calc(100vh - 20px);
    position: sticky;
    top:0;
    background-color: rgba(255, 255, 255, 0.99);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 25px 15px 10px 15px;
    margin: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

.side-wrapper {
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
    margin: 0;
    background-color: rgba(0,0,0,.02);
    border-radius: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}

.advsearch .sidebar {
    width: 400px;
}

.advsearch .side-wrapper {
    flex: 1;
    max-height: none;
    min-height: 0;
}


.set-cat {font-size:15px}

.side-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
}

.sidebar-header {
    color: #581C1C;
    font-weight: 600;
    font-size: 24;
    margin: 0;
}

.side-head-text {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.filter-section {
    padding: 6px 0;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0 2px 4px;
}






/* Hide native checkbox */
.filter-options input[type="checkbox"] {
    display: none;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: small;
    color: #581C1C;
    cursor: pointer;
    transition: color 0.15s, font-weight 0.15s;
    padding: 2px 0;
}

.filter-options label::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.15s ease;
}

/* Selected: green dot + bold */
.filter-options label:has(input:checked)::before {
    background: #80C900;
}

.filter-options label:has(input:checked) {
    font-weight: 600;
}

/* Show more/less toggle */
.filter-show-more {
    background: none;
    border: none;
    color: rgba(88, 28, 28, 0.6);
    font-size: 12px;
    cursor: pointer;
    padding: 3px 4px;
    margin-top: 2px;
    text-align: left;
    transition: color 0.15s;
}

.filter-show-more:hover {
    color: #581C1C;
}

.clear-filters-btn {
    background: none;
    border: 1px solid rgba(88, 28, 28, 0.3);
    border-radius: 8px;
    padding: 4px 12px;
    color: #581C1C;
    font-size: small;
    cursor: pointer;
    margin: 8px 0 4px 0;
    transition: background-color 0.15s;
}

.clear-filters-btn:hover {
    background-color: rgba(88, 28, 28, 0.08);
}

.filter-section-title {
    cursor: pointer;
    font-size: small;
    font-weight: 600;
    color: #581C1C;
    padding: 4px 0;
}

/* Filter animations */
.book-cover.filter-hiding {
    animation: filterOut 250ms ease forwards;
    pointer-events: none;
}

.book-cover.filter-showing {
    animation: filterIn 250ms ease forwards;
}

@keyframes filterOut {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.85); }
}

@keyframes filterIn {
    0%   { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

/* ACTION BAR */

.action-bar {
    z-index: 10;
    left:0;
    right:0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    position: absolute;
    padding: 15px;
}

.action-bar:empty {
    display: none;
}

/* SAVE STATUS PILL */

.save-status {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #581C1C;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.save-status--visible {
    opacity: 1;
}

.save-status--fading {
    opacity: 0;
}

.save-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #80C900;
    transition: background 0.2s ease;
}

.save-status--saving .save-status-dot {
    background: #e8bf5e;
    animation: pulse-dot 0.8s ease-in-out infinite;
}

.save-status--pending .save-status-dot {
    background: #e8bf5e;
}

.save-status--saved .save-status-dot {
    background: #80C900;
}

.save-status--error .save-status-dot {
    background: #F94C4C;
}

.save-status--error {
    color: #c0392b;
}

.save-status-tooltip {
    display: none;
}

.save-status--has-tooltip .save-status-tooltip {
    display: none;
    white-space: nowrap;
}

.save-status--has-tooltip .save-status-tooltip::before {
    content: '— ';
}

.save-status--has-tooltip:hover .save-status-tooltip {
    display: inline;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.sort-button {
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255,255,255 0.9);
    border-radius: 10px;
    padding: 6px 14px;
    color: #581C1C;
    backdrop-filter: blur(5px);
    cursor:pointer;
    box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.15);
}

/* Remove default caret symbol from drop down button */

summary {
    list-style: none;
    cursor: pointer;
}

.sort-option {
    display:flex;
    justify-content: left;
    align-items: center;
    margin:0px;
    border-radius: 50px;
    padding:5px 5px;
    border-color: transparent;
    background-color: transparent;
    gap: 10px;
    font-weight: 400;
    font-size: medium;
    text-decoration: none;   
    color: #581C1C;
    cursor: pointer;
    }

.search-form {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255,255,255 0.9);
    border-radius: 10px;
    padding: 4px 10px;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.15);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #581C1C;
    font-size: medium;
}

.search-input::placeholder {
    font-style: italic;
    color: #581C1C;
    opacity: 0.6;
}

.search-submit {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.sort-dropdown {
    position: relative;
}

.sort-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    padding: 8px;
    box-shadow: -1px 2px 10px #00000033;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 20;
}

details[open] .sort-popover {
    animation: pop-in 0.05s cubic-bezier(0.04, 0, 0.2, 1.25) forwards;
}

.sort-popover-arrow {
    position: absolute;
    top: -8px;
    left: 16px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(255, 255, 255, 0.7);
}

.slider-container {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255 0.9);
    box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.15);
}

.cover-size-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(88, 28, 28, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.cover-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #581C1C;
    cursor: pointer;
}

.cover-size-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #581C1C;
    border: none;
    cursor: pointer;
}

.search-form:focus-within, .sort-button:hover {
    background-color: rgba(255, 255, 255, 1);
}

.books-grid {
    --cover-size: 275px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--cover-size), 1fr));
    gap: 10px 15px;
}

.book-cover {
    cursor: pointer;
    width: 100%;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
}

.book-cover img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 15px; 
}

.book-cover-fallback {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 15px;
    background: linear-gradient(135deg, #581C1C, #8A5353);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 16px;
    box-sizing: border-box;
    gap: 8px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.book-cover-fallback-title {
    color: white;
    font-size: x-large;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-cover-fallback-author {
    color: rgba(255, 255, 255, 0.75);
    font-size: large;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.books-loading {
    display: none;
    justify-content: center;
    padding: 24px;
}

.books-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(88, 28, 28, 0.2);
    border-top-color: #581C1C;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* SEARCH RESULT COUNT */

.result-count {
    font-size: small;
    font-weight: 600;
    color: #581C1C;
    opacity: 0.75;
}

/* BOOK POPOVER */


.book-cover img, .book-cover-fallback {
    pointer-events: none;
    -webkit-user-drag: none;
}

#book-popover {
    position: fixed;
    display: none;
    width: 350px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 24px;
    box-shadow: -1px 2px 10px #00000033;
    z-index: 100;
    color: #581C1C;
}

#popover-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: rgba(88, 28, 28, 0.4);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
}

#popover-close:hover {
    color: #581C1C;
    background-color: rgba(88, 28, 28, 0.08);
}

#book-popover-arrow {
    position: absolute;
    top: 20px;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(255, 255, 255, 0.85);
}

#book-popover.arrow-right #book-popover-arrow {
    left: auto;
    right: -8px;
    border-right: none;
    border-left: 8px solid rgba(255, 255, 255, 0.85);
}

#book-popover.animating {
    animation: pop-in 0.05s cubic-bezier(0.04, 0, 0.2, 1.25) forwards;
}

#popover-title {
    font-size:x-large;
    font-weight: 500;
    color:#581C1C;    
    margin: 0 0 4px 0;
}

#popover-author {
    font-weight: 500;
    color:#8A5353;
    margin: 0 0 6px 0;
}

#popover-rating {
    font-size: small;
    margin: 0 0 8px 0;
    opacity: 0.75;
}

#popover-description {
    font-size:medium;
    line-height: 1.5;
    color:#581C1C;
    margin: 0 0 14px 0;
    opacity: 0.85;
}

#popover-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: medium;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.15s;
    white-space: nowrap;
    list-style: none;
}

.btn-primary svg {
    fill: white;
}


.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: transparent;
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: medium;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    color: #581C1C;
    transition: background-color 0.2s, transform 0.15s;
    white-space: nowrap;
    list-style: none;
}

.btn-secondary svg {
    fill: #581C1C;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

#popover-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    backdrop-filter: none;
    z-index: 50;
    display: none;
}


/*------------------------*/
/* Empty State            */
/*------------------------*/

body:has(.empty-state) .sidebar {
    display: none;
}

body:has(.empty-state) .main-content {
    padding: 10px 0 0 0;
}

body:has(.empty-state) .action-bar {
    display: none;
}

.books-grid:has(.empty-state) {
    display: flex;
    background-color: var(--primary);
    border-radius: 30px;
    min-height: calc(100vh - 30px);
    position: relative;
    overflow: hidden;
}

.empty-state {
    position: absolute;
    inset: 0;
}

.empty-state-brand {
    position: absolute;
    top: 10px;
    left: 10px;
    font-family: 'Comfortaa', sans-serif;
    font-size: 36px;
    font-weight: 400;
    color: #fff;
}

.empty-state-illustration {
    position: absolute;
    bottom: 0;
    left: 0px;
    width: 380px;
    height: auto;
}

.empty-state-cta {
    position: absolute;
    bottom: 20px;
    right: 40px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    z-index: 50;
}

.empty-state-heading {
    font-size: 2.4rem;
    font-weight: 600;
    color: #581C1C;
    margin: 0;
    white-space: nowrap;
    padding-top: 90px;
}

.empty-state-arrow {
    width: 340px;
    height: auto;
    pointer-events: none;
    margin: 0 20px 60px 0;
}


/*------------------------*/
/* Dialog */

.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-box {
    position: relative;
    width: 420px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 28px;
    box-shadow: -1px 2px 10px rgba(0, 0, 0, 0.2);
    color: #581C1C;
}

.dialog-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #581C1C;
    opacity: 0.4;
    line-height: 1;
    padding: 4px;
}

.dialog-close:hover {
    opacity: 0.8;
}

.dialog-heading {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.dialog-hint {
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.6;
    opacity: 0.7;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--danger-red);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: medium;
    font-weight: 500;
    cursor: pointer;
}

/*------------------------*/
/* Floating Upload Button */
/*------------------------*/

.fab-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255 0.9);
    box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.15);
    z-index: 60;
    transition: background-color 0.2s, transform 0.2s;
}

.fab-upload svg {
    fill:#000000;
}
.fab-button:hover {
    background-color: #00e764;
    transform: scale(1.08);
}


/*------------------------*/
/* UPLOAD WINDOW LOCATION */
/*------------------------*/

@media (min-device-width: 768px) {
  .upload-modal-dialog {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
  }
}


/*---------------------------------------------------------------------------------------------------*/
/* Begin Generated CSS  */
/* The following CSS rules were generated without much review and mostly do not meet project standards 
or design guidelines. I am in the process of updating them. */
/*---------------------------------------------------------------------------------------------------*/



/* Advanced Search Page */

.admin-section-body select[multiple].book-edit-field,
#search-sidebar select[multiple].book-edit-field {
    height: auto;
    min-height: 120px;
    padding: 6px;
}

.search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #8A5353;
    text-align: center;
}

.search-empty-state h2 {
    margin: 0 0 8px 0;
    color: #581C1C;
}

.search-empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

.search-result-count {
    padding: 15px 20px;
    font-size: 0.85rem;
    color: #8A5353;
    position: absolute;
    top: 0;
    right: 0;
}

.search-picker {
    position: relative;
    margin-bottom: 24px;
}

.search-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    border: 1.5px dashed rgba(88, 28, 28, 0.2);
    background: transparent;
    color: #8A5353;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.search-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: rgba(249, 76, 76, 0.04);
}

.search-add-btn svg {
    flex-shrink: 0;
}

.search-field-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 6px;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.search-field-menu-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.search-field-menu-item {
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: #581C1C;
    cursor: pointer;
    transition: background-color 0.1s;
}

.search-field-menu-item:hover {
    background-color: rgba(249, 76, 76, 0.06);
}

.search-field-row {
    position: relative;
    padding: 12px 40px 12px 16px;
    margin-bottom: 12px;
    border: 1.5px solid rgba(88, 28, 28, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.search-field-row-visible {
    opacity: 1;
    transform: translateY(0);
}

.search-field-row .book-edit-group {
    margin-bottom: 0;
}

.search-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #8A5353;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-remove-btn:hover {
    background-color: rgba(249, 76, 76, 0.1);
    color: var(--primary);
}

.search-hint {
    display: block;
    font-size: 11px;
    color: #8A5353;
    margin-top: 4px;
}

.search-submit {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(88, 28, 28, 0.08);
}


/* Login Page */

body.login .main-content-area,
body.register .main-content-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 100%;
    height: 100%;
}

body.login .main-content-wrapper,
body.register .main-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

body.login .action-bar,
body.register .action-bar {
    display: none;
}

/* Login-specific styles (layout reuses setup-* classes) */
.login-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-top: 20px;
    font-size: 14px;
}

.login-links a,
.login-links .login-link-btn {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.login-links a:hover,
.login-links .login-link-btn:hover {
    text-decoration: underline;
}

.login-links a + a::before,
.login-links a + .login-link-btn::before,
.login-links .login-link-btn + a::before,
.login-links .login-link-btn + .login-link-btn::before {
    content: "|";
    color: #ccc;
    margin: 0 12px;
    font-weight: 400;
    text-decoration: none;
    display: inline-block;
}

.login-register {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.login-register a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.login-register a:hover {
    text-decoration: underline;
}

.login-oauth {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.login-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1.5px solid #ddd;
    background: #fff;
    transition: border-color 0.2s;
}

.login-oauth-btn:hover {
    border-color: var(--primary);
}

/*-----------*/
/*   FORMS   */
/*-----------*/






/* TOASTS */

@keyframes toast-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(16px); }
}

#toast-container {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 200;
    pointer-events: none;
}

.toast {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 500;
    color: #581C1C;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    border-left: 4px solid #581C1C;
    animation: toast-in 0.25s ease forwards;
    white-space: nowrap;
}

.toast-error  { border-left-color: var(--primary); color: #c0392b; }
.toast-success { border-left-color: #00b450; color: #1a6e3a; }
.toast-warning { border-left-color: #e8bf5e; color: #6b4c00; }
.toast-info    { border-left-color: #581C1C; color: #581C1C; }

.toast-hiding {
    animation: toast-out 0.35s ease forwards;
}

/* AUTHOR PAGE */

.author-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 24px 20px 16px;
}

.author-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(88, 28, 28, 0.2);
}

.author-bio-text {
    flex: 1;
    min-width: 0;
}

.author-bio-text h2 {
    margin-bottom: 8px;
}

.author-bio-text p {
    font-size: 14px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-goodreads-link {
    font-size: 13px;
    color: #8A5353;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    opacity: 0.75;
}

.author-goodreads-link:hover {
    opacity: 1;
    color: #581C1C;
}

/* BOOK DETAIL PAGE */


.book-detail-wrapper {
    position: relative;
    background-color: rgba(255, 255, 255);
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 54px 40px;
    height: calc(100% + 20px);
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 20px;
    margin: -10px;
    container-type: inline-size;
}

.book-detail-layout {
    background-color: rgba(0, 0, 0, .02);
    display: flex;
    padding: 20px;
    border-radius: 25px;
    gap: 36px;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.book-detail-columns {
    gap: 36px;
    height: 100%;
    display: flex;
    max-width: 100%;
    width: fit-content;
    flex-direction: row;
    justify-content: center;
}

.book-detail-cover-col {
    display:flex;
    flex-direction: column;
    height: 100%;
    align-items: flex-end;
    width: 40%;
}

.book-detail-cover-img {
    height: auto;
    max-height: 100%;
    max-width: 100%;
    border-radius: 16px;
    background-color: transparent;
    box-shadow: 0 0 20px 15px rgba(88, 28, 28, 0.01);
    display: block;
    object-fit: contain;
}

.book-detail-meta-col {
    display: flex;
    align-items: top;
    flex-direction: column;
    gap: 20px;
    max-width: 700px;
    min-width: 0;
    overflow-y: auto;
    flex: 1 1 60%;
    height: 100%;
    padding-top: 20px;
}

.book-detail-meta-cont {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    gap:5px;
    padding: 16px;
    flex-shrink: 1;
    height:100%;
}


@media (max-width: 768px) {
    .book-detail-wrapper {
        container-type: normal;
        overflow: visible;
        height: auto;
        padding: 20px;
    }
    .book-detail-layout {
        height: auto;
        overflow: visible;
    }
    .book-detail-columns {
        flex-direction: column;
        width: 100%;
        height: auto;
    }
    .book-detail-cover-col {
        height: auto;
        flex: none;
        width: 100%;
        max-width: 100%;
    }
    .book-detail-cover-img {
        width: 100%;
        max-height: none;
    }
    .book-detail-meta-col {
        height: auto;
        min-width: unset;
        overflow-y: visible;
        flex: none;
    }
}


.title-menu-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: space-between;
    width: 100%;
}

.book-detail-title {
    font-size: 48px;
    font-weight: 500;
    color: #581C1C;
    line-height: 1.2;
    margin: 0;
}

@media (min-width: 769px) and (max-width: 1036px) {
    .book-detail-title {
        font-size: 32px;
    }
}


.book-detail-icon-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.detail-icon-btn {
    display: flex;
    width: 24px;
    height: 24px;
    border: 1px solid transparent;
    cursor: pointer;
}

.detail-action-dropdown,
.detail-icon-dropdown {
    position: relative;
}

.detail-action-popover,
.detail-icon-popover {
    position: absolute;
    top: calc(+45px);
    left: 0;
    min-width: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    margin: 0;
    align-items: flex-start;
}

.detail-icon-dropdown > .detail-icon-popover {
    right: 0;
    left: auto;
}

details[open] .detail-action-popover,
details[open] .detail-icon-popover {
    animation: pop-in 0.05s cubic-bezier(0.04, 0, 0.2, 1.25) forwards;
}

.detail-action-popover-item,
.detail-icon-popover-item {
    font-size: 14px;
    color: #581C1C;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s;
    text-align: left;
    white-space: nowrap;
}



.book-detail-author,
.book-detail-rating {
    width: 100%;
}

.book-detail-author {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.book-detail-author-name {
    font-size: 20px;
    font-weight: 600;
    color: #8A5353;
}


.book-detail-author-arrow {
    display: inline-flex;
    fill: #581C1C;
    flex-shrink: 0;
}

.book-detail-author-arrow:hover {
    opacity: 1;
    fill: var(--primary);
}

/* Base styles for all metadata content */
#book-details-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 16px;
    color: #581C1C !important;
    line-height: 1.15;
}

#book-details-content > :not(.book-detail-actions) a {
    color: inherit;
    text-decoration: none;
}

#book-details-content > :not(.book-detail-actions) a:hover {
    color: var(--primary);
}

#book-details-content > :not(.book-detail-actions) svg {
    fill: currentColor;
    opacity: 0.6;
    flex-shrink: 0;
}

/* Ratings */
.rating-star {
    color: rgba(88, 28, 28, 0.15);
    line-height: 1;
}

.rating-star.filled {
    color: #F5C518;
}

/* Description — tame embedded HTML */
#book-details-content .book-detail-description {
    padding-top: 0px;
    font-size: 16px;
    line-height: 1.15;
    max-height: 350px;
    overflow: hidden;
    position: relative;
}

#book-details-content .book-detail-description.expanded {
    max-height: none;
}

#book-details-content .book-detail-description.truncated:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

.description-read-more {
    cursor: pointer;
    color: #581C1C;
    font-size: 13px;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
}


.book-detail-description * {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    font-family: inherit !important;
    line-height: inherit !important;
}

.book-detail-description h1,
.book-detail-description h2,
.book-detail-description h3,
.book-detail-description h4,
.book-detail-description h5,
.book-detail-description h6 {
    font-weight: 600 !important;
    margin: 10px 0 4px 0;
}

/* buttons */

.book-detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}


/* Split button */
.split-btn {
    display: inline-flex;
}

.split-btn-main {
    border-radius: 10px 0 0 10px;
    padding-right: 16px;
    position: relative;
}

.split-btn-main:only-child {
    border-radius: 10px;
}

.split-btn-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    background-color: var(--primary);
    color: white;
    transition: background-color 0.2s;
    list-style: none;
}

.split-btn-toggle svg {
    fill: white;
}


.book-detail-metadata {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.book-detail-shelves {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.book-detail-shelves-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.4;
    width: 100%;
}

.book-detail-shelf-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, .03);
    border-radius: 6px;
    font-size: 13px;
    color: rgba(0, 0, 0, .6);
}

a.book-detail-shelf-tag,
a.book-detail-shelf-tag:hover,
.book-detail-shelf-tag a,
.book-detail-shelf-tag a:hover {
    text-decoration: none;
    color: rgba(0, 0, 0, .6) !important;
}

.shelf-add-dropdown {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.shelf-add-btn {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
}

.shelf-add-btn::-webkit-details-marker {
    display: none;
}

.shelf-add-btn svg {
    width: 14px;
    height: 14px;
}

.shelf-filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shelf-filter-item label {
    flex: 1;
}

.shelf-menu {
    position: relative;
}

.shelf-menu-btn {
    cursor: pointer;
    list-style: none;
    padding: 0;
    opacity: 0;
    display: flex;
    align-items: center;
}

.shelf-menu-btn::-webkit-details-marker {
    display: none;
}

.shelf-filter-item:hover .shelf-menu-btn {
    opacity: 0.5;
}

.shelf-menu-btn:hover {
    opacity: 0.8 !important;
}

.shelf-menu-popover {
    z-index: 100;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    width: 120px;
    padding: 4px 0;
}

.shelf-menu-item {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.shelf-menu-item:hover {
    background: rgba(0, 0, 0, .04);
}

.shelf-delete-btn:hover {
    color: var(--danger-red);
}

@media (hover: none) {
    .shelf-menu-btn {
        opacity: 0.3;
    }
}

.sidebar-create-shelf {
    position: relative;
}

.sidebar-create-shelf-btn {
    cursor: pointer;
    opacity: 0.4;
    margin-left: 4px;
}

.create-shelf-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    min-width: 220px;
}

.create-shelf-header {
    font-weight: 600;
    font-size: 14px;
}

.create-shelf-input {
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.create-shelf-input:focus {
    border-color: rgba(0, 0, 0, .3);
}

.create-shelf-error {
    font-size: 12px;
    color: var(--danger-red);
}

.create-shelf-error:empty {
    display: none;
}

.create-shelf-public {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.create-shelf-submit {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
}

.popover-overlay {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.create-shelf-popover {
    position: fixed;
    z-index: 100;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 220px;
}

.shelf-add-dropdown .detail-action-popover {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    margin-top: 4px;
}

.book-detail-shelf-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 0;
    line-height: 1;
    max-width: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    transition: max-width 0.15s ease, margin-left 0.15s ease;
}

.book-detail-shelf-tag:hover .book-detail-shelf-remove {
    max-width: 20px;
    margin-left: 5px;
}

#book-details-content .book-detail-shelf-remove svg,
#book-details-content .shelf-add-btn svg {
    fill: #666;
    opacity: 1;
}

#book-details-content .book-detail-shelf-remove:hover svg {
    fill: var(--danger-red);
}

@media (hover: none) {
    .book-detail-shelf-remove {
        max-width: 20px;
        margin-left: 5px;
    }
}


/* Toggles */

.book-detail-toggles {
    margin-top: 8px;
}

.book-detail-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #581C1C;
    cursor: pointer;
    opacity: 0.75;
}


/* BOOK EDIT PAGE */

.book-edit-group {
    margin-bottom: 16px;
}

.book-edit-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #8A5353;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.book-edit-field {
    width: 100%;
    font-size: 0.95rem;
    font-weight: 500;
    color: #581C1C;
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(88, 28, 28, 0.1);
    border-radius: 10px;
    padding: 8px 14px;
    height: 40px;
    outline: none;
    box-sizing: border-box;
    box-shadow: inset 0 0 8px -1px rgba(0, 0, 0, 0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.book-edit-field:focus {
    border-color: #FBCA70;
    box-shadow: inset 0 0 8px -1px rgba(0, 0, 0, 0.25);
}

.book-edit-field::placeholder {
    color: #aaa;
    font-weight: 400;
}

textarea.book-edit-field {
    height: auto;
    min-height: 120px;
    resize: vertical;
}

.book-edit-autocomplete {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}

.book-edit-autocomplete-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #581C1C;
}

.book-edit-autocomplete-item:hover,
.book-edit-autocomplete-item.active {
    background: rgba(88, 28, 28, 0.07);
}

select.book-edit-field {
    appearance: auto;
    cursor: pointer;
}

.book-edit-title-input {
    font-size: 1.4rem;
    font-weight: 700;
    height: auto;
}

.book-edit-author-input {
    font-weight: 500;
    height: auto;
}

.book-edit-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.book-edit-inline .book-edit-group {
    flex: 1;
}

.book-edit-inline .book-edit-group-narrow {
    flex: 0 0 100px;
}

.book-edit-identifiers table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.book-edit-identifiers td {
    padding: 0 4px 0 0;
}

.book-edit-identifiers td:last-child {
    padding-right: 0;
    width: 80px;
}

.book-edit-identifiers input {
    width: 100%;
}



.book-detail-layout:has(#book_edit_frm) .book-detail-cover-col {
    flex: 0 0 auto;
    width: auto;
    max-width: 300px;
    align-items: flex-start;
}

.book-detail-layout:has(#book_edit_frm) .book-detail-cover-img {
    height: auto;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.book-edit-close-btn {
    position: absolute;
    top: 50px;
    right: 50px;
    z-index: 10;
    color: #581C1C;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.book-edit-close-btn:hover {
    opacity: 1;
}


.book-edit-sidebar-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(88, 28, 28, 0.1);
}

.book-edit-sidebar-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: #8A5353;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
}

.book-format-list {
    margin-bottom: 8px;
}

.book-format-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #581C1C;
    background: rgba(88, 28, 28, 0.08);
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 4px 4px 0;
}

.book-format-empty {
    font-size: 12px;
    color: #8A5353;
    margin: 0 0 8px 0;
}

.book-edit-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-edit-cover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-bottom: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.book-edit-cover-container {
    position: relative;
}

.book-edit-cover-container:hover .book-edit-cover-overlay {
    opacity: 1;
    pointer-events: auto;
}

.book-edit-cover-overlay-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    color: #581C1C;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.book-edit-cover-overlay-btn::-webkit-details-marker {
    display: none;
}

.book-edit-cover-import-dropdown {
    position: relative;
}

.book-edit-cover-overlay-btn svg {
    fill: #581C1C;
}

.book-edit-cover-url-popover {
    min-width: 280px;
}

.book-edit-field-with-clear {
    position: relative;
    display: flex;
    align-items: center;
}

.book-edit-field-with-clear .book-edit-field {
    padding-right: 30px;
}

.book-edit-field-clear {
    position: absolute;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.4;
}

.book-edit-field-clear svg {
    fill: #581C1C;
}

.book-edit-field-clear:hover {
    opacity: 1;
}

.book-edit-field-clear:hover svg {
    fill: #F94C4C;
}

.book-edit-row-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.4;
}

.book-edit-row-remove svg {
    fill: #581C1C;
}

.book-edit-row-remove:hover {
    opacity: 1;
}

.book-edit-row-remove:hover svg {
    fill: #F94C4C;
}

.book-edit-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #581C1C;
    margin-bottom: 16px;
}

.book-edit-delete-btn {
    color: #F94C4C;
    border-color: rgba(249, 76, 76, 0.3);
}

.book-edit-delete-btn svg {
    fill: #F94C4C;
}

.book-edit-delete-item {
    color: #F94C4C !important;
}

.book-edit-delete-item:hover {
    background-color: rgba(249, 76, 76, 0.08) !important;
}

.book-edit-star-rating {
    display: flex;
    gap: 4px;
}

.book-edit-star {
    font-size: 24px;
    color: rgba(88, 28, 28, 0.15);
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
}

.book-edit-star.filled, .book-edit-star:hover,
.book-edit-star.hover {
    color: #fdc03c;
}

.book-edit-checkbox input[type="checkbox"] {
    accent-color: var(--primary);
}

.book-edit-xchange {
    display: flex;
    justify-content: center;
    margin: -8px 0 8px 0;
}


/* ADMIN PAGES */

.admin-section-link {
 color: inherit;
}

.admin-page-wrapper {
    flex-grow: 1;
    padding: 100px 40px;
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    overflow-x: hidden;
    margin: 0;
    border-radius: 40px;
    background-color: rgba(255, 255, 255, 0.99);
    flex-direction: column;
    gap: 128px;
    margin: -10px 0;
    height: calc(100% + 20px);
    box-sizing: border-box;
}

.admin-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-margin-top: 30px;
}

.admin-section-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

.admin-section-header svg {
    width: 36px;
    height: 36px;
}

.admin-section-title {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 400;
    color: #581C1C;
}

.admin-section-body {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 20px;
    padding: 20px;
}

.admin-subsection-wrapper{
    display: flex;
    flex-direction: column;    
}

.admin-subsection-title {
    font-size: 24px;
    font-weight: 400;
}

/* Radio Toggle Group — track */
.radio-group {
    display: inline-flex;
    align-self: flex-start;
    position: relative;
    border-radius: 999px;
    background: white;
    box-shadow: inset 0 0 4px 0px rgba(0, 0, 0, .1);
    border-width:1px;
    border-style:solid;
    border-color:#e1e1e1;
}

/* Thumb */
.radio-group-thumb {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    border-radius: 999px;
    background: #082dff;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .25),
                inset 0 0 6px 0 rgba(0, 0, 0, .1);
    transition: transform 0.2s;
    z-index: 0;
}

/* Move thumb right when second option is selected */
.radio-group:has(.radio-card:last-child input:checked) .radio-group-thumb {
    transform: translateX(100%);
}

.radio-group-description {
    padding: 0;
    margin: 6px 0 0 0;
}

.radio-card {
    padding: 0.75rem 0;
    cursor: pointer;
    font-size: 1rem;
    width: 10rem;
    text-align: center;
    white-space: nowrap;
    background: transparent;
    color: rgba(0, 0, 0, 0.35);
    transition: color 0.2s;
    position: relative;
    z-index: 1;
}

.radio-card:has(input:checked) {
    color: white;
}

.radio-card input {
    display: none;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.user-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-style: solid;
    border-color: #e1e1e1;
    border-width: 1px;
    box-shadow: inset 0 0 4px 0px rgba(0, 0, 0, .1);
}

.user-card-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.user-card-info {
    min-width: 0;
}

.user-card:hover {
    background-color: rgba(255, 255, 255, 1);
}

.user-card-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed #d4d4d4;
    background-color: transparent;
    box-shadow: inset 0 0 4px 0px rgba(0, 0, 0, .1);
}

.user-card-add-text {
    font-size: small;
    font-weight: 500;
    color: #581C1C;
}

.user-card-add:hover {
    border-color: rgba(88, 28, 28, 0.4);
}

.user-card-name {
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-role {
    margin: 0;
    font-size: small;
}




.toggle-group {
    display: flex;
    flex-direction: row;
}

.toggle-wrapper {
    padding: 10px;
}

.toggle-info-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0px;
    padding: 10px;
}

.toggle-name {
    padding: 0;
    margin: 0;
}
.toggle-desc {
    padding: 0;
    margin: 0;
}

/* Hide the real checkbox */
.toggle-boolean {
    display: none;
}

/* The pill track */
.toggle-span {
    display: inline-block;
    width: 44px;
    height: 24px;
    background: white;
    border-radius: 20px;
    box-shadow: inset 0 0 4px 0px rgba(0, 0, 0, .1);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    border-width:1px;
    border-style:solid;
    border-color:#e1e1e1;
}

/* The sliding thumb */
.toggle-span::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .25),
                inset 0 0 6px 0 rgba(0, 0, 0, .1);
    top: 3px;
    left: 3px;
    transition: transform 0.2s, background 0.2s;
}

/* Checked state: subtle track tint + thumb goes red and slides right */

.toggle-label input:checked + .toggle-span::after {
    background: #80C900;
    transform: translateX(20px);
}

/* Setting path row (label + value inline) */
#smtp-fields {
    max-width: 700px;
    margin-left: 50px;
}

.email-test-btn {
    background-color: #2563eb;
    color: white;
}

.email-test-btn:hover {
    background-color: #1d4ed8;
    color: white;
    transform: translateY(-1px);
}

.email-test-btn.email-verified {
    background-color: #16a34a;
    cursor: default;
    pointer-events: none;
}

.email-test-btn.email-testing {
    background-color: #64748b;
    cursor: wait;
}

.email-test-btn.email-error {
    background-color: var(--primary);
    color: white;
}

.email-test-btn.email-error:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.email-test-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.email-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: email-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes email-spin {
    to { transform: rotate(360deg); }
}

.setting-path-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 10px 10px;
}

.setting-path-label {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    min-width: 220px;
    flex-shrink: 0;
}

.setting-path-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: #000;
    font-family: monospace;
}

.setting-input {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: #000;
    font-family: monospace;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    padding: 6px 12px;
    height: 40px;
    outline: none;
    min-width: 120px;
    box-sizing: border-box;
    box-shadow: inset 0 0 8px -1px rgba(0, 0, 0, 0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.setting-input:focus {
    border-color: #FBCA70;
    box-shadow: inset 0 0 8px -1px rgba(0, 0, 0, 0.08);
}

.setting-input.is-invalid {
    border-color: #F94C4C;
}

.field-error {
    font-size: 0.78rem;
    color: #F94C4C;
    margin-top: 2px;
    padding-left: 12px;
}

.setting-input::placeholder {
    color: #aaa;
    font-weight: 400;
}

select.setting-input {
    appearance: auto;
    cursor: pointer;
}

/* Google Drive setup dialog */
.gdrive-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 28px;
    box-shadow: -1px 2px 10px #00000033;
    z-index: 100;
    color: #000;
}

.gdrive-dialog p {
    margin: 0 0 14px 0;
    color: #000;
    opacity: 1;
}

.gdrive-dialog ol {
    margin: 0;
    padding-left: 20px;
    list-style: decimal;
}

.gdrive-dialog li {
    color: #000 !important;
    font-weight: 300 !important;
    font-size: inherit !important;
    margin: 4px 0 !important;
    list-style: decimal !important;
    display: list-item !important;
    padding: 0 !important;
}


/* Server action buttons */
.server-action-buttons {
    display: flex;
    gap: 12px;
    padding: 4px 0;
}

.server-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    color: #333;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}

.server-action-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.server-action-btn svg {
    opacity: 0.7;
}


/*-----------------*/
/*  SETUP WIZARD   */
/*-----------------*/

#setup-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.setup-card {
    background: #fff;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: inset 3px 4px 4px 0 rgba(0, 0, 0, 0.25);
}



.setup-card-wide {
    display: flex;
    max-width: 900px;
    width: 100%;
    min-height: 480px;
}

.setup-card-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 700px;
    width: 100%;
    padding: 60px 50px;
}

.setup-hidden {
    display: none !important;
}

/* Illustration (matches login) */
.setup-illustration {
    padding: 20px 0 15px 20px;
    margin: 0 -140px 0 0;
}

.setup-illustration img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Form side */
.setup-form-side {
    flex: 1 1 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 40px;
}

.setup-heading {
    font-family: 'Inter', sans-serif;
    font-size: 43px;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 8px;
    text-align: center;
}

.setup-subheading {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    color: #666;
    margin-bottom: 28px;
    text-align: center;
}

.setup-field {
    margin-bottom: 16px;
}

.setup-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.setup-input-wrapper {
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    padding: 0 12px;
    height: 44px;
    background: #fff;
    box-shadow: inset 0 0 8px -1px rgba(0, 0, 0, 0.25);
}

.setup-input-wrapper:focus-within {
    border-color: #FBCA70;
    box-shadow: inset 0 0 8px -1px rgba(0, 0, 0, 0.25);
}

.setup-input-icon {
    flex-shrink: 0;
    margin-right: 10px;
}

.setup-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: transparent;
}

.setup-input-wrapper input::placeholder {
    color: #aaa;
}

.setup-password-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    margin-right: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.setup-submit-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    height: 46px;
    border: none;
    border-radius: 15px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 16px;
    text-align: center;
    line-height: 46px;
    text-decoration: none;
}

.setup-submit-btn:hover {
    background: var(--primary-hover);
}

.setup-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.setup-error {
    color: #d9534f;
    font-size: 14px;
    min-height: 20px;
    margin-top: 4px;
}

.setup-success {
    color: #5cb85c;
    font-size: 14px;
    font-weight: 500;
}

.setup-library-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: fit-content;
    margin: 30px auto;
}

/* Library options toggle cards */
.setup-library-options {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.setup-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 130px;
    border: none;
    border-radius: 20px;
    background: #f0f0f0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    font-family: 'Inter', sans-serif;
    color: #888;
}

.setup-option-card:hover {
    transform: scale(1.03);
}

.setup-option-card.setup-option-active {
    background: #3366FF;
    color: #fff;
}

#step-library .setup-submit-btn {
    max-width: none;
    width: 100%;
}

.setup-upload-ready {
    text-align: center;
    color: #3366FF;
    font-size: 0.9rem;
    margin: 8px 0 4px;
}

.setup-caution {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff8e1;
    color: #8a6d00;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

.setup-caution-icon {
    flex-shrink: 0;
}

.setup-option-icon {
    margin-bottom: 10px;
}

.setup-option-label {
    font-size: 14px;
    font-weight: 600;
}

/* Checkmark */
.setup-checkmark {
    margin-bottom: 20px;
    color: #1a1a1a;
}

/* Responsive */
@media (max-width: 700px) {
    .setup-card-wide {
        flex-direction: column;
        max-width: 420px;
    }
    .setup-illustration {
        height: 220px;
        flex: none;
    }
    .setup-form-side {
        padding: 32px 24px;
    }
    #setup-wrapper {
        padding: 20px;
    }
    .setup-card-centered {
        padding: 40px 24px;
    }
    .book-detail-layout {
        flex-direction: column;
        align-items: center;
        overflow-y: auto;
    }
}

