/* ============================================================
   BOOKSHELF — Bridgerton-Inspired Elegant Theme
   ============================================================ */

/* --- Fonts & Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,600&family=Raleway:wght@300;400;500;600&family=Great+Vibes&display=swap');

:root {
    --cream:       #FAF6F0;
    --parchment:   #F2EDE4;
    --soft-white:  #FDFAF6;
    --blush:       #E8C4C0;
    --rose:        #C4827A;
    --deep-rose:   #9B5E5A;
    --dusty-blue:  #8BA5B5;
    --sage:        #8FAF8F;
    --gold:        #B8965A;
    --gold-light:  #D4AD6E;
    --gold-dark:   #8A6E3C;
    --charcoal:    #2C2520;
    --warm-gray:   #6B5E57;
    --light-gray:  #C8BFB8;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-script:  'Great Vibes', cursive;
    --font-body:    'Raleway', sans-serif;

    --shadow-soft:  0 4px 24px rgba(44,37,32,0.08);
    --shadow-card:  0 2px 16px rgba(44,37,32,0.1);
    --shadow-hover: 0 8px 32px rgba(44,37,32,0.15);
    --radius:       4px;
    --radius-lg:    8px;

    --transition: 0.25s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--cream);
    color: var(--charcoal);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(232,196,192,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139,165,181,0.12) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23B8965A' fill-opacity='0.03'%3E%3Cpath d='M30 30m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: var(--deep-rose); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--rose); }
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; }
p { margin-bottom: 1rem; }
ul { list-style: none; }

/* --- Decorative Borders --- */
.deco-border-top,
.deco-border-bottom {
    height: 6px;
    background: linear-gradient(90deg, transparent, var(--gold-light), var(--blush), var(--gold-light), transparent);
}
.deco-border-bottom { margin-top: auto; }

/* --- Navigation --- */
.main-nav {
    background: rgba(250, 246, 240, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(184,150,90,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
    color: var(--charcoal) !important;
}

.brand-script {
    font-family: var(--font-script);
    font-size: 2.2rem;
    color: var(--deep-rose);
    line-height: 0.9;
}

.brand-sub {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--warm-gray);
    margin-top: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--warm-gray);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--deep-rose);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

.nav-admin {
    color: var(--gold-dark);
    border: 1px solid rgba(184,150,90,0.3);
}

.nav-cta {
    background: var(--deep-rose);
    color: var(--cream) !important;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius);
}

.nav-cta:hover {
    background: var(--rose);
    color: var(--cream) !important;
}

.nav-cta::after { display: none; }

/* User avatar dropdown */
.nav-user {
    position: relative;
    cursor: pointer;
}

.user-avatar,
.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gold-light);
    object-fit: cover;
}

.user-avatar-placeholder {
    background: var(--deep-rose);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    background: var(--soft-white);
    border: 1px solid rgba(184,150,90,0.25);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    min-width: 180px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 100;
}

.nav-user:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-name-dropdown {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--warm-gray);
    border-bottom: 1px solid rgba(184,150,90,0.15);
    margin-bottom: 0.25rem;
}

.dropdown-item {
    display: block;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    color: var(--charcoal);
    transition: background var(--transition);
}

.dropdown-item:hover {
    background: var(--parchment);
    color: var(--deep-rose);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--charcoal);
    transition: all var(--transition);
}

/* --- Flourish Lines --- */
.nav-flourish,
.footer-flourish {
    width: 100%;
    height: 20px;
    overflow: visible;
}

.nav-flourish svg,
.footer-flourish svg {
    width: 100%;
    height: 100%;
}

/* --- Main Content --- */
.main-content {
    min-height: calc(100vh - 200px);
}

/* --- Page Hero --- */
.page-hero {
    text-align: center;
    padding: 4rem 2rem 3rem;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(232,196,192,0.2) 0%, transparent 70%);
    pointer-events: none;
}

