/* --- Additions for EPUB Viewer Modal --- */

/* New View Button on Card */
.book-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.action-btn {
    flex: 1;
    display: inline-block;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}

.download-btn {
    background-color: var(--primary-color);
    color: white;
}
.download-btn:hover {
    background-color: #7d5a3a;
}

.view-btn {
    background-color: var(--card-bg-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.view-btn:hover {
    background-color: var(--border-color);
}


/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    height: 90%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-close-btn {
    position: absolute;
    top: -15px;
    left: -15px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 2rem;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: bold;
    z-index: 1010;
}

#viewer-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: white;
    border: 1px solid var(--border-color);
}

#viewer {
    width: 100%;
    height: 100%;
}

#viewer-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none; /* Controlled by JS */
}

/* Navigation Arrows */
.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    user-select: none;
    padding: 0 20px;
    transition: color 0.2s ease;
}

.arrow:hover {
    color: rgba(0, 0, 0, 0.8);
}

#prev-page {
    left: 0;
}

#next-page {
    right: 0;
}

/* Make EPUB.js content font match */
#viewer iframe {
    font-family: var(--font-body) !important;
}