/* ================================================
   BOOKS PAGE — /assets/css/books-style.css
   صفحة الكتب | منصة حروف
================================================ */

 
.books-page {
    position: relative;
    z-index: 1;
    padding-top: 80px;
    min-height: 100vh;
}

 
.bk-hero {
    padding: 80px 24px 56px;
    text-align: center;
    position: relative;
}
.bk-hero__inner {
    max-width: 640px;
    margin: 0 auto;
}
.bk-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    border-radius: 50px;
    background: rgba(79,209,255,0.1);
    border: 1px solid rgba(79,209,255,0.25);
    color: #0ea5e9;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
    animation: fadeUp 0.6s ease both;
}
.bk-hero__badge::before { content: '📚'; font-size: 0.85rem; }
.bk-hero__title {
    font-family: 'Amiri', serif;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 700;
    background: linear-gradient(135deg, #0ea5e9, #A855F7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0 0 16px;
    line-height: 1.2;
    animation: fadeUp 0.7s ease both 0.1s;
}
.bk-hero__desc {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.7;
    margin: 0;
    animation: fadeUp 0.7s ease both 0.2s;
}

 
.bk-controls-wrap {
    position: static;
    background: rgba(248,249,252,0.88);
    border-bottom: 1px solid rgba(79,209,255,0.12);
    border-top: 1px solid rgba(79,209,255,0.08);
    padding: 14px 24px;
}
.bk-controls {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

 
.bk-search-wrap {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.9);
    border: 1.5px solid rgba(79,209,255,0.2);
    border-radius: 12px;
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.bk-search-wrap:focus-within {
    border-color: rgba(79,209,255,0.5);
    box-shadow: 0 0 0 3px rgba(79,209,255,0.08);
}
.bk-search-wrap svg { color: var(--cyan); flex-shrink: 0; opacity: 0.7; }
.bk-search-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    color: var(--dark);
    padding: 11px 0;
    text-align: right;
}
.bk-search-wrap input::placeholder { color: #94a3b8; }

 
.bk-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.bk-select {
    padding: 10px 14px;
    border: 1.5px solid rgba(79,209,255,0.2);
    border-radius: 12px;
    background: rgba(255,255,255,0.9);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    color: var(--dark);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 150px;
}
.bk-select:focus { border-color: rgba(79,209,255,0.5); }

 
.bk-count {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(79,209,255,0.08);
    border: 1px solid rgba(79,209,255,0.15);
    margin-right: auto;
}

 
.bk-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

 
.bk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 28px;
}

 
.bk-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(79,209,255,0.14);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(22px);
    transition:
        transform 0.3s cubic-bezier(0.22,1,0.36,1),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
    position: relative;
}
.bk-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.55s cubic-bezier(0.22,1,0.36,1),
        transform 0.55s cubic-bezier(0.22,1,0.36,1),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}
