/* ---------- Reset & Box-Sizing ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- Theme Colors ---------- */
:root {
    --gold: #D4AF37;
    --dark-gold: #B8941F;
    --burgundy: #800020;
    --deep-blue: #1B2838;
    --cream: #FFF8E7;
    --light-gold: #F4E4C1;
    --shadow: rgba(0, 0, 0, 0.15);
    --card-radius: 12px;
    --card-height: 500px;
    --fade-duration: 0.5s;
    --info-blue: #3498db;
    --success-green: #27ae60;
    --warning-orange: #f39c12;
    --danger-red: #e74c3c;
}

/* ---------- Body ---------- */
body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, var(--deep-blue) 0%, #2c3e50 100%);
    min-height: 100vh;
    padding: 10px;
    color: var(--cream);
}

/* ---------- Container ---------- */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ---------- Header ---------- */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--burgundy) 0%, #5c0016 100%);
    border-radius: 15px;
    border: 3px solid var(--gold);
    box-shadow: 0 10px 30px var(--shadow);
    position: relative;
    animation: headerFade 1.2s ease-out both;
}

@keyframes headerFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

h1 {
    font-size: 2em;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
    font-weight: normal;
    letter-spacing: 2px;
}

.subtitle {
    color: var(--light-gold);
    font-style: italic;
    font-size: 1em;
}

/* ---------- Admin Link ---------- */
.admin-link {
    margin-top: 15px;
}

.admin-link a {
    color: var(--light-gold);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}

.admin-link a:hover {
    color: var(--gold);
}

.admin-link .separator {
    color: var(--gold);
}

.admin-link .welcome-text {
    color: var(--light-gold);
}

/* ========== ALERT SYSTEM ========== */
#alertContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
}

.alert {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    border-left: 5px solid;
}

.alert-success {
    border-left-color: var(--success-green);
    color: var(--success-green);
}

