/* Scripture Library Styles */

.scripture-library-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    background-color: #f5f5f5;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #ffffff;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5f2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-screen p {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
}

/* Main Content Layout */
.main-content {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Sidebar */
.scripture-sidebar {
    width: 320px;
    background-color: #ffffff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background-color: #2c5f2d;
    color: white;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 20px;
}

/* Navigation Controls */
.navigation-controls {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.nav-section {
    margin-bottom: 15px;
}

.nav-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.nav-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.nav-select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.nav-select:hover:not(:disabled) {
    border-color: #2c5f2d;
}

/* Search Section */
.search-section {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.search-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.search-input:focus {
    outline: none;
    border-color: #2c5f2d;
}

/* Study Helps */
.study-helps {
    padding: 20px;
}

.study-helps h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.study-help-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: all 0.2s;
}

.study-help-btn:hover {
    background-color: #e9ecef;
    border-color: #2c5f2d;
}

/* Scripture Reader */
.scripture-reader {
    flex: 1;
    background-color: white;
    overflow-y: auto;
    padding: 40px;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
}

.welcome-content h2 {
    color: #2c5f2d;
    margin-bottom: 15px;
}

.welcome-content p {
    color: #666;
    font-size: 18px;
    margin-bottom: 40px;
}

.quick-stats {
    display: flex;
    justify-content: space-around;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #2c5f2d;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Chapter Reader */
.chapter-reader {
    max-width: 800px;
    margin: 0 auto;
}

.chapter-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #2c5f2d;
}

.chapter-header h2 {
    color: #2c5f2d;
    margin: 0 0 10px 0;
    font-size: 28px;
}

.chapter-meta {
    color: #666;
    font-size: 14px;
}

.chapter-summary {
    background-color: #f8f9fa;
    padding: 20px;
    border-left: 4px solid #2c5f2d;
    margin-bottom: 30px;
    font-style: italic;
    color: #555;
    line-height: 1.6;
}

.chapter-verses {
    margin-bottom: 40px;
}

.verse {
    margin-bottom: 10px;
    padding: 5px;
    line-height: 1.8;
    color: #333;
    border-radius: 3px;
}

.verse-number {
    display: inline-block;
    width: 40px;
    font-weight: bold;
    color: #2c5f2d;
    font-size: 14px;
    margin-right: 10px;
}

.verse-text {
    display: inline;
    font-size: 16px;
}

.verse:hover {
    background-color: #f8f9fa;
}

/* Chapter Navigation */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.nav-btn {
    padding: 10px 20px;
    background-color: #2c5f2d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background-color: #1e4020;
}

.nav-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Search Results */
.search-results {
    max-width: 900px;
    margin: 0 auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #2c5f2d;
}

.results-header h2 {
    color: #2c5f2d;
    margin: 0;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-result-item {
    padding: 20px;
    background-color: #f8f9fa;
    border-left: 4px solid #2c5f2d;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

.result-reference {
    font-weight: bold;
    color: #2c5f2d;
    margin-bottom: 5px;
}

.result-text {
    color: #555;
    line-height: 1.6;
}

.result-text mark {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Study Help Browsers */
.study-help-browser {
    max-width: 900px;
    margin: 0 auto;
}

.browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #2c5f2d;
}

.browser-header h2 {
    color: #2c5f2d;
    margin: 0;
}

.browser-search {
    margin-bottom: 20px;
}

.topics-list,
.entries-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.topic-item,
.entry-item {
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.topic-item:hover,
.entry-item:hover {
    background-color: #e9ecef;
    border-color: #2c5f2d;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.topic-detail,
.entry-detail {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 4px;
}

.topic-detail h3,
.entry-detail h3 {
    color: #2c5f2d;
    margin-top: 0;
}

.see-also {
    margin: 20px 0;
    padding: 15px;
    background-color: white;
    border-left: 4px solid #2c5f2d;
}

.scripture-reference {
    margin-bottom: 10px;
    padding: 10px;
    background-color: white;
    border-radius: 3px;
}

.reference-citation {
    font-weight: bold;
    color: #2c5f2d;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #2c5f2d;
    color: white;
}

.btn-primary:hover {
    background-color: #1e4020;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Regex Toggle - Green Theme Override */
.scripture-library-page .regex-toggle input[type="checkbox"]:checked + .toggle-switch {
    background-color: #2c5f2d;
}

.scripture-library-page .regex-toggle input[type="checkbox"]:checked:hover + .toggle-switch {
    background-color: #1e4020;
}

/* Clear Context Button - Green Theme Override */
.scripture-library-page .clear-context-btn.btn-primary {
    background-color: #2c5f2d;
}

.scripture-library-page .clear-context-btn.btn-primary:hover:not(:disabled) {
    background-color: #1e4020;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .scripture-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        max-height: 300px;
    }

    .scripture-reader {
        padding: 20px;
    }

    .chapter-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .nav-btn {
        width: 100%;
    }

    .topics-list,
    .entries-list {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        flex-direction: column;
        gap: 20px;
    }
}
