/* Extracted from viewer.php; preserve page scope. */
/* تنسيقات عامة */
.book-viewer-container { max-width: 1100px; margin: 20px auto; background: #fff; padding: 20px 30px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.book-header { border-bottom: 2px solid #eee; padding-bottom: 15px; margin-bottom: 20px; }
.book-header h1 { font-size: 2rem; color: #01579b; margin: 0; }
.book-author, .book-category, .book-stats { color: #555; margin: 5px 0; }

/* إطار أزرار التبويب في المنتصف */
.tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}
.book-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: #f5f7fa;
    border: 2px solid #01579b;
    border-radius: 30px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.book-tab {
    padding: 10px 25px;
    border-radius: 30px;
    background: transparent;
    color: #01579b;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}
.book-tab.active {
    background: #01579b;
    color: #fff;
}
.book-tab:hover {
    background: #013a6b;
    color: #fff;
}

/* الفهرس المسطح */
.tree-container { direction: rtl; }
.index-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f4f8;
    border: 1px solid #c0c8d0;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
}
.index-link { color: #01579b; text-decoration: none; font-size: 1.1rem; font-weight: 600; }
.index-link:hover { text-decoration: underline; }
.index-label { color: #222; font-size: 1.1rem; font-weight: 600; }
.tree-bullet { font-size: 1.2rem; color: #000; line-height: 1; }

/* التنقل السفلي */
.page-nav-bottom { margin-top: 30px; padding-top: 20px; border-top: 2px solid #e8e8e8; display: flex; justify-content: center; }
.nav-buttons-vertical { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 320px; }
.nav-buttons-vertical .nav-btn { width: 100%; text-align: center; padding: 12px 24px; min-height: 48px; font-size: 1rem; background: #01579b; color: #fff; border: none; border-radius: 8px; cursor: pointer; text-decoration: none; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; }
.nav-buttons-vertical .nav-btn:hover { background: #003d66; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(1, 87, 155, 0.3); }
.nav-buttons-vertical .nav-btn:active { transform: translateY(0); }
.nav-buttons-vertical .page-indicator { font-weight: bold; background: #f0f0f0; padding: 8px 20px; border-radius: 30px; font-size: 1rem; color: #333; width: 100%; text-align: center; margin: 5px 0; }

/* أزرار الخط */
.font-size-controls { display: flex; justify-content: center; gap: 8px; margin-bottom: 15px; }
.font-size-btn { background: #e0e0e0; border: none; border-radius: 6px; padding: 6px 14px; font-size: 1rem; font-weight: bold; cursor: pointer; transition: all 0.2s; color: #333; }
.font-size-btn:hover { background: #01579b; color: #fff; }
.font-size-btn:active { transform: scale(0.95); }

/* محتوى الصفحة */
.page-content { font-size: 1rem; line-height: 1.8; padding: 20px; background: #fafafa; border-radius: 8px; border: 1px solid #eee; }

/* الآيات بدون أقواس: لون أخضر وغامق */
.formatted-content .ayah {
    color: #2e7d32;
    font-weight: bold;
}

/* العناوين: أحمر غامق مع مسافات */
.formatted-content .title {
    color: #8B0000 !important;
    font-weight: bold;
    display: block;
    margin-top: 18px;
    margin-bottom: 12px;
    font-size: 1.2rem;
}
.formatted-content .title:first-of-type { margin-top: 0; }

/* هدف التمرير */
#title-target {
    display: block;
    background-color: #fff9c4;
    border-radius: 4px;
    padding: 0 4px;
    color: #8B0000 !important;
}

/* البحث */
.search-input { padding: 10px 16px; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; min-width: 300px; }
.result-item { padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.result-meta { color: #888; font-size: 0.85rem; margin-right: 10px; }
mark { background: #ffeb3b; padding: 0 4px; }
.text-muted { color: #777; }

/* استجابة الجوال */
@media (max-width: 600px) {
    .book-viewer-container { padding: 10px 15px; }
    .tabs-wrapper { margin-bottom: 15px; }
    .book-tabs { gap: 5px; padding: 4px; }
    .book-tab { padding: 8px 15px; font-size: 0.9rem; }
    .nav-buttons-vertical { max-width: 100%; }
    .nav-buttons-vertical .nav-btn { max-width: 100%; padding: 10px 16px; min-height: 44px; font-size: 0.9rem; }
    .nav-buttons-vertical .page-indicator { max-width: 100%; font-size: 0.9rem; padding: 6px 14px; }
    .page-content { font-size: 1rem; padding: 12px; }
    .search-input { min-width: 200px; width: 100%; }
    .index-item { padding: 6px 8px; }
}