.alert-error {
    border-left-color: var(--danger-red);
    color: var(--danger-red);
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: inherit;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ---------- Search Container ---------- */
.search-container {
    margin-bottom: 30px;
    animation: fadeIn 0.8s ease-out 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.search-container form {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-container input[type="text"] {
    width: 100%;
    padding: 15px 45px 15px 20px;
    font-size: 1em;
    font-family: 'Georgia', serif;
    border: 3px solid var(--gold);
    border-radius: 30px;
    background: var(--cream);
    color: var(--deep-blue);
    outline: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.search-container input[type="text"]:focus {
    border-color: var(--dark-gold);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.search-container input[type="text"]::placeholder {
    color: #999;
    font-style: italic;
}

.clear-search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--burgundy);
    color: var(--cream);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.clear-search-btn:hover {
    background: var(--gold);
    color: var(--deep-blue);
    transform: translateY(-50%) scale(1.1);
}

.search-results-info {
    text-align: center;
    margin-top: 15px;
    color: var(--light-gold);
    font-size: 0.95em;
    font-style: italic;
    background: rgba(212, 175, 55, 0.1);
    padding: 10px;
    border-radius: 8px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-error-info {
    text-align: center;
    margin-top: 15px;
    color: #ff6b6b;
    font-size: 0.95em;
    background: rgba(255, 107, 107, 0.1);
    padding: 10px;
    border-radius: 8px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tabs.pagination-tabs {
    justify-content: center;
    margin-top: 30px;
}

/* Mobile tab dropdown - hidden by default */
.mobile-tab-selector {
    display: none;
    margin-bottom: 20px;
}

.mobile-tab-selector select {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    font-family: 'Georgia', serif;
    background: var(--gold);
    color: var(--deep-blue);
    border: 3px solid var(--dark-gold);
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231B2838' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 45px;
}

.mobile-tab-selector select:focus {
    outline: 3px solid var(--light-gold);
    outline-offset: 2px;
}

.tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--gold);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    color: var(--light-gold);
}

.tab.active {
    background: var(--gold);
    color: var(--deep-blue);
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ---------- Books Grid ---------- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* ---------- Book Card Container ---------- */
.book-card-container {
    min-height: 450px;
    height: var(--card-height);
    opacity: 0;
    transform: translateY(20px);
    transition: transform var(--fade-duration) ease, opacity var(--fade-duration) ease;
    cursor: pointer;
    outline: none;
}

.book-card-container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Staggered Fade (CSS Only) ---------- */
.books-grid .book-card-container:nth-child(1)  { transition-delay: 0s; }
.books-grid .book-card-container:nth-child(2)  { transition-delay: 0.05s; }
.books-grid .book-card-container:nth-child(3)  { transition-delay: 0.1s; }
.books-grid .book-card-container:nth-child(4)  { transition-delay: 0.15s; }
.books-grid .book-card-container:nth-child(5)  { transition-delay: 0.2s; }
.books-grid .book-card-container:nth-child(6)  { transition-delay: 0.25s; }
.books-grid .book-card-container:nth-child(7)  { transition-delay: 0.3s; }
.books-grid .book-card-container:nth-child(8)  { transition-delay: 0.35s; }
.books-grid .book-card-container:nth-child(9)  { transition-delay: 0.4s; }
.books-grid .book-card-container:nth-child(10) { transition-delay: 0.45s; }
.books-grid .book-card-container:nth-child(11) { transition-delay: 0.5s; }
.books-grid .book-card-container:nth-child(12) { transition-delay: 0.55s; }

/* ---------- Book Card ---------- */
.book-card {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 8px 20px var(--shadow);
    border: 3px solid var(--gold);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card-container:hover .book-card {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px var(--shadow);
}

/* ---------- Favorited Book Styles ---------- */
/* Bookmark ribbon hanging from top - positioned LEFT */
.book-card.favorited::before {
    content: '⭐';
    position: absolute;
    top: -3px;
    width: 50px;
    height: 80px;
    background: linear-gradient(135deg, var(--burgundy) 0%, #a00028 100%);
    color: var(--gold);
    font-size: 1.5em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    z-index: 15;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-left: 2px solid var(--gold);
    border-right: 2px solid var(--gold);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
}

.book-card.favorited::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 5px;
    width: 50px;
    height: 80px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 14;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
    transform: translateX(3px);
}

.book-card.favorited .book-cover-container {
    filter: brightness(1.05);
}

.book-card-container:hover .book-card.favorited {
    box-shadow: 0 12px 30px var(--shadow), 0 0 20px rgba(212, 175, 55, 0.4);
}

/* ---------- Book Cover ---------- */
.book-cover-container {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--light-gold) 0%, var(--cream) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
    flex-shrink: 0;
}

.book-cover {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.book-cover-placeholder {
    font-size: 80px;
    color: var(--gold);
}

/* ---------- Book Info ---------- */
.book-info {
    display: flex;
    flex-direction: column;
    padding: 0 15px 50px 15px;
    flex: 1;
    gap: 0;
}

.book-title {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--burgundy);
    margin-bottom: 0;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-author {
    color: var(--deep-blue);
    text-align: center;
    font-style: italic;
    font-size: 0.95em;
    margin-bottom: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-status {
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    margin-top: auto;
}

.status-available {
    background-color: #b8941f;
    color: #3b2f00;
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

.status-borrowed {
    background-color: #bfae90;
    color: #5b4a2d;
}

/* ---------- Summary Button ---------- */
.summary-button {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--burgundy) 0%, #5c0016 100%);
    color: var(--gold);
    font-size: 0.75em;
    font-style: normal;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-top: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 5;
}

.summary-button::before {
    content: 'Click for Details';
}

.summary-button::after {
    content: '🖱';
    font-size: 1.2em;
}

.summary-button:hover {
    background: linear-gradient(135deg, #a00028 0%, var(--burgundy) 100%);
    color: var(--light-gold);
}

/* ---------- Modal Overlay ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal-data {
    display: none;
}

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

/* ---------- Modal Content ---------- */
.modal-content {
    background: linear-gradient(135deg, var(--cream) 0%, var(--light-gold) 100%);
    border: 4px solid var(--gold);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(30px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

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

/* ---------- Modal Close Button ---------- */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: var(--burgundy);
    border: 2px solid var(--gold);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--cream);
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.modal-close:hover {
    background: var(--gold);
    color: var(--burgundy);
    transform: rotate(90deg) scale(1.1);
}

.modal-close::before {
    content: '×';
    line-height: 1;
}

/* ---------- Modal Header ---------- */
.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 3px solid var(--gold);
    background: linear-gradient(135deg, var(--burgundy) 0%, #5c0016 100%);
    flex-shrink: 0;
}

.modal-book-favorite {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: bold;
    background: rgba(212, 175, 55, 0.3);
    color: var(--cream);
    border: 1px solid var(--gold);

    white-space: nowrap;
}

.modal-book-title {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 8px;
    padding-right: 50px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-book-author {
    font-size: 1.2em;
    color: var(--light-gold);
    font-style: italic;
}

.modal-book-meta {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.modal-book-pages,
.modal-book-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: bold;
}

.modal-book-pages {
    background: rgba(212, 175, 55, 0.3);
    color: var(--cream);
    border: 1px solid var(--gold);
}

.modal-book-status.status-available {
    background: linear-gradient(135deg, #f7e27c, #d4af37);
    color: #3b2f00;
}

.modal-book-status.status-borrowed {
    background: linear-gradient(135deg, #d8cfc0, #bfae90);
    color: #5b4a2d;
}

.modal-book-reading-list {
    background: rgba(212, 175, 55, 0.3);
    color: var(--cream);
    border: 1px solid var(--gold);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: bold;
}

#modalFavorite,
#modalReadingList {
    display: none;
}

/* ---------- Modal Body ---------- */
.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-summary-label {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--burgundy);
    margin-bottom: 15px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-summary-text {
    color: var(--deep-blue);
    line-height: 1.8;
    font-size: 1.05em;
    text-align: justify;
    white-space: pre-line;
}

/* ---------- Modal Footer ---------- */
.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid var(--gold);
    background-color: #5c0016;
    flex-shrink: 0;
    text-align: center;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 10px 10px;

    line-height: 1;
    white-space: nowrap;

    color: var(--gold);
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    font-family: 'Georgia', serif;

    border: 2px solid var(--gold);
    border-radius: 8px;
    background: transparent;

    cursor: pointer;
    transition: all 0.3s ease;
}


.modal-link:hover {
    background: var(--gold);
    color: var(--burgundy);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Favorite button styling */
.modal-footer button.modal-link {
    background: transparent;
    cursor: pointer;
    font-family: 'Georgia', serif;
}

.modal-footer button.modal-link.favorite-active {
    background: rgba(212, 175, 55, 0.2);
}

.modal-footer button.modal-link:hover {
    background: var(--gold);
    color: var(--burgundy);
}

/* ---------- Modal Scrollbar ---------- */
.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 5px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 5px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gold);
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 768px) {
    .summary-button::before { content: 'Tap for Details'; }
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    h1 { font-size: 1.5em; }
    .book-card-container { height: 450px; }
    .book-cover-container { height: 250px; }
    
    /* Show mobile dropdown, hide desktop tabs */
    .mobile-tab-selector {
        display: block;
    }
    
    .desktop-tabs {
        display: none !important;
    }
    
    /* Larger, more touch-friendly pagination */
    .pagination .tabs {
        gap: 8px;
        justify-content: center;
    }
    
    .pagination .tab {
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
        font-size: 1.1em;
        font-weight: bold;
        border-radius: 8px;
        border-width: 3px;
    }
    
    .pagination .tab.active {
        transform: scale(1.1);
    }
    
    .modal-content {
        border-radius: 15px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px 20px 15px;
    }
    
    .modal-book-title {
        font-size: 1.4em;
    }
    
    .modal-book-author {
        font-size: 1em;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-summary-text {
        font-size: 1em;
    }
    
    #alertContainer {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (min-width: 769px) {
    .summary-button::before { content: 'Click for Details'; }
}

@media (max-width: 480px) {
    .books-grid { grid-template-columns: 1fr; }
    
    /* Even larger touch targets on small screens */
    .pagination .tab {
        min-width: 52px;
        min-height: 52px;
        font-size: 1.2em;
    }
    
    .mobile-tab-selector select {
        font-size: 1em;
        padding: 18px 20px;
    }
    
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-content {
        border-radius: 12px;
    }
}

/* ---------- Pagination Disabled ---------- */
.tab.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ---------- Focus Style ---------- */
.tab:focus {
    transform: scale(1.05);
}

.book-card-container:focus {
    outline: 3px solid var(--gold);
    outline-offset: 5px;
}

.modal-close:focus {
    outline: 3px solid var(--cream);
    outline-offset: 3px;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--light-gold);
}

.empty-state p {
    font-size: 1.2em;
    margin-bottom: 10px;
}

/* ---------- Smooth Transitions ---------- */
.book-card-container * {
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Prevent Body Scroll When Modal Open ---------- */
body.modal-open {
    overflow: hidden;
}

/* ---------- Accessibility ---------- */
.modal-overlay[aria-hidden="true"] {
    display: none;
}

/* ---------- Print Styles ---------- */
@media print {
    .modal-overlay {
        display: none !important;
    }
}
/* ---------- Notification Badge ---------- */
.notification-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    font-size: 0.75em;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
    min-width: 18px;
    text-align: center;
}

/* ---------- Reading List Button in Modal ---------- */
.modal-link.reading-list-active {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: var(--gold);
    border-color: var(--gold);
}

.modal-link.reading-list-active:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    color: var(--burgundy);
}

.modal-footer .modal-link {
    margin-right: 5px;
}

.modal-footer .modal-link:last-child {
    margin-right: 0;
}

/* Additional styles for reading list page */
.notifications-section {
    background: linear-gradient(135deg, rgba(27, 38, 56, 0.95) 0%, rgba(27, 38, 56, 0.85) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    color: var(--gold);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-mark-read {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    color: var(--deep-blue);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-weight: bold;
    font-size: 0.95em;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.btn-mark-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.5);
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notification-item {
    display: flex;
    gap: 15px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(244, 228, 193, 0.1) 100%);
    border-radius: 10px;
    border-left: 5px solid var(--gold);
    align-items: flex-start;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.notification-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(244, 228, 193, 0.15) 100%);
}

.notification-item.unread {
    border-left-color: var(--gold);
    border-left-width: 6px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(244, 228, 193, 0.15) 100%);
}

.notification-item.read {
    opacity: 0.6;
    border-left-color: #7f8c8d;
}

.notification-icon {
    font-size: 28px;
    min-width: 35px;
    text-align: center;
}

.notification-content {
    flex: 1;
}

.notification-message {
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.05em;
}

.notification-meta {
    font-size: 0.9em;
    color: var(--light-gold);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.notification-book {
    color: var(--cream);
    font-weight: 500;
}

.notification-date {
    color: #95a5a6;
    font-style: italic;
}

.btn-mark-single {
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    color: var(--deep-blue);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.3);
}

.btn-mark-single:hover {
    background: linear-gradient(135deg, var(--dark-gold) 0%, #9d7b1a 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(212, 175, 55, 0.5);
}

.reading-list-section {
    background: linear-gradient(135deg, rgba(27, 38, 56, 0.95) 0%, rgba(27, 38, 56, 0.85) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.reading-list-section h2 {
    color: var(--gold);
    margin-bottom: 25px;
    font-size: 1.6em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reading-list-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* Reading List Grid - 4 items per row max with equal sizing */
.reading-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 1600px) {
    .reading-list-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) and (max-width: 1599px) {
    .reading-list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .reading-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.reading-list-item {
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(27, 40, 56, 0.95) 0%, rgba(44, 62, 80, 0.95) 100%);
    border-radius: 10px;
    border: 2px solid var(--gold);
    border-top: 5px solid var(--gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    height: auto
    min-height: 240px
}
}

.reading-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.4);
    border-top-color: var(--light-gold);
}

.reading-list-item.unavailable {
    opacity: 0.8;
    border-top-color: #e67e22;
}

.reading-list-item-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.reading-list-item-checkbox input[type="checkbox"] {
    display: none;
}

.reading-list-item-checkbox label {
    display: block;
    width: 24px;
    height: 24px;
    background: rgba(27, 40, 56, 0.8);
    border: 2px solid var(--gold);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.reading-list-item-checkbox label:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--light-gold);
}

.reading-list-item-checkbox input[type="checkbox"]:checked + label {
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    border-color: var(--gold);
}

.reading-list-item-checkbox input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--deep-blue);
    font-weight: bold;
    font-size: 16px;
}

.reading-list-item-header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding-right: 25px;
}

.book-cover-small {
    width: 65px;
    height: 95px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3) 0%, rgba(184, 148, 31, 0.3) 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.book-cover-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-small {
    font-size: 35px;
    color: var(--gold);
}

.book-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.rl-book-title {
    font-weight: bold;
    color: var(--gold);
    font-size: 0.95em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rl-book-author {
    color: var(--light-gold);
    font-style: italic;
    font-size: 0.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.book-meta-row {
    display: flex;
    gap: 6px;
    font-size: 0.7em;
    color: #95a5a6;
    flex-wrap: wrap;
}

.book-isbn {
    font-size: 1em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-pages {
    font-size: 1em;
}

.book-pages::before {
    content: "• ";
    color: var(--gold);
}

.book-status-indicator {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-self: end;
}

.book-status-badge {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: bold;
    display: inline-block;
    align-self: flex-start;
    white-space: nowrap;
}
}

.rl-status-available {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.3) 0%, rgba(34, 153, 84, 0.3) 100%);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.5);
}

.rl-status-borrowed {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.3) 0%, rgba(211, 84, 0, 0.3) 100%);
    color: #f39c12;
    border: 1px solid rgba(230, 126, 34, 0.5);
}

.notification-enabled {
    font-size: 0.65em;
    color: var(--light-gold);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 2px;
}

.rl-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--light-gold);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 2px dashed var(--gold);
}

