/* BookBesties.eu — Custom Styles */

:root {
    color-scheme: light;
}

body {
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.container {
    flex: 1;
}

.card {
    border-radius: 0.5rem;
}

.progress {
    border-radius: 0.5rem;
}

.navbar-brand {
    font-size: 1.3rem;
}

.card-img-top {
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Notification dot for pending requests */
.notification-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    position: relative;
    top: -6px;
    margin-left: -2px;
}

/* Re-read count badge on shelf books */
.shelf-badge-reread {
    position: absolute;
    top: 2px;
    left: 2px;
    background: #6f42c1;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    line-height: 1.3;
    z-index: 2;
}

/* Spoiler badges */
.badge.bg-warning {
    font-size: 0.75rem;
}

/* Star ratings */
.bi-star-fill.text-warning {
    color: #ffc107 !important;
}

/* ───────────────────────────────────────
   COZY LIBRARY — warm palette & bookshelf
   ─────────────────────────────────────── */

:root {
    --wood-dark: #5c3d2e;
    --wood-mid: #8b5e3c;
    --wood-light: #c9a06c;
    --warm-bg: #fdf6ee;
    --warm-accent: #b8651a;
    --warm-accent-hover: #9a5415;
    --coffee: #3e2723;
    --cream: #fff8f0;
}

/* Heading */
.cozy-heading {
    color: var(--wood-dark);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Warm button */
.btn-warm {
    background: linear-gradient(135deg, var(--warm-accent), #d4813b);
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 0.4rem;
}
.btn-warm:hover, .btn-warm:focus {
    background: linear-gradient(135deg, var(--warm-accent-hover), var(--warm-accent));
    color: #fff;
}

.btn-xs {
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: 0.25rem;
}

.cozy-input {
    border-color: var(--wood-light);
    border-radius: 0.35rem;
}
.cozy-input:focus {
    border-color: var(--warm-accent);
    box-shadow: 0 0 0 0.2rem rgba(184, 101, 26, 0.18);
}

.cozy-progress {
    background-color: #ede0d0;
    border-radius: 1rem;
    overflow: hidden;
}
.bg-warm {
    background: linear-gradient(90deg, var(--warm-accent), #d4813b) !important;
}

/* ── Coffee-table section ── */

.coffee-table-section {
    position: relative;
}

.coffee-table-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--coffee);
    margin-bottom: 0.75rem;
}

.coffee-table {
    background: linear-gradient(180deg, var(--cream) 0%, #f5ebe0 100%);
    border: 1px solid #e6d5c3;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    box-shadow: 0 6px 24px rgba(92, 61, 46, 0.1),
                inset 0 -3px 0 0 #dcc8ac;
    position: relative;
    overflow: visible;
}

/* Coffee mug — pure CSS */
.coffee-mug {
    flex-shrink: 0;
    position: relative;
    width: 52px;
    align-self: flex-end;
    margin-bottom: -4px;
}

.mug-body {
    width: 42px;
    height: 36px;
    background: #fff;
    border: 3px solid #bbb;
    border-radius: 0 0 10px 10px;
    position: relative;
    box-shadow: inset 0 -6px 12px rgba(62, 39, 35, 0.12);
}
.mug-body::before {
    content: '';
    position: absolute;
    top: 3px; left: 4px; right: 4px;
    height: 8px;
    background: linear-gradient(180deg, #6f4e37, #8b6f4e);
    border-radius: 0 0 4px 4px;
}
.mug-handle {
    position: absolute;
    right: -12px;
    top: 4px;
    width: 12px;
    height: 18px;
    border: 3px solid #bbb;
    border-left: none;
    border-radius: 0 8px 8px 0;
}

/* Steam animation */
.steam {
    position: absolute;
    top: -18px;
    left: 8px;
    display: flex;
    gap: 4px;
}
.steam span {
    width: 3px;
    height: 14px;
    background: rgba(180,180,180,0.4);
    border-radius: 50%;
    animation: steam-rise 2s ease-in-out infinite;
}
.steam span:nth-child(2) {
    animation-delay: 0.4s;
    height: 12px;
}
.steam span:nth-child(3) {
    animation-delay: 0.8s;
    height: 10px;
}

@keyframes steam-rise {
    0%   { opacity: 0.2; transform: translateY(0) scaleX(1); }
    50%  { opacity: 0.6; transform: translateY(-8px) scaleX(1.4); }
    100% { opacity: 0; transform: translateY(-18px) scaleX(0.6); }
}

/* Books on the coffee table */
.reading-books {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    flex: 1;
}

.reading-nook-card {
    display: flex;
    gap: 1rem;
    background: rgba(255,255,255,0.65);
    border-radius: 0.75rem;
    padding: 0.85rem;
    flex: 1 1 280px;
    min-width: 0;
    box-shadow: 0 2px 8px rgba(92, 61, 46, 0.08);
    transition: transform 0.15s;
}
.reading-nook-card:hover {
    transform: translateY(-2px);
}

.reading-cover {
    width: 72px;
    height: 102px;
    object-fit: cover;
    border-radius: 0.4rem;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.reading-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: linear-gradient(145deg, var(--wood-mid), var(--wood-dark));
    color: var(--wood-light);
    font-size: 0.65rem;
    text-align: center;
    padding: 0.35rem;
}
.reading-cover-placeholder i { font-size: 1.5rem; }
.placeholder-title {
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-cover-link { text-decoration: none; flex-shrink: 0; }
.reading-info { min-width: 0; }
.reading-info h6 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── TBR Pile ── */

.tbr-section {
    background: linear-gradient(135deg, #fef9f3 0%, #f5ebe0 100%);
    border: 1px solid #e0cdb8;
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.tbr-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--warm-accent);
}

.tbr-pile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tbr-book {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 2px 6px rgba(92, 61, 46, 0.08);
    border-left: 4px solid var(--warm-accent);
    transition: transform 0.15s, box-shadow 0.15s;
}

.tbr-book:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(92, 61, 46, 0.15);
}

.tbr-cover-link {
    flex-shrink: 0;
    text-decoration: none;
}

.tbr-cover {
    width: 60px;
    height: 88px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 2px 3px 8px rgba(0,0,0,0.18);
}

.tbr-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.25rem;
    background: linear-gradient(150deg, var(--wood-mid) 0%, var(--wood-dark) 100%);
    border-left: 3px solid var(--wood-light);
}

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

.tbr-info h6 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Bookshelf ── */

.bookshelf-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wood-dark);
}

.bookshelf {
    background:
        repeating-linear-gradient(
            90deg,
            rgba(139,94,60,0.03) 0px,
            transparent 2px,
            transparent 18px
        ),
        linear-gradient(180deg, #fdf6ee, #f5ebe0);
    border-radius: 0.75rem;
    padding: 0.5rem 1rem 0 1rem;
    border: 1px solid #e0cdb8;
}

.shelf-row {
    padding-top: 0.75rem;
}

.shelf-books {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 0 0.5rem;
    min-height: 150px;
    align-items: flex-end;
}

.shelf-plank {
    height: 14px;
    margin-top: 6px;
    background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood-mid) 60%, var(--wood-dark) 100%);
    border-radius: 0 0 3px 3px;
    box-shadow: 0 4px 8px rgba(92, 61, 46, 0.25),
                inset 0 2px 0 rgba(255,255,255,0.15);
    position: relative;
}
.shelf-plank::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px 2px 0 0;
}

