/* bible/static/bible/css/bible_styles.css */
/* 역할: bible 앱의 템플릿에서만 사용되는 고유 스타일을 정의합니다. */

/* --- 2. 목록 페이지 고유 스타일 (book.html, chapter.html, verse.html) --- */
[data-current-app="bible"] .list-page-container {
    padding: 16px;
}

[data-current-app="bible"] .category-title-container {
    background-color: var(--color-content-bg);
    z-index: 900;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

[data-current-app="bible"] .category-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

[data-current-app="bible"] .page-main-title-container {
    padding: 24px 0;
    text-align: center;
}

[data-current-app="bible"] .page-main-title-container h1 {
    font-weight: 600;
    margin: 0;
}

/* --- 3. 본문 페이지 고유 스타일 (text.html) --- */
[data-current-app="bible"] .verse-list-items-container {
    padding: 16px 16px calc(var(--button-area-height) + 16px) 16px;
}

[data-current-app="bible"] .verse-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

[data-current-app="bible"] .verse-item {
    line-height: 1.9;
    margin-bottom: 1rem;
    font-size: 16px;
}

[data-current-app="bible"] .verse-number {
    font-weight: 600;
    margin-right: 0.5em;
    font-size: 0.9em;
    color: var(--color-text-secondary);
}

[data-current-app="bible"] .annotated-word {
    background-color: rgba(95, 185, 149, 0.2);
    border-bottom: 2px solid var(--color-primary);
    cursor: pointer;
    padding: 2px 0;
}

[data-current-app="bible"] .highlight-verse {
    background-color: #e7f4ef;
    border-radius: 4px;
    transition: background-color 0.3s ease-in-out;
}

/* --- 4. 검색 오버레이 스타일 (bible 앱 공통) --- */
[data-current-app="bible"] .search-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--color-content-bg);
    z-index: 1050; display: none; flex-direction: column;
}
[data-current-app="bible"] .search-overlay.active { display: flex; }

/* [핵심 수정] 오버레이의 최상위 콘텐츠 영역이 스크롤되도록 변경 */
[data-current-app="bible"] .search-overlay-content {
    max-width: var(--content-max-width); margin: 0 auto;
    width: 100%; display: flex; flex-direction: column; height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* [수정] 검색창과 취소 버튼 사이 여백을 줄입니다. (기존 .search-header 규칙 대신 .search-container 타겟) */
[data-current-app="bible"] #searchOverlay .search-container {
    gap: 8px;
}

/* [수정] 검색창 헤더(.search-header-container)를 상단에 고정시킵니다. */
[data-current-app="bible"] #searchOverlay .search-header-container {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--color-content-bg);
}

/* [핵심 수정] 더 이상 스크롤 컨테이너가 아니므로 overflow-y를 제거합니다. */
[data-current-app="bible"] .search-results { flex-grow: 1; padding: 10px 16px; }

/* [수정] JS가 생성하는 '책 이름 헤더'(.search-result-book-header)를 검색창 아래에 고정시키고 스타일을 적용합니다. */
[data-current-app="bible"] #searchOverlay .search-result-book-header {
    position: -webkit-sticky;
    position: sticky;
    top: 56px; /* 검색창 높이(패딩 8+8 + 입력필드 40)와 정확히 일치 */
    z-index: 1; /* 검색창보다는 아래, 스크롤 내용보다는 위에 오도록 함 */
    background-color: var(--color-content-bg);
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-bottom: 1px solid var(--color-border-light);
}

[data-current-app="bible"] .search-result-item {
    display: block; padding: 12px 0; border-bottom: 1px solid var(--color-border);
    text-decoration: none; color: inherit;
}
[data-current-app="bible"] .search-result-item:hover { background-color: var(--color-hover-bg); }
[data-current-app="bible"] .search-result-item .verse-info {
    font-weight: 600; font-size: 0.9rem;
    color: var(--color-text-secondary); margin-bottom: 4px;
}
[data-current-app="bible"] .search-result-item .verse-content { line-height: 1.6; }
[data-current-app="bible"] mark {
    background-color: rgba(95, 185, 149, 0.3);
    padding: 0.1em 0; border-radius: 2px;
}

[data-current-app="bible"] .loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

[data-current-app="bible"] .spinner {
    border: 4px solid var(--color-hover-bg);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

[data-current-app="bible"] .no-content-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-secondary);
}