/* Single E-Book page */

.ebook-header-compact {
    color: #2A3C4F;
    position: relative;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ebook-back-nav {
    margin: 0 0 16px;
    padding: 0 20px;
}

.ebook-back-btn {
    display: inline-block;
    color: #2A3C4F;
    text-decoration: none;
    font-size: 0.95rem;
}

.ebook-back-btn:hover {
    text-decoration: underline;
}

.ebook-header-layout {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.ebook-book-cover {
    flex: 0 0 200px;
    position: relative;
}

.book-cover-image {
    width: 180px;
    height: 240px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.book-cover-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.book-cover-placeholder {
    width: 180px;
    height: 240px;
    background: #f8f9fa;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.placeholder-text {
    font-size: 14px;
    font-weight: 500;
}

.ebook-details-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 240px;
}

.ebook-title-section {
    margin-bottom: 20px;
}

.ebook-title-main {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #000;
    line-height: 1.2;
}

.ebook-author {
    font-size: 18px;
    color: #666;
    margin: 0;
    font-weight: 500;
}

.ebook-meta-info {
    margin-bottom: 20px;
}

.ebook-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ebook-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #0056d2;
}

.ebook-description {
    margin-bottom: 25px;
}

.ebook-summary {
    font-size: 16px;
    line-height: 1.6;
    color: #536471;
    margin: 0;
    max-width: 600px;
}

.ebook-price-section {
    margin-bottom: 30px;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.ebook-price-section .original-price,
.price-display .original-price {
    font-size: 18px;
    color: #94a3b8;
    text-decoration: line-through;
}

.ebook-price-section .current-price,
.price-display .current-price {
    font-size: 28px;
    font-weight: 700;
    color: #0056d2;
}

.ebook-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    min-height: 48px;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.action-btn-primary,
.action-btn.action-btn-primary {
    background: linear-gradient(135deg, #0056d2, #4285f4);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 86, 210, 0.3);
}

.action-btn-primary:hover,
.action-btn.action-btn-primary:hover {
    background: linear-gradient(135deg, #004494, #0056d2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 86, 210, 0.4);
    color: #fff;
}

.action-btn-secondary,
.action-btn.action-btn-secondary {
    background: transparent;
    color: #0056d2;
    border: 2px solid #0056d2;
}

.action-btn-secondary:hover,
.action-btn.action-btn-secondary:hover {
    background: #f0f9ff;
    border-color: #004494;
    color: #004494;
}

.ebook-content-section {
    padding: 40px 0;
    background: #f8f9fa;
}

.ebook-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.ebook-description-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.ebook-description-content h1,
.ebook-description-content h2,
.ebook-description-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.ebook-description-content p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #555;
}

.ebook-preview-modal {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

body.admin-bar .ebook-preview-modal {
    top: 96px;
}

.ebook-preview-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.ebook-preview-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: calc(100vh - 64px - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

body.admin-bar .ebook-preview-modal-content {
    max-height: calc(100vh - 96px - 40px);
}

.ebook-preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.ebook-preview-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.ebook-preview-modal-close {
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    color: #64748b;
}

.ebook-preview-modal-close:hover {
    color: #000;
}

.ebook-preview-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

#ebook-preview-pages canvas {
    display: block;
    margin: 0 auto 16px;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#ebook-preview-loading,
#ebook-preview-error {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

@media (max-width: 768px) {
    .ebook-header-layout {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        text-align: center;
    }

    .ebook-book-cover {
        flex: none;
        order: -1;
    }

    .ebook-details-section {
        width: 100%;
        max-width: 600px;
    }

    .ebook-title-main {
        font-size: 28px;
    }

    .ebook-author {
        font-size: 16px;
    }

    .ebook-badges {
        justify-content: center;
    }

    .ebook-actions {
        justify-content: center;
    }

    .action-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .ebook-header-compact {
        padding: 30px 0;
    }
}