.bk-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(14,165,233,0.14), 0 4px 16px rgba(168,85,247,0.08);
    border-color: rgba(79,209,255,0.3);
}

 
.bk-card__cover-wrap {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #e0f7ff, #f3eeff);
}
.bk-card__cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}
.bk-card:hover .bk-card__cover { transform: scale(1.06); }

 
.bk-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(79,209,255,0.07), rgba(168,85,247,0.07));
}
.bk-card__placeholder-icon {
    font-size: 2.8rem;
    opacity: 0.35;
}
.bk-card__placeholder-title {
    font-family: 'Amiri', serif;
    font-size: 14px;
    font-weight: 700;
    color: rgba(14,165,233,0.6);
    text-align: center;
    line-height: 1.5;
}

 
.bk-card__cat-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 10px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(79,209,255,0.9), rgba(168,85,247,0.9));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

 
.bk-card__body {
    padding: 16px 16px 18px;
}
.bk-card__title {
    font-family: 'Amiri', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bk-card__author {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 12px;
}
.bk-card__author::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    flex-shrink: 0;
}
/* اسم دار النشر على الكرت */
.bk-card__publisher {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 12px;
}
.bk-card__publisher::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    flex-shrink: 0;
}
.bk-card__price--free {
    font-size: 0.8rem;
    font-weight: 700;
    color: #22c55e;
}
.bk-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.bk-card__year {
    font-size: 0.72rem;
    color: #94a3b8;
}
.bk-card__price {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0ea5e9;
    background: rgba(79,209,255,0.08);
    border: 1px solid rgba(79,209,255,0.15);
    padding: 3px 10px;
    border-radius: 50px;
}

 
.bk-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 80px 0;
    color: #94a3b8;
    font-size: 0.9rem;
}
.bk-loading__spinner {
    width: 28px; height: 28px;
    border: 3px solid rgba(79,209,255,0.2);
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

 
.bk-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 24px;
    color: #94a3b8;
}
.bk-empty svg { margin-bottom: 16px; opacity: 0.25; }
.bk-empty p { font-size: 1rem; margin: 0; }

/* ====================================================
   MODAL — صفحة تفاصيل الكتاب
==================================================== */
.bk-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,5,16,0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.bk-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.bk-modal {
    background: rgba(248,249,252,0.99);
    border: 1px solid rgba(79,209,255,0.18);
    border-radius: 24px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 40px 100px rgba(0,0,0,0.35),
        0 0 0 1px rgba(79,209,255,0.06);
    transform: scale(0.92) translateY(24px);
    transition: transform 0.38s cubic-bezier(0.34,1.36,0.64,1);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(79,209,255,0.25) transparent;
}
.bk-modal-overlay.active .bk-modal {
    transform: scale(1) translateY(0);
}
.bk-modal::-webkit-scrollbar { width: 4px; }
.bk-modal::-webkit-scrollbar-thumb { background: rgba(79,209,255,0.3); border-radius: 4px; }

 
.bk-modal__close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(79,209,255,0.2);
    background: rgba(79,209,255,0.06);
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 2;
}
.bk-modal__close:hover {
    background: rgba(168,85,247,0.1);
    border-color: rgba(168,85,247,0.3);
    color: #A855F7;
    transform: rotate(90deg);
}

 
.bk-modal__hero {
    display: flex;
    gap: 0;
    background: linear-gradient(145deg, #0f0c1d 0%, #1a1035 50%, #0d1526 100%);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    position: relative;
    min-height: 280px;
}
.bk-modal__hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(79,209,255,0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}
.bk-modal__cover-col {
    flex-shrink: 0;
    padding: 32px 0 32px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; z-index: 1;
}
.bk-modal__cover {
    width: 150px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px 16px 16px 8px;
    box-shadow:
        0 0 0 1px rgba(79,209,255,0.25),
        0 20px 50px rgba(0,0,0,0.55),
        -6px 0 0 rgba(79,209,255,0.4);
}
.bk-modal__cover-placeholder {
    width: 150px;
    aspect-ratio: 2/3;
    border-radius: 8px 16px 16px 8px;
    background: linear-gradient(135deg, rgba(79,209,255,0.12), rgba(168,85,247,0.12));
    border: 1px solid rgba(79,209,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    box-shadow: -6px 0 0 rgba(79,209,255,0.4), 0 20px 50px rgba(0,0,0,0.4);
}
.bk-modal__info-col {
    flex: 1;
    padding: 40px 40px 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    position: relative; z-index: 1;
}
.bk-modal__cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 50px;
    background: rgba(79,209,255,0.15);
    border: 1px solid rgba(79,209,255,0.25);
    color: #4FD1FF;
    font-size: 0.75rem;
    font-weight: 700;
    width: fit-content;
}
.bk-modal__cat::before { content: '✦'; font-size: 0.5rem; }
.bk-modal__title {
    font-family: 'Amiri', serif;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    color: #f8faff;
    line-height: 1.3;
    margin: 0;
}
.bk-modal__author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(79,209,255,0.8);
    font-size: 0.9rem;
    font-weight: 600;
}
.bk-modal__author::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--cyan);
}
.bk-modal__meta-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.bk-modal__meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bk-modal__meta-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.bk-modal__meta-value {
    font-size: 1rem;
    font-weight: 700;
    color: #4FD1FF;
}

 
.bk-modal__body {
    padding: 36px 40px 40px;
}
.bk-modal__section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #0ea5e9;
    text-transform: uppercase;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.bk-modal__section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(79,209,255,0.25), transparent);
}
.bk-modal__desc {
    font-family: 'Amiri', serif;
    font-size: 1.12rem;
    line-height: 2.1;
    color: #334155;
    background: linear-gradient(135deg, rgba(79,209,255,0.03), rgba(168,85,247,0.03));
    border-right: 3px solid;
    border-image: linear-gradient(180deg, #4FD1FF, #A855F7) 1;
    padding: 18px 22px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 32px;
}
.bk-modal__stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.bk-modal__stat-chip {
    flex: 1;
    min-width: 110px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(79,209,255,0.15);
    border-radius: 16px;
    transition: border-color 0.2s;
}
.bk-modal__stat-chip:hover { border-color: rgba(79,209,255,0.3); }
.bk-modal__stat-icon { font-size: 1.5rem; flex-shrink: 0; }
.bk-modal__stat-info { display: flex; flex-direction: column; }
.bk-modal__stat-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}
.bk-modal__stat-lbl {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 1px;
}
 