.hero-ornament {
    font-family: var(--font-script);
    font-size: 1.2rem;
    color: var(--gold);
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 300;
    color: var(--charcoal);
    letter-spacing: 0.02em;
}

.page-title em {
    font-style: italic;
    color: var(--deep-rose);
}

.page-subtitle {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--warm-gray);
    margin-top: 0.75rem;
    font-weight: 300;
}

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem auto;
    max-width: 400px;
}

.hero-divider::before,
.hero-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.hero-divider::after {
    background: linear-gradient(90deg, var(--gold), transparent);
}

.hero-diamond {
    color: var(--gold);
    font-size: 0.6rem;
}

/* --- Container & Grid --- */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* --- Book Card --- */
.book-card {
    background: var(--soft-white);
    border: 1px solid rgba(184,150,90,0.15);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(184,150,90,0.35);
}

.book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.book-cover-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, var(--parchment) 0%, var(--blush) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
}

.book-cover-placeholder .placeholder-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--charcoal);
    line-height: 1.3;
    margin-top: 0.5rem;
}

.book-cover-placeholder .placeholder-icon {
    font-size: 2rem;
    opacity: 0.5;
}

.book-card-body {
    padding: 1rem;
}

.book-card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--charcoal);
    line-height: 1.3;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-author {
    font-size: 0.78rem;
    color: var(--warm-gray);
    font-style: italic;
    font-family: var(--font-display);
    margin-bottom: 0.5rem;
}

.book-type-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

.badge-physical { background: rgba(143,175,143,0.2); color: var(--sage); border: 1px solid rgba(143,175,143,0.4); }
.badge-audiobook { background: rgba(139,165,181,0.2); color: var(--dusty-blue); border: 1px solid rgba(139,165,181,0.4); }
.badge-ebook { background: rgba(184,150,90,0.15); color: var(--gold-dark); border: 1px solid rgba(184,150,90,0.3); }

.book-status-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

.status-read { background: rgba(143,175,143,0.25); color: #5A8A5A; }
.status-reading { background: rgba(139,165,181,0.25); color: #4A7A9B; }
.status-want { background: rgba(184,150,90,0.2); color: var(--gold-dark); }
.status-dnf { background: rgba(196,130,122,0.2); color: var(--rose); }

/* Star ratings */
.star-rating {
    display: flex;
    gap: 2px;
    margin-bottom: 0.5rem;
}

.star {
    color: var(--light-gray);
    font-size: 0.9rem;
}
.star.filled { color: var(--gold); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--deep-rose);
    color: var(--cream);
}
.btn-primary:hover {
    background: var(--rose);
    color: var(--cream);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(155,94,90,0.35);
}

.btn-secondary {
    background: transparent;
    color: var(--deep-rose);
    border: 1px solid var(--deep-rose);
}
.btn-secondary:hover {
    background: var(--deep-rose);
    color: var(--cream);
}

.btn-gold {
    background: var(--gold);
    color: var(--cream);
}
.btn-gold:hover {
    background: var(--gold-dark);
    color: var(--cream);
    transform: translateY(-1px);
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.7rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 0.85rem; }

.btn-icon { padding: 0.5rem; }

/* --- Forms --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--warm-gray);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--soft-white);
    border: 1px solid rgba(184,150,90,0.3);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--charcoal);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,150,90,0.12);
}

textarea.form-control { resize: vertical; min-height: 120px; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B5E57' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* --- Cards & Panels --- */
.panel {
    background: var(--soft-white);
    border: 1px solid rgba(184,150,90,0.2);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--charcoal);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(184,150,90,0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.panel-title::before {
    content: '';
    display: block;
    width: 3px;
    height: 1.4rem;
    background: var(--deep-rose);
    border-radius: 2px;
    flex-shrink: 0;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--soft-white);
    border: 1px solid rgba(184,150,90,0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blush), var(--gold-light));
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 300;
    color: var(--deep-rose);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--warm-gray);
}

