/* Books Page Styles */
.page-title {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Books Grid Container */
.books-grid-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Books Grid Layout */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Individual Book Cards */
.book-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-light);
    border: 2px solid transparent;
}

.book-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 30px var(--shadow-strong);
    border-color: var(--accent-primary);
}

.book-card img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.book-card:hover img {
    transform: scale(1.05);
}

.book-card h3 {
    font-size: 1.3em;
    margin: 10px 0 5px 0;
    color: var(--text-primary);
    font-family: var(--font-headings);
}

.book-card .pub-date {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin: 5px 0 0 0;
    font-weight: 500;
}

/* Modal Overlay */
.book-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.3s ease;
}

.book-modal.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Content Box */
.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, rgba(74, 144, 226, 0.12) 100%);
    margin: 3% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 900px;
    position: relative;
    animation: slideDown 0.3s ease;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--secondary-bg);
}

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

/* Close Button */
.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 35px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #000;
}

/* Modal Inner Content */
.modal-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    padding: 40px;
}

.modal-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    cursor: zoom-in;
}

.cover-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.cover-lightbox.active {
    display: flex;
}

.cover-lightbox__image {
    max-width: min(90vw, 700px);
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.cover-lightbox__close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
}

.cover-lightbox__close:hover {
    color: #f5f5f5;
    transform: scale(1.05);
}

.modal-details h2 {
    font-size: 2em;
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-family: var(--font-headings);
}

.book-author {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-style: italic;
}

.modal-details p {
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.modal-details blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 20px;
    border-radius: var(--border-radius-sm);
}

.modal-details blockquote p {
    margin-bottom: 5px;
}

.modal-details cite {
    font-size: 0.9em;
    color: var(--accent-primary);
    font-style: normal;
    font-weight: 600;
}

.book-info {
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.book-info p {
    margin: 5px 0;
}

/* Order Links Section */
.order-links {
    margin-top: 30px;
}

.order-links h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-family: var(--font-headings);
}

.retailer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.retailer-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.retailer-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.5);
}

.order-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.order-button:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .modal-inner {
        grid-template-columns: 1fr;
        padding: 30px 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-details h2 {
        font-size: 1.5em;
    }
    
    .close-modal {
        right: 15px;
        top: 10px;
        font-size: 30px;
    }

    .retailer-links {
        flex-direction: column;
    }

    .retailer-btn {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-inner {
        padding: 20px 15px;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}