.rl-empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.rl-empty-state h3 {
    color: var(--gold);
    font-size: 1.8em;
    margin-bottom: 15px;
}

.rl-empty-state p {
    font-size: 1.1em;
    margin: 0;
}

.rl-empty-state a {
    color: var(--gold);
    text-decoration: underline;
    font-weight: bold;
}

.rl-empty-state a:hover {
    color: var(--light-gold);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    padding: 20px;
    gap: 20px;
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.pagination-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-add-to-books-read {
    padding: 10px 18px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: 2px solid #2980b9;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
    display: none;
}

#rlAddToBooksReadBtn,
#rlRemoveSelectedBtn,
#brRemoveSelectedBtn {
    display: none;
}

.btn-add-to-books-read:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(52, 152, 219, 0.5);
}

.btn-remove-selected {
    padding: 10px 18px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: 2px solid #c0392b;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
}

.btn-remove-selected:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(231, 76, 60, 0.5);
}

/* Select All / Deselect All Button */
.btn-select-all {
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    color: var(--deep-blue);
    border: 2px solid var(--dark-gold);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.3);
}

.btn-select-all:hover {
    background: linear-gradient(135deg, var(--dark-gold) 0%, #9a7a1a 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(212, 175, 55, 0.5);
}

.btn-select-all:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.pagination-info {
    padding: 10px 20px;
    background: rgba(212, 175, 55, 0.15);
    color: var(--light-gold);
    border-radius: 8px;
    font-weight: bold;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

/* Reading list item - completed variation */
.reading-list-item.completed {
    border-top: 5px solid #27ae60;
}

.reading-list-item.completed:hover {
    box-shadow: 0 6px 18px rgba(39, 174, 96, 0.4);
    border-top-color: #2ecc71;
}

.completed-badge {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.3) 0%, rgba(34, 153, 84, 0.3) 100%);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.5);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: bold;
    display: inline-block;
    align-self: flex-start;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-left {
        width: 100%;
        justify-content: center;
    }
    
    .pagination-right {
        width: 100%;
        justify-content: center;
    }
    
    .pagination-info {
        padding: 8px 16px;
        font-size: 0.85em;
    }
}