/* --- Search Bar --- */
.search-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: var(--soft-white);
    border: 1px solid rgba(184,150,90,0.3);
    border-radius: 40px;
    padding: 0.4rem 0.4rem 0.4rem 1.25rem;
    transition: box-shadow var(--transition);
}

.search-bar:focus-within {
    box-shadow: 0 0 0 3px rgba(184,150,90,0.15);
    border-color: var(--gold);
}

.search-bar input {
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--charcoal);
    flex: 1;
    min-width: 0;
}

.search-bar input:focus { outline: none; }
.search-bar input::placeholder { color: var(--light-gray); }

/* --- Reading Log Entry --- */
.log-entry {
    background: var(--soft-white);
    border: 1px solid rgba(184,150,90,0.18);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1.25rem;
    align-items: start;
    transition: all var(--transition);
    margin-bottom: 1.25rem;
}

.log-entry:hover {
    box-shadow: var(--shadow-card);
    border-color: rgba(184,150,90,0.3);
}

.log-cover {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 2px 4px 12px rgba(44,37,32,0.15);
}

.log-cover-placeholder {
    width: 80px;
    height: 120px;
    background: linear-gradient(135deg, var(--parchment), var(--blush));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.log-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.2rem;
}

.log-author {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--warm-gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.log-dates {
    font-size: 0.75rem;
    color: var(--light-gray);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.log-review {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--warm-gray);
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 2px solid rgba(184,150,90,0.3);
    padding-left: 0.75rem;
    margin-top: 0.5rem;
}

/* --- Star Rating Input --- */
.star-rating-input {
    display: flex;
    gap: 4px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.star-rating-input input { display: none; }

.star-rating-input label {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--light-gray);
    transition: color var(--transition);
}

.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: var(--gold);
}

/* --- Alerts --- */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    border-left: 3px solid;
}

.alert-success {
    background: rgba(143,175,143,0.15);
    border-color: var(--sage);
    color: #4A7A4A;
}

.alert-error {
    background: rgba(196,130,122,0.15);
    border-color: var(--rose);
    color: var(--deep-rose);
}

.alert-info {
    background: rgba(139,165,181,0.15);
    border-color: var(--dusty-blue);
    color: #3A6A8A;
}

/* --- Tabs --- */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(184,150,90,0.2);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab-btn {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--warm-gray);
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-block;
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--deep-rose);
    border-bottom-color: var(--deep-rose);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44,37,32,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--soft-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(44,37,32,0.25);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition);
    border: 1px solid rgba(184,150,90,0.2);
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(184,150,90,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--warm-gray);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.modal-close:hover { color: var(--deep-rose); }

.modal-body {
    padding: 1.5rem 2rem;
}

.modal-footer {
    padding: 1rem 2rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid rgba(184,150,90,0.15);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 2.5rem 0;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--warm-gray);
    border: 1px solid rgba(184,150,90,0.25);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition);
    padding: 0 0.5rem;
}

.page-btn:hover { background: var(--parchment); color: var(--deep-rose); }
.page-btn.current { background: var(--deep-rose); color: var(--cream); border-color: var(--deep-rose); }

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-pill {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.35rem 1rem;
    border: 1px solid rgba(184,150,90,0.3);
    border-radius: 20px;
    color: var(--warm-gray);
    background: var(--soft-white);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--deep-rose);
    color: var(--cream);
    border-color: var(--deep-rose);
}

/* --- Admin Layout --- */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 200px);
    gap: 0;
}

.admin-sidebar {
    background: var(--charcoal);
    padding: 2rem 0;
}

.admin-sidebar-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--light-gray);
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: rgba(200,191,184,0.8);
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: rgba(255,255,255,0.05);
    color: var(--cream);
    border-left-color: var(--gold);
}

.admin-content {
    padding: 2.5rem;
    background: var(--cream);
}

/* --- Book Detail Page --- */
.book-detail {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    align-items: start;
}

