/* ==================================
 * 聖經選擇器 (bible_selector.css)
 * ================================== */

/* 1. 彈窗 (Modal) 背景 */
.bible-modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); 
    background-color: rgba(0,0,0,0.4); 
}

/* 2. 彈窗內容區域 */
.bible-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    display: flex;
    flex-direction: column;
    max-height: 80vh; /* 限制最大高度 */
}

/* 3. 關閉按鈕 */
.bible-modal-close {
    color: #aaa;
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.bible-modal-close:hover,
.bible-modal-close:focus {
    color: black;
}

/* 4. 頂部快捷欄 */
.bible-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    border-radius: 8px 8px 0 0;
}
#selected-book-display {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}
.quick-nav {
    display: flex;
}
#quick-chapter-input {
    width: 50px;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    text-align: center;
}
#quick-go-btn {
    padding: 5px 10px;
    border: 1px solid #B50838;
    background-color: #B50838;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 0.9em;
}
#quick-go-btn:hover {
    background-color: #a00730;
}
#quick-go-btn:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* 5. 主標籤 (書卷 / 章) */
.bible-modal-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}
.bible-tab-link {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    background-color: #f1f1f1;
    border: none;
    font-size: 1em;
    color: #555;
    border-bottom: 3px solid transparent;
}
.bible-tab-link.active {
    background-color: #fff;
    color: #B50838;
    border-bottom: 3px solid #B50838;
    font-weight: bold;
}
.bible-tab-content {
    display: none;
}
.bible-tab-content.active {
    display: block;
}

/* 6. 次級標籤 (旧约 / 次经 / 新约) */
.testament-tabs {
    display: flex;
    background-color: #f9f9f9;
    padding: 10px 10px 0 10px;
}
.testament-tab-link {
    flex: 1;
    padding: 8px 5px;
    text-align: center;
    background-color: #eee;
    border: 1px solid #ddd;
    border-bottom: none;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    margin: 0 2px;
    font-size: 0.9em;
}
.testament-tab-link.active {
    background-color: #fff;
    border-bottom: 1px solid #fff;
    font-weight: bold;
    color: #333;
    position: relative;
    top: 1px; /* 營造融合感 */
}

/* 7. 網格容器 (用於滾動) */
.grid-container {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(80vh - 180px); /* 限制網格高度，使其可滾動 */
}

/* 8. 書卷網格 */
.book-grid {
    display: none; /* 默認隱藏 */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.book-grid.active {
    display: grid; /* 激活的才顯示為 grid */
}
.book-button {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1em;
    font-family: PMingLiU, pmingliu, serif;
    transition: all 0.2s;
}
.book-button:hover {
    background-color: #f5f5f5;
    border-color: #B50838;
    color: #B50838;
}
.book-button .abbrev {
    font-weight: bold;
    font-size: 1.1em;
    font-family: "Times New Roman", Times, serif;
    display: block;
}
.book-button .name_zh {
    font-size: 0.9em;
    color: #555;
    display: block;
}

/* 9. 章節網格 */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
}
.chapter-button {
    background: #fff;
    border: 1px solid #ccc;
    padding: 12px 5px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.1em;
    font-family: "Times New Roman", Times, serif;
    transition: all 0.2s;
}
.chapter-button:hover {
    background-color: #f5f5f5;
    border-color: #B50838;
    color: #B50838;
    font-weight: bold;
}

/* 10. 聖經內容顯示區域的特定樣式 */
#bible-display-area {
    border-bottom: 1px solid #f0f0f0;
    /* 初始隱藏，有內容時才顯示 */
    display: none; 
}
#bible-display-area.loading {
    display: flex; /* 確保加載時顯示 */
}
#bible-display-area h3 {
    color: #B50838;
    font-family: "Microsoft YaHei", "微软雅黑", PMingLiU, pmingliu, serif;
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 15px;
}