@media (max-width: 768px) {
    .reading-list-grid {
        grid-template-columns: 1fr;
    }
    
    .notification-item {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .reading-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) and (max-width: 1599px) {
    .reading-list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Custom Confirmation Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

#notificationModal .confirm-modal-footer {
    justify-content: center;
}

.confirm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.confirm-modal-content {
    position: relative;
    background: var(--cream);
    border: 3px solid var(--gold);
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confirm-modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--burgundy) 0%, #5c0016 100%);
    border-radius: 12px 12px 0 0;
    border-bottom: 3px solid var(--gold);
}

.confirm-modal-header h3 {
    margin: 0;
    color: var(--gold);
    font-size: 1.4em;
    text-align: center;
}

.confirm-modal-body {
    padding: 30px 25px;
    text-align: center;
}

.confirm-modal-body p {
    margin: 0;
    color: var(--deep-blue);
    font-size: 1.1em;
    line-height: 1.5;
}

.confirm-modal-footer {
    padding: 20px 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 0 0 12px 12px;
}

.btn-cancel,
.btn-confirm {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-family: 'Georgia', serif;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.btn-cancel {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(149, 165, 166, 0.3);
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7a7b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(149, 165, 166, 0.4);
}

.btn-confirm {
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    color: var(--deep-blue);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.btn-confirm:hover {
    background: linear-gradient(135deg, var(--dark-gold) 0%, #9d7b1a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.5);
}

.btn-cancel:active,
.btn-confirm:active {
    transform: translateY(0);
}

/* ========================================================================
   LIST VIEW TAB
======================================================================== */
.list-view-section {
    margin-top: 20px;
}

.list-view-table-wrapper {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 2px solid var(--gold);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.list-view-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Georgia', serif;
}

.list-view-table thead {
    background: linear-gradient(135deg, var(--burgundy) 0%, #5c0016 100%);
}

.list-view-table thead th {
    padding: 15px 12px;
    text-align: left;
    color: var(--gold);
    font-weight: bold;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid var(--gold);
    white-space: nowrap;
}

.list-view-table tbody tr {
    background: linear-gradient(135deg, rgba(27, 40, 56, 0.95) 0%, rgba(44, 62, 80, 0.95) 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

.list-view-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(27, 40, 56, 1) 0%, rgba(44, 62, 80, 1) 100%);
    box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.3);
}

.list-view-table tbody td {
    padding: 12px;
    color: var(--cream);
    font-size: 0.95em;
    vertical-align: middle;
}

.list-col-cover {
    width: 60px;
}

.list-view-cover {
    width: 50px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--light-gold) 0%, var(--cream) 100%);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--gold);
}

