/**
 * Estanar Books - Frontend Styles
 */

/* ─── Page Layout ─────────────────────────────────────────────── */

.books-page {
    background: linear-gradient(180deg, #100047 0%, #1a0a5c 100%);
    min-height: 100vh;
}

/* ─── Hero Section ────────────────────────────────────────────── */

.books-hero {
    padding: 80px 0 60px;
    text-align: center;
}

.books-hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.books-label {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(239, 166, 33, 0.15);
    color: #EFA621;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.books-hero .hero-title {
    color: #fff;
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 20px;
    line-height: 1.2;
}

.books-hero .hero-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    line-height: 1.7;
    margin: 0;
}

/* ─── Featured Book ───────────────────────────────────────────── */

.books-featured {
    padding: 60px 0;
}

.featured-book-card {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.featured-book-cover {
    position: relative;
}

.featured-book-cover img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.featured-book-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-book-title {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px;
    line-height: 1.3;
}

.featured-book-author {
    color: #EFA621;
    font-size: 16px;
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-book-meta {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0 0 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.featured-book-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.featured-book-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 25px;
}

.featured-book-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* ─── Section Headers ─────────────────────────────────────────── */

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin: 0;
}

/* ─── Books Grid ──────────────────────────────────────────────── */

.books-grid-section {
    padding: 60px 0;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 4), 1fr);
    gap: 30px;
}

/* ─── Book Card ───────────────────────────────────────────────── */

.book-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.book-cover {
    position: relative;
    padding-top: 140%;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.book-cover-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0a5c 0%, #100047 100%);
}

.book-cover-placeholder i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.3);
}

.book-cover-placeholder.large i {
    font-size: 80px;
}

/* Book Overlay */
.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 0, 71, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-download-btn,
.book-preview-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.book-download-btn {
    background: #EFA621;
    color: #100047;
    text-decoration: none;
}

.book-download-btn:hover {
    background: #fff;
    color: #100047;
    transform: scale(1.1);
}

.book-preview-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.book-preview-btn:hover {
    background: #fff;
    color: #100047;
    transform: scale(1.1);
}

/* Book Content */
.book-content {
    padding: 20px;
}

.book-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    color: #EFA621;
    font-size: 13px;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.book-meta {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin: 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.book-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── No Books ────────────────────────────────────────────────── */

.no-books {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.no-books i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

/* ─── CTA Section ─────────────────────────────────────────────── */

.books-cta {
    padding: 80px 0;
    background: rgba(255, 255, 255, 0.03);
}

.cta-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px;
}

.cta-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin: 0 0 30px;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Buttons ─────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #EFA621;
    color: #100047;
}

.btn-primary:hover {
    background: #fff;
    color: #100047;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

/* ─── PDF Modal ───────────────────────────────────────────────── */

.book-pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.book-pdf-modal.active {
    display: flex;
}

.book-modal-inner {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.book-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.book-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.book-pdf-wrapper {
    width: 100%;
    height: 100%;
}

.book-pdf-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .books-grid {
        --columns: 3 !important;
    }
}

@media (max-width: 992px) {
    .books-grid {
        --columns: 2 !important;
    }

    .featured-book-card {
        grid-template-columns: 200px 1fr;
        gap: 30px;
    }

    .featured-book-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .books-hero {
        padding: 60px 0 40px;
    }

    .books-hero .hero-title {
        font-size: 32px;
    }

    .featured-book-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .featured-book-cover {
        max-width: 200px;
        margin: 0 auto;
    }

    .featured-book-author,
    .featured-book-meta {
        justify-content: center;
    }

    .featured-book-actions {
        justify-content: center;
    }

    .section-title {
        font-size: 26px;
    }
}

@media (max-width: 576px) {
    .books-grid {
        --columns: 1 !important;
        gap: 20px;
    }

    .book-card {
        display: grid;
        grid-template-columns: 100px 1fr;
    }

    .book-cover {
        padding-top: 0;
        height: 140px;
    }

    .book-overlay {
        display: none;
    }

    .books-hero .hero-title {
        font-size: 26px;
    }

    .cta-title {
        font-size: 22px;
    }

    .btn-lg {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* ─── RTL Support ─────────────────────────────────────────────── */

[dir="rtl"] .book-author i,
[dir="rtl"] .book-meta span i,
[dir="rtl"] .featured-book-author i,
[dir="rtl"] .featured-book-meta span i {
    margin-left: 6px;
    margin-right: 0;
}

[dir="rtl"] .btn i {
    margin-left: 8px;
    margin-right: 0;
}