/* Individual book on shelf */
.shelf-book {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90px;
    transition: transform 0.15s;
}
.shelf-book:hover {
    transform: translateY(-6px);
    z-index: 2;
}

.book-spine-link {
    text-decoration: none;
    display: block;
    position: relative;
}

.shelf-cover {
    width: 82px;
    height: 120px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 2px 4px 12px rgba(0,0,0,0.22),
                inset -2px 0 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.15s;
}
.shelf-book:hover .shelf-cover {
    box-shadow: 3px 6px 18px rgba(0,0,0,0.3),
                inset -2px 0 4px rgba(0,0,0,0.08);
}

.shelf-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.3rem;
    background: linear-gradient(150deg, var(--wood-mid) 0%, var(--wood-dark) 100%);
    border-left: 4px solid var(--wood-light);
}
.spine-title {
    color: var(--wood-light);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.spine-author {
    color: rgba(201, 160, 108, 0.7);
    font-size: 0.5rem;
    text-align: center;
    line-height: 1.1;
}

/* Status badges on shelf books */
.shelf-badge-done, .shelf-badge-new {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 0.85rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.shelf-badge-done { color: #198754; }
.shelf-badge-new { color: var(--warm-accent); }

/* Hover actions under each book */
.shelf-book-actions {
    display: flex;
    gap: 2px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.shelf-book:hover .shelf-book-actions {
    opacity: 1;
}

/* Book with "finished" glow */
.shelf-book-finished .shelf-cover {
    box-shadow: 2px 4px 12px rgba(0,0,0,0.22),
                0 0 0 2px rgba(25, 135, 84, 0.35);
}

/* ── Responsive tweaks ── */

@media (max-width: 576px) {
    .coffee-table {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
    }
    .coffee-mug {
        align-self: center;
        margin-bottom: 0;
    }
    .reading-nook-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .reading-info {
        text-align: center;
    }
    .reading-info .d-flex {
        justify-content: center;
    }
    .shelf-books {
        justify-content: center;
    }
    .shelf-book {
        width: 75px;
    }
    .shelf-cover {
        width: 68px;
        height: 100px;
    }
}

/* Emoji picker */
.emoji-picker-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 8px;
    z-index: 1060;
    width: 310px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.emoji-btn:hover {
    background-color: #e9ecef;
}

.reaction-btn {
    font-size: 0.8rem;
    line-height: 1.2;
    border-radius: 1rem;
}

/* Replies */
.replies-thread {
    border-left: 2px solid #dee2e6;
    padding-left: 12px;
}

.reply-item + .reply-item {
    border-top: 1px solid #f0f0f0;
    padding-top: 6px;
}

/* ───────────────────────────────────────
   DARK MODE — overrides for cozy theme
   ─────────────────────────────────────── */

[data-bs-theme="dark"] {
    color-scheme: dark;
    --warm-bg: #1a1a2e;
    --cream: #1e1e2f;
    --wood-dark: #c9a06c;
    --wood-mid: #a07850;
    --wood-light: #7a5a3a;
    --coffee: #d4b896;
}

[data-bs-theme="dark"] body {
    background-color: #121212;
}

[data-bs-theme="dark"] .coffee-table {
    background: linear-gradient(180deg, #1e1e2f 0%, #252538 100%);
    border-color: #3a3a50;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3),
                inset 0 -3px 0 0 #2a2a3e;
}

[data-bs-theme="dark"] .reading-nook-card {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .tbr-section {
    background: linear-gradient(135deg, #1e1e2f 0%, #252538 100%);
    border-color: #3a3a50;
}

[data-bs-theme="dark"] .tbr-book {
    background: #1e1e2f;
    border-left-color: var(--warm-accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .bookshelf {
    background:
        repeating-linear-gradient(
            90deg,
            rgba(139,94,60,0.05) 0px,
            transparent 2px,
            transparent 18px
        ),
        linear-gradient(180deg, #1e1e2f, #252538);
    border-color: #3a3a50;
}

[data-bs-theme="dark"] .shelf-plank {
    background: linear-gradient(180deg, #5a4530 0%, #3e2e20 60%, #2a1e14 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4),
                inset 0 2px 0 rgba(255,255,255,0.06);
}

[data-bs-theme="dark"] .cozy-heading {
    color: #d4b896;
}

[data-bs-theme="dark"] .coffee-table-label {
    color: #d4b896;
}

[data-bs-theme="dark"] .cozy-progress {
    background-color: #2a2a3e;
}

[data-bs-theme="dark"] .cozy-input {
    background-color: #1e1e2f;
    border-color: #3a3a50;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .cozy-input:focus {
    border-color: var(--warm-accent);
    box-shadow: 0 0 0 0.2rem rgba(184, 101, 26, 0.25);
}

[data-bs-theme="dark"] .emoji-picker-panel {
    background: #1e1e2f;
    border-color: #3a3a50;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .emoji-btn:hover {
    background-color: #2a2a3e;
}

[data-bs-theme="dark"] .replies-thread {
    border-left-color: #3a3a50;
}

[data-bs-theme="dark"] .reply-item + .reply-item {
    border-top-color: #2a2a3e;
}

[data-bs-theme="dark"] .mug-body {
    background: #2a2a3e;
    border-color: #555;
}

[data-bs-theme="dark"] .mug-handle {
    border-color: #555;
}

[data-bs-theme="dark"] .shelf-badge-done,
[data-bs-theme="dark"] .shelf-badge-new {
    background: #1e1e2f;
}

[data-bs-theme="dark"] .bookshelf-label {
    color: #d4b896;
}

[data-bs-theme="dark"] .tbr-label {
    color: #d4b896;
}