.list-view-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-cover-placeholder {
    font-size: 24px;
}

.list-col-title {
    min-width: 250px;
}

.list-title-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.list-title {
    color: var(--gold);
    font-weight: bold;
}

.list-badge {
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.list-badge-favorite {
    background: rgba(212, 175, 55, 0.3);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.5);
}

.list-badge-reading-list {
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.5);
}

.list-badge-completed {
    background: rgba(39, 174, 96, 0.3);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.5);
}

.list-col-author {
    min-width: 180px;
    color: var(--light-gold);
    font-style: italic;
}

.list-col-isbn {
    min-width: 140px;
    font-family: monospace;
    font-size: 0.85em;
    color: #95a5a6;
}

.list-col-pages {
    width: 80px;
    text-align: center;
    color: var(--light-gold);
}

.list-col-status {
    width: 140px;
}

.list-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: bold;
    white-space: nowrap;
}

.list-status-badge.status-available {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.3) 0%, rgba(34, 153, 84, 0.3) 100%);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.5);
}

.list-status-badge.status-borrowed {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.3) 0%, rgba(211, 84, 0, 0.3) 100%);
    color: #f39c12;
    border: 1px solid rgba(230, 126, 34, 0.5);
}

.list-col-actions {
    width: 120px;
}

.list-action-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    color: var(--deep-blue);
    border: 2px solid var(--gold);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-weight: bold;
    font-size: 0.85em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.list-action-btn:hover {
    background: linear-gradient(135deg, var(--light-gold) 0%, var(--gold) 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.4);
}

