.my-books-page {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-out;
}

.my-books-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-title-section h1 {
    font-family: var(--nexus-font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.header-title-section .subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}

.add-book-trigger {
    background: transparent;
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.add-book-trigger:hover {
    background: rgba(16, 185, 129, 0.05);
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.1);
}

.btn-icon {
    margin-right: 0.5rem;
    font-weight: bold;
}

/* Books Grid */
.books-grid, .loading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

.book-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

.book-cover-container {
    position: relative;
    height: 360px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-card:hover .book-cover {
    transform: scale(1.04);
}

.cover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 13, 15, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.book-card:hover .cover-overlay {
    opacity: 1;
}

.read-action {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.6rem 1.25rem;
    border: 2px solid #ffffff;
    border-radius: 30px;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-card:hover .read-action {
    transform: translateY(0);
    background: #ffffff;
    color: #121214;
}

.book-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.4rem 0;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--nexus-font-sans, "Outfit", sans-serif);
}

.book-author {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem 0;
}

.new-badge {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Book Progress Bar */
.book-progress-section {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-actions {
    margin-top: 1.25rem;
}

.primary-accent-btn {
    width: 100%;
    background: #10b981;
    color: #0d0d0d;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.primary-accent-btn:hover {
    background: #059669;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
}

/* Empty State */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.empty-icon-pulse {
    margin-bottom: 2rem;
    color: var(--text-muted);
    animation: pulse 3s infinite alternate;
}

.empty-state-container h3 {
    font-family: var(--nexus-font-serif);
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
}

.empty-state-container p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 0 2rem 0;
}

.catalog-btn {
    background: #10b981;
    color: #0d0d0d;
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.catalog-btn:hover {
    background: #059669;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Skeleton Loading */
.skeleton-card {
    border-radius: 12px;
    overflow: hidden;
    height: 480px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    opacity: 0.6;
}

.skeleton-cover {
    height: 360px;
    background: linear-gradient(90deg, var(--bg-base) 25%, var(--border) 50%, var(--bg-base) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-line {
    background: linear-gradient(90deg, var(--bg-base) 25%, var(--border) 50%, var(--bg-base) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line.title {
    height: 20px;
    width: 80%;
}

.skeleton-line.author {
    height: 14px;
    width: 50%;
}

.skeleton-line.progress {
    height: 8px;
    width: 100%;
    margin-top: auto;
}

.my-books-loading-container {
    position: relative;
    width: 100%;
}

.my-books-loading-container .loader-card {
    position: absolute;
    top: 180px;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 2.25rem;
    border-radius: 40px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spinner-glow {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    border-top-color: #10b981;
    animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.loader-text {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.6; }
    100% { transform: scale(1.05); opacity: 0.9; }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes scaleIn {
    from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ============================================
   LIGHT THEME OVERRIDES — Warm Paper / Soft Sepia
   ============================================ */

.theme-light .book-card:hover {
    box-shadow: 0 12px 30px rgba(139, 130, 115, 0.15);
}

.theme-light .book-cover-container {
    background: rgba(0, 0, 0, 0.03);
}

.theme-light .cover-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.theme-light .book-card:hover .read-action {
    color: #292524;
}

.theme-light .progress-bar {
    background: #e4e1d9;
}

@media (max-width: 767px) {
    .my-books-page {
        padding: 1.5rem 1rem calc(1.5rem + 72px + env(safe-area-inset-bottom, 0px)) !important;
    }
    
    .my-books-header {
        margin-bottom: 1.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .header-title-section h1 {
        font-size: 1.75rem;
        text-align: center;
    }

    .header-title-section .subtitle {
        text-align: center;
    }
    
    .add-book-trigger {
        width: 100%;
        text-align: center;
        padding: 0.9rem 1.5rem;
    }
    
    .books-grid, .loading-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }

    .book-cover-container {
        height: 200px !important;
    }
}

