/* My Bookshelf — wooden shelf aesthetic */

.my-bookshelf {
    --bs-cream: #f5f0e6;
    --bs-wood-light: #d4b896;
    --bs-wood-mid: #b8956a;
    --bs-wood-dark: #8b6914;
    --bs-black: #000000;
    --bs-soged-green: #11802b;
    --bs-soged-gold: #ffb300;
    font-family: 'Poppins', sans-serif;
    color: var(--bs-black);
}

.my-bookshelf-inner {
    background: var(--bs-cream);
    border-radius: 20px;
    padding: 1.75rem 1.5rem 2rem;
    min-height: 420px;
}

.my-bookshelf-header {
    text-align: center;
    margin-bottom: 2rem;
}

.my-bookshelf-header h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--bs-black);
    margin: 0 0 0.35rem;
    text-transform: lowercase;
}

.my-bookshelf-header p {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.5);
    margin: 0;
}

.bookshelf-row {
    margin-bottom: 2.25rem;
}

.bookshelf-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    padding: 0 0.25rem;
}

.bookshelf-row-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bs-black);
}

.bookshelf-row-count {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.45);
    font-weight: 500;
}

.bookshelf-plank {
    position: relative;
    background: linear-gradient(180deg, var(--bs-wood-light) 0%, var(--bs-wood-mid) 55%, var(--bs-wood-dark) 100%);
    border-radius: 6px;
    padding: 1.25rem 1rem 0.65rem;
    box-shadow: 0 6px 18px rgba(61, 31, 10, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.bookshelf-plank::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 8px;
    background: linear-gradient(180deg, #6b4423 0%, #4a2f18 100%);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.bookshelf-books {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: flex-end;
    min-height: 110px;
}

.bookshelf-book {
    flex-shrink: 0;
    width: 72px;
    cursor: pointer;
    transition: transform 0.25s ease;
    border: none;
    background: none;
    padding: 0;
}

.bookshelf-book:hover,
.bookshelf-book:focus-visible {
    transform: translateY(-10px) scale(1.04);
    outline: none;
}

.bookshelf-book-cover {
    width: 72px;
    height: 102px;
    border-radius: 3px 6px 6px 3px;
    object-fit: cover;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.28);
    display: block;
    background: var(--bs-soged-green);
}

.bookshelf-book-cover--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
}

.bookshelf-empty {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.35);
    font-style: italic;
    padding: 1rem 0.5rem;
}

.bookshelf-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bookshelf-detail-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.bookshelf-detail-panel {
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: var(--bs-cream);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
}

.bookshelf-detail-overlay.is-open .bookshelf-detail-panel {
    transform: translateX(0);
}

.bookshelf-detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.5);
    position: sticky;
    top: 0;
    z-index: 2;
}

.bookshelf-detail-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: var(--bs-black);
    font-size: 1.1rem;
    cursor: pointer;
}

.bookshelf-lives-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bs-black);
}

.bookshelf-lives-badge img {
    width: 18px;
    height: 18px;
}

.bookshelf-detail-body {
    padding: 1.25rem 1.5rem 2rem;
}

.bookshelf-detail-hero {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.bookshelf-detail-cover {
    width: 100px;
    height: 140px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.bookshelf-detail-meta h3 {
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bs-black);
    margin: 0 0 0.25rem;
}

.bookshelf-detail-author {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.5);
    margin: 0 0 0.5rem;
}

.bookshelf-detail-stars {
    color: var(--bs-soged-gold);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.bookshelf-genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.bookshelf-genre-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(17, 128, 43, 0.1);
    color: var(--bs-soged-green);
    border: 1px solid rgba(17, 128, 43, 0.2);
}

.bookshelf-status-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.bookshelf-status-item {
    padding: 0.65rem 0.5rem;
    text-align: center;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.bookshelf-status-item:last-child { border-right: none; }

.bookshelf-status-item label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.4);
    margin-bottom: 0.15rem;
}

.bookshelf-status-item span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bs-black);
}

.bookshelf-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.bookshelf-card h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bs-black);
    margin: 0 0 0.65rem;
}

.bookshelf-notes-area {
    width: 100%;
    min-height: 100px;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--bs-black);
    background: rgba(245, 240, 230, 0.5);
    resize: vertical;
    line-height: 1.55;
}

.bookshelf-notes-area:focus {
    outline: 2px solid var(--bs-soged-green);
}

.bookshelf-notes-save {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--bs-soged-green);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
}

.bookshelf-quiz-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--bs-soged-green);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.bookshelf-quiz-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.bookshelf-quiz-complete {
    font-size: 0.85rem;
    color: var(--bs-soged-green);
    font-weight: 600;
}

.bookshelf-quiz-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    margin-bottom: 1rem;
}

.bookshelf-quiz-progress-fill {
    height: 100%;
    background: var(--bs-soged-green);
    transition: width 0.3s ease;
}

.bookshelf-quiz-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bs-black);
    margin-bottom: 1rem;
}

.bookshelf-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bookshelf-quiz-option {
    padding: 0.75rem 1rem;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    font-size: 0.85rem;
    color: var(--bs-black);
    cursor: pointer;
}

.bookshelf-quiz-option.selected {
    border-color: var(--bs-soged-green);
    background: rgba(17, 128, 43, 0.08);
}

.bookshelf-quiz-next {
    margin-top: 1rem;
    width: 100%;
    padding: 0.75rem;
    background: var(--bs-black);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.bookshelf-quiz-next:disabled { opacity: 0.4; cursor: not-allowed; }

.bookshelf-recommend-tape {
    margin-top: 1.25rem;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px dashed rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.55);
}