/* List View Responsive */
@media (max-width: 1200px) {
    .list-view-table {
        font-size: 0.9em;
    }
    
    .list-col-pages,
    .list-col-isbn {
        display: none;
    }
}

@media (max-width: 768px) {
    .list-view-table thead th {
        padding: 10px 8px;
        font-size: 0.85em;
    }
    
    .list-view-table tbody td {
        padding: 10px 8px;
        font-size: 0.85em;
    }
    
    .list-col-author {
        display: none;
    }
    
    .list-col-cover {
        width: 50px;
    }
    
    .list-view-cover {
        width: 40px;
        height: 55px;
    }
    
    .list-action-btn {
        padding: 4px 8px;
        font-size: 0.75em;
    }
}

/* ========================================================================
   CELEBRATION ANIMATION - Books I've Read Tab
======================================================================== */

/* Confetti Container */
.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

/* Individual Confetti Piece */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--gold);
    top: -10px;
    opacity: 0;
    animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Party Emoji Float Animation */
.party-emoji {
    position: absolute;
    font-size: 3em;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    animation: partyFloat 2s ease-out forwards;
    z-index: 9999;
}

@keyframes partyFloat {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1) rotate(-5deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -100vh) scale(0.8) rotate(15deg);
        opacity: 0;
    }
}

