/**
 * Get the Books Page Styles
 * Covers Grid + Modal Flipbook
 */

.page-get-books {
    min-height: 100vh;
    padding: 4rem 2rem 2rem;
}

.books-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.books-header {
    text-align: center;
    margin-bottom: 3rem;
}

.books-header h1 {
    font-size: 3rem;
    color: #fff;
    margin: 0 0 1rem;
    font-weight: 700;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}

.books-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 215, 0, 0.9);
    font-style: italic;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* ========================================
   BOOK COVERS GRID
   ======================================== */

.book-covers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

.book-cover-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.book-cover-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.cover-image {
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.cover-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cover-info h2 {
    font-size: 1.4rem;
    color: #fff;
    margin: 0 0 0.5rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.cover-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 215, 0, 0.9);
    font-style: italic;
    margin: 0 0 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.cover-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin: 0 0 1.5rem;
    flex: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.read-sample-btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-sample-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ========================================
   FLIPBOOK MODAL
   ======================================== */

.flipbook-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.modal-content {
    position: relative;
    z-index: 1;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    max-width: 95vw;
    max-height: 95vh;
    overflow: visible;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-title {
    font-size: 1.8rem;
    color: #fff;
    margin: 0 0 1.5rem;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#modal-flipbook-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.modal-page-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 500px;
}

.modal-page-display {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-page-image {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    display: block;
}

.modal-flipbook-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.modal-prev-page,
.modal-next-page {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-prev-page:hover:not(:disabled),
.modal-next-page:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.modal-prev-page:disabled,
.modal-next-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.modal-page-indicator {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    min-width: 120px;
    text-align: center;
}

body.modal-open {
    overflow: hidden;
}

/* ========================================
   SIGNUP FORM SECTION
   ======================================== */

.books-signup-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.books-signup {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.books-signup h2 {
    font-size: 1.6rem;
    color: #fff;
    margin: 0 0 0.5rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.books-signup > p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.book-request-form {
    margin-top: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(255, 215, 0, 0.8);
    background: rgba(255, 255, 255, 0.15);
}

.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    display: none;
}

.form-message.success {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid #4CAF50;
    color: #4CAF50;
}

.form-message.error {
    background: rgba(244, 67, 54, 0.2);
    border: 2px solid #f44336;
    color: #f44336;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1100px) {
    .book-covers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .page-get-books {
        padding: 2rem 1rem;
    }

    .books-header h1 {
        font-size: 2rem;
    }

    .books-subtitle {
        font-size: 1.1rem;
    }

    .book-covers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .cover-info h2 {
        font-size: 1.3rem;
    }

    .modal-content {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .modal-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .modal-flipbook-controls {
        gap: 1rem;
    }

    .modal-prev-page,
    .modal-next-page {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .modal-page-indicator {
        font-size: 0.9rem;
        min-width: 100px;
    }

    .books-signup {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .books-header h1 {
        font-size: 1.75rem;
    }

    .cover-info {
        padding: 1rem;
    }

    .cover-info h2 {
        font-size: 1.2rem;
    }

    .cover-description {
        font-size: 0.85rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .modal-flipbook-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .modal-page-indicator {
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}