.book-detail-cover {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: 4px 8px 24px rgba(44,37,32,0.2);
}

.book-detail-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
    line-height: 1.15;
}

.book-detail-subtitle {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--warm-gray);
    margin-bottom: 0.75rem;
}

.book-detail-author {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--deep-rose);
    margin-bottom: 1rem;
}

.book-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--parchment);
    border-radius: var(--radius);
}

.book-meta-item {
    text-align: center;
}

.meta-value {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--charcoal);
    display: block;
}

.meta-label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--warm-gray);
}

/* --- Login Page --- */
.login-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.login-card {
    background: var(--soft-white);
    border: 1px solid rgba(184,150,90,0.25);
    border-radius: var(--radius-lg);
    padding: 3rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-hover);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blush), var(--gold-light), var(--dusty-blue));
}

.login-logo {
    font-family: var(--font-script);
    font-size: 3.5rem;
    color: var(--deep-rose);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.login-tagline {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--warm-gray);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 1.5px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 0.75rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--charcoal);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    width: 100%;
    justify-content: center;
}

.google-btn:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
    color: var(--charcoal);
}

.google-logo {
    width: 20px;
    height: 20px;
}

/* --- Spinner --- */
.spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(184,150,90,0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 2rem auto;
}

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

/* --- Loading skeleton --- */
.skeleton {
    background: linear-gradient(90deg, var(--parchment) 25%, var(--soft-white) 50%, var(--parchment) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Footer --- */
.main-footer {
    background: var(--charcoal);
    padding: 3rem 2rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
}

.brand-script-sm {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--blush);
    display: block;
    margin-bottom: 0.25rem;
}

.footer-tagline {
    font-family: var(--font-display);
    font-style: italic;
    color: rgba(200,191,184,0.7);
    font-size: 0.9rem;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.footer-links a {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(200,191,184,0.7);
    transition: color var(--transition);
}

.footer-links a:hover { color: var(--gold-light); }

.footer-copy {
    font-size: 0.72rem;
    color: rgba(200,191,184,0.4);
    text-align: right;
    margin: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--soft-white);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid rgba(184,150,90,0.2);
        box-shadow: var(--shadow-card);
        align-items: flex-start;
    }

    .nav-links.open { display: flex; }

    .nav-inner { position: relative; }

    .books-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.25rem; }

    .log-entry { grid-template-columns: 60px 1fr; }
    .log-entry > :last-child { grid-column: 1 / -1; }

    .book-detail { grid-template-columns: 1fr; }
    .book-detail-cover { max-width: 200px; margin: 0 auto; }

    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }

    .footer-inner { grid-template-columns: 1fr; text-align: center; }
    .footer-copy { text-align: center; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }
.italic { font-style: italic; }
.bold { font-weight: 600; }
.muted { color: var(--warm-gray); }
.gold { color: var(--gold); }
.rose { color: var(--deep-rose); }

/* Search Results in Modal */
.book-search-result {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(184,150,90,0.2);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.book-search-result:hover {
    border-color: var(--gold);
    background: var(--parchment);
}

.book-search-result.selected {
    border-color: var(--deep-rose);
    background: rgba(196,130,122,0.08);
}

.search-result-cover {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.search-result-cover-placeholder {
    width: 50px;
    height: 75px;
    background: var(--parchment);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.search-result-info { flex: 1; min-width: 0; }

.search-result-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

.search-result-author {
    font-size: 0.8rem;
    color: var(--warm-gray);
    font-style: italic;
    font-family: var(--font-display);
    margin-bottom: 0.25rem;
}

.search-result-meta {
    font-size: 0.72rem;
    color: var(--light-gray);
}

/* Decorative quote block */
.decorative-quote {
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
}

.decorative-quote p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--warm-gray);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.decorative-quote::before {
    content: '\201C';
    font-family: var(--font-display);
    font-size: 6rem;
    color: rgba(184,150,90,0.15);
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    line-height: 1;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--warm-gray);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--light-gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