/* Celebration Flash Overlay */
.celebration-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9997;
    opacity: 0;
    animation: celebrationFlash 1s ease-out forwards;
}

@keyframes celebrationFlash {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* ========================================================================
   FAVORITE BADGE - Subtle Flag Wave Animation (CSS Only)
   Appended only — does not modify existing functionality
======================================================================== */

/* Ensure smooth animation rendering */
.book-card.favorited::before {
    transform-origin: top center;
    animation: favoriteFlagWave 3s ease-in-out infinite;
    will-change: transform;
}

/* Keep shadow aligned with movement for depth */
.book-card.favorited::after {
    transform-origin: top center;
    animation: favoriteFlagWaveShadow 3s ease-in-out infinite;
    will-change: transform;
}

/* Main ribbon wave */
@keyframes favoriteFlagWave {
    0% {
        transform: perspective(400px) rotateX(0deg) skewX(0deg);
    }
    25% {
        transform: perspective(400px) rotateX(6deg) skewX(-2deg);
    }
    50% {
        transform: perspective(400px) rotateX(0deg) skewX(0deg);
    }
    75% {
        transform: perspective(400px) rotateX(-6deg) skewX(2deg);
    }
    100% {
        transform: perspective(400px) rotateX(0deg) skewX(0deg);
    }
}

/* Slight offset for the shadow layer */
@keyframes favoriteFlagWaveShadow {
    0% {
        transform: translateX(3px) perspective(400px) rotateX(0deg) skewX(0deg);
    }
    25% {
        transform: translateX(3px) perspective(400px) rotateX(6deg) skewX(-2deg);
    }
    50% {
        transform: translateX(3px) perspective(400px) rotateX(0deg) skewX(0deg);
    }
    75% {
        transform: translateX(3px) perspective(400px) rotateX(-6deg) skewX(2deg);
    }
    100% {
        transform: translateX(3px) perspective(400px) rotateX(0deg) skewX(0deg);
    }
}

/* ========================================================================
   TAB LUXURY SHIMMER - When Notification Exists (CSS Only)
   Appended only — does not modify existing functionality
======================================================================== */

/* Target any tab that contains a notification badge */
.tab:has(.notification-badge) {
    position: relative;
    overflow: hidden;
    animation: luxuryTabPulse 3.5s ease-in-out infinite;
    will-change: box-shadow, transform;
}

/* Elegant shimmer sweep across the tab */
.tab:has(.notification-badge)::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.25) 40%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0.25) 60%,
        transparent 100%
    );
    transform: skewX(-20deg);
    animation: luxuryTabShimmer 5s ease-in-out infinite;
    pointer-events: none;
}

/* Gentle gold glow breathing */
@keyframes luxuryTabPulse {
    0%, 100% {
        box-shadow: 0 0 0 rgba(212, 175, 55, 0);
    }
    50% {
        box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
    }
}

/* Smooth luxury shimmer */
@keyframes luxuryTabShimmer {
    0% {
        left: -120%;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    50% {
        left: 130%;
        opacity: 0.8;
    }
    100% {
        left: 130%;
        opacity: 0;
    }
}

/* ========================================================================
   NOTIFICATION BADGE - Luxury Bell Jingle Animation (CSS Only)
   Appended only — does not modify existing functionality
======================================================================== */

/* Bell container styling */
.notification-badge {
    position: relative;
    padding-left: 26px; /* space for bell */
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    color: var(--deep-blue);
    font-weight: bold;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    animation: bellGlow 3s ease-in-out infinite;
    will-change: transform;
}

/* Bell icon */
.notification-badge::before {
    content: "🔔";
    position: absolute;
    left: 6px;
    font-size: 0.9em;
    transform-origin: top center;
    animation: bellJingle 2.5s ease-in-out infinite;
}

/* Gentle luxury glow pulse */
@keyframes bellGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(212, 175, 55, 0);
    }
    50% {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.45);
    }
}

/* Bell swing animation */
@keyframes bellJingle {
    0%   { transform: rotate(0deg); }
    5%   { transform: rotate(18deg); }
    10%  { transform: rotate(-16deg); }
    15%  { transform: rotate(12deg); }
    20%  { transform: rotate(-8deg); }
    25%  { transform: rotate(4deg); }
    30%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}