.bk-modal__buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 17px 24px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    color: #fff;
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 8px 28px rgba(79,209,255,0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    border: none;
}
.bk-modal__buy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(79,209,255,0.45);
}

 
.menu-item.active {
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    background-image: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-text-fill-color: transparent;
}
.menu-item.active::before { opacity: 1; }
.menu-item.active svg { color: var(--cyan); -webkit-text-fill-color: unset; }

 
@media (max-width: 900px) {
    .bk-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px; }
    .bk-modal__cover-col { padding: 24px 0 24px 24px; }
    .bk-modal__cover { width: 120px; }
    .bk-modal__info-col { padding: 28px 24px 28px 16px; }
    .bk-modal__body { padding: 28px 28px 32px; }
}
@media (max-width: 600px) {
    .books-page { padding-top: 72px; }
    .bk-hero { padding: 50px 16px 36px; }
    .bk-controls-wrap { padding: 10px 16px; }
    .bk-controls { gap: 8px; }
    .bk-search-wrap { min-width: unset; }
    .bk-filters { width: 100%; }
    .bk-select { flex: 1; min-width: unset; }
    .bk-section { padding: 28px 16px 60px; }
    .bk-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .bk-card { border-radius: 14px; }
    .bk-card__cover-wrap { aspect-ratio: 3 / 4; }
    .bk-card__body { padding: 8px 10px 10px; }
    .bk-card__title { font-size: 1.3rem; margin-bottom: 4px; }
    .bk-card__author { font-size: 1rem; }
    .bk-card__price { font-size: 0.9rem; }
    .bk-card__year { font-size: 0.9rem; }
    .bk-card__cat-badge { font-size: 0.8rem; padding: 2px 7px; }
    .bk-modal__hero { flex-direction: column; min-height: unset; }
    .bk-modal__cover-col { padding: 28px 28px 0; justify-content: flex-start; }
    .bk-modal__cover { width: 110px; }
    .bk-modal__info-col { padding: 20px 28px 28px; }
    .bk-modal__body { padding: 24px 20px 28px; }
    .bk-modal__stats { gap: 10px; }
    .bk-modal__stat-chip { min-width: calc(50% - 5px); }
}
@media (max-width: 380px) {
    .bk-grid { grid-template-columns: 1fr; }
}