/*
 * Frontend Stylesheet
 *
 * This stylesheet is for the public-facing side of the plugin.
 */

/* Add your general frontend styles here */

/* --- Problem 2: CSS for image overlay text and PDF popup (from previous response) --- */

.book-cover-wrapper {
    position: relative;
    display: inline-block; /* Or block, depending on your layout */
    cursor: pointer;
    overflow: hidden; /* Ensure text doesn't spill out */
}

.book-cover-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease; /* For hover effect */
}

.book-overlay-text {
    position: absolute;
    bottom: 0; /* Align to bottom */
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.9em;
    text-align: center;
    padding: 8px 5px;
    opacity: 0;
    transform: translateY(100%); /* Initially hide below */
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-sizing: border-box; /* Include padding in width */
}

.book-cover-wrapper:hover .book-overlay-text {
    opacity: 1;
    transform: translateY(0); /* Slide up on hover */
}

.book-cover-wrapper:hover img {
    transform: scale(1.05); /* Slight zoom effect on hover */
}

/* Problem 2: Image Click Text specific styling (for WooCommerce single product image) */
.bookstore-pdf-image-click-text {
    text-align: center;
    font-size: 0.9em;
    color: #555; /* Adjust color for visibility against background */
    margin-top: 5px; /* Spacing above the text */
    margin-bottom: 5px; /* Spacing below the text */
    cursor: default; /* Make text not clickable itself, wrapper handles click */
}
/* Adjust spacing around the main product image area if needed by the theme */
.woocommerce-product-gallery {
    margin-bottom: 10px; /* Adjust as needed for spacing below the image/text */
}
.bookstore-product-image-pdf-trigger-wrapper {
    display: block; /* Ensure it takes full width for text alignment */
    cursor: pointer; /* Indicate it's clickable */
    position: relative; /* For more precise positioning if needed by the theme */
}
.bookstore-product-image-pdf-trigger-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
}


/* --- PDF Popup Modal Styles (standardized IDs/classes matching HTML & JS) --- */
.bookstore-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 99999; /* High z-index to appear on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling outside modal */
    background-color: rgba(0,0,0,0.7); /* Dim background */
    padding: 10px;
    box-sizing: border-box;
}

/* Class added by JS to show the modal */
.bookstore-modal.modal-is-visible {
    display: flex !important; /* Use flexbox to center content */
    align-items: center !important;
    justify-content: center !important;
}

.bookstore-modal-content {
    background-color: #fefefe;
    padding: 0;
    border: 1px solid #888;
    width: 100%;
    max-width: 800px; /* Max width for the modal content */
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    height: 85vh; /* Use viewport height for responsiveness */
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* PDF Viewer container within the modal */
#bookstore-pdf-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #525659; /* Dark background for the viewer area */
}
.pdf-canvas-container {
    flex-grow: 1; /* Allows container to fill available space */
    overflow-y: auto; /* Enable vertical scrolling for PDF pages */
    overflow-x: hidden;
    position: relative;
    text-align: center; /* Center canvases horizontally */
    padding: 0 5px; /* Small padding on sides */
    box-sizing: border-box;
}
/* Styles for dynamically added canvases inside the viewer */
#bookstore-pdf-viewer canvas {
    max-width: 100%; /* Ensure canvas fits within container */
    height: auto;
    display: block;
    margin: 10px auto; /* Center individual canvases vertically */
    border: 1px solid #333;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

/* Loader Animation */
.pdf-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none; /* Hidden by default, shown by JS */
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Close Button (standardized class name) */
.bookstore-modal-close {
    color: #ffffff;
    background-color: #333333;
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    padding: 4px 9px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 999; /* Above PDF viewer content */
}
.bookstore-modal-close:hover,
.bookstore-modal-close:focus {
    background-color: #ff0000;
    text-decoration: none;
}

/* --- Responsive adjustments for mobile devices --- */
@media (max-width: 768px) {
    .bookstore-modal-content {
        height: 75vh;
        max-height: 75vh;
        width: 95%; /* Use more of the screen width */
    }
}


/* --- Taxonomy Display --- */
.bookstore-taxonomies-summary .taxonomy-item {
    margin-bottom: 5px;
    font-size: 0.9em;
}
.bookstore-taxonomies-summary .taxonomy-label {
    margin-right: 5px;
}
.bookstore-taxonomies-summary .taxonomy-terms a {
    text-decoration: none;
}
.bookstore-taxonomies-summary .taxonomy-terms a:hover {
    text-decoration: underline;
}

/* --- Taxonomy Table --- */
.bookstore-taxonomy-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
    border: 1px solid #eee;
}
.bookstore-taxonomy-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
.bookstore-taxonomy-table tr:last-child td {
    border-bottom: none;
}
.bookstore-taxonomy-table .taxonomy-label {
    width: 30%;
}
.bookstore-taxonomy-table .taxonomy-terms a {
    text-decoration: none;
}
.bookstore-taxonomy-table .taxonomy-terms a:hover {
    text-decoration: underline;
}

/* Problem 1 Solution: Hide WooCommerce default short description (forcefully hide using CSS) */
.woocommerce-product-details__short-description {
    display: none !important; /* Added !important to ensure it overrides theme styles */
}

/* Problem 1 Solution: Display the custom short description from the plugin */
/* This class is used in display_product_short_description_after_taxonomies function */
.bookstore-custom-short-description {
    display: block !important; /* Ensure it is visible */
    margin-top: 1em; /* Add some spacing if needed */
    margin-bottom: 1em;
    /* You can add more styling here for your custom short description */
}


/* --- Problem: Read More for Short Description (True Inline Version) --- */

.bookstore-custom-short-description p {
    display: inline; /* This is key to making the link stay on the same line */
}

.bookstore-read-more-btn,
.bookstore-read-less-btn {
    /* Basic text link styling */
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-weight: bold;
    color: #c82121; /* Red color like the example image */
    text-decoration: none;
    cursor: pointer;
    /* To prevent it from inheriting block styles */
    display: inline !important; 
    box-shadow: none !important;
}

.bookstore-read-more-btn:hover,
.bookstore-read-less-btn:hover {
    text-decoration: underline;
}








/* --- Custom Reviews Accordion Styles --- */
.bookstore-review-toggle-wrapper {
    margin-bottom: 2em;
}

.bookstore-reviews-title {
    font-size: 24px;
    margin-bottom: 15px;
}

a.bookstore-open-review-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d83131;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}

a.bookstore-open-review-form:hover {
    color: #333;
}

a.bookstore-open-review-form .dashicons {
    font-size: 20px;
}

/* Hide default WooCommerce review title and "add yours" link */
#reviews #reply-title,
.woocommerce-review-link {
    display: none !important;
}

/* Ensure the form wrapper has a clean look */
#review_form_wrapper {
    margin-top: 2em;
    border-top: 1px solid #e0e0e0;
    padding-top: 2em;
}










/*
 * Frontend Stylesheet
 *
 * This stylesheet is for the public-facing side of the plugin.
 */

/* Add your general frontend styles here */

/* --- Fix for image overlay on book grid --- */
.book-cover-wrapper {
    position: relative;
    display: block;
    cursor: pointer;
    overflow: hidden;
}

.book-cover-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.book-overlay-text {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.9em;
    text-align: center;
    padding: 8px 5px;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-sizing: border-box;
}

.book-cover-wrapper:hover .book-overlay-text {
    opacity: 1;
    transform: translateY(0);
}

/* --- Read More / Read Less link styles --- */
.bookstore-read-more-toggle-btn {
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin-left: 5px;
    
    /* নিচের লাইনটি সরিয়ে দেওয়া হয়েছে, যাতে থিমের প্রাইমারি কালার কাজ করে */
    /* color: #c82121; */ 
}

.bookstore-read-more-toggle-btn:hover {
    text-decoration: none;
}

.bookstore-short-description-wrapper {
    text-align: justify;
    position: relative;
    padding-bottom: 25px; /* নিচের বাটনের জন্য জায়গা রাখা হয়েছে */
}

.bookstore-read-more-toggle-btn {
    position: absolute;
    bottom: 0;
    left: 0;
}