/* Main Container */
.bible-reader-wrapper {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.bible-reader-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Verse Container */
.verse-of-the-day-container {
    font-family: 'Georgia', serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    unicode-bidi: plaintext; /* Prevent text direction weirdness */
}

/* Verse Text */
.verse-content {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #222;
    font-style: italic;
    margin-bottom: 15px;
}

/* Reference */
.verse-reference {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    margin-top: 10px;
}

.verse-reference cite {
    display: block;
    font-style: normal;
    font-size: 1rem;
    color: #555;
    margin-top: 10px;
}

/* Loading State */
.loading-verse {
    color: #777;
    font-style: italic;
    padding: 15px 0;
}

/* Error State */
.verse-error {
    color: #c33;
    background: #ffebee;
    padding: 10px 15px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 10px;
    font-size: 0.85rem;
}

/* Hebrew Date Converter */
.hebrew-date-converter {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.hebrew-converter input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.hebrew-converter button {
    background: #0035B9;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.hebrew-converter button:hover {
    background: #2980b9;
}

.hebrew-result {
    margin-top: 15px;
    min-height: 50px;
}

.hebrew-info {
    padding: 15px;
    background: #e8f4fd;
    border-radius: 6px;
    color: #2c3e50;
}

.hebrew-date-display {
    font-size: 1.2em;
    margin-bottom: 8px;
}

.hebrew-holiday {
    font-style: italic;
    color: #666;
}

#gregorian-date {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.hebrew-error {
    padding: 15px;
    background: #fadbd8;
    border-radius: 6px;
    color: #c0392b;
}

/* Controls */
.bible-controls {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.control-group {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.bible-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: white;
    font-size: 0.95rem;
    color: #495057;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.bible-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.bible-select:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* Button */
.bible-button {
    align-self: flex-end;
    background: #0035B9;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.bible-button:hover {
    background: #2980b9;
}

.bible-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Chapter Navigation */
.chapter-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
    max-width: 100%;
    margin: 0 auto;
}

#chapter-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    text-align: center;
    grid-column: 2;
}

.nav-button {
    padding: 8px 12px;
    text-decoration: none;
    color: #0035B9;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    white-space: nowrap;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

#prev-chapter {
    grid-column: 1;
    justify-self: end;
}

#next-chapter {
    grid-column: 3;
    justify-self: start;
}

.nav-button:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

.nav-button.hidden {
    display: none;
}

/* Content */
.bible-content-container {
    padding: 25px;
    min-height: 200px;
}

.bible-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Verse Selection */
.bible-content p {
    position: relative;
    padding: 8px 15px 8px 30px;
    margin: 0;
    line-height: 1.6;
    cursor: pointer;
}

.bible-content p.selected {
    background-color: #e8f2fc;
    border-bottom: 3px solid #0035B9;
}

.bible-content p .verse-number {
    position: absolute;
    left: 10px;
    color: #666;
    font-size: 0.8em;
    font-weight: bold;
}

/* Search Container */
.search-container {
    display: flex;
    grid-column: 1 / -1;
    height: 40px;
    margin-top: 28px;
}

#bible-search {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px 0 0 6px;
    font-size: 0.95rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#bible-search:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-button {
    background: #0035B9;
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-button:hover {
    background: #2980b9;
}

/* Search Results */
.search-results-container {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.search-result {
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.search-result:hover {
    background: #e9ecef;
}

.search-result-reference {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.search-result-text {
    color: #495057;
    line-height: 1.6;
}

.search-highlight {
    background-color: #FFEB3B;
    padding: 2px 4px;
    border-radius: 3px;
}

.search-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
}

.search-pagination button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    color: black;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.search-pagination button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.search-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.search-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

.search-summary {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.search-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
    flex-wrap: wrap;
}

.search-pagination button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    min-width: 40px;
}

.search-pagination button.active {
    background: #0035B9;
    color: white;
    border-color: #0035B9;
}

.search-pagination button:hover:not(.active) {
    background: #f5f5f5;
}

.page-nav {
    padding: 5px 10px !important;
}

/* Toolbar */
.verse-toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px 15px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.copy-btn {
    background: #3a7bc8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.copy-btn i {
    margin-right: 5px;
}

.copied-notice {
    color: #4CAF50;
    margin-left: 15px;
    font-size: 14px;
    display: none;
}

/* Share Button */
.share-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    position: relative;
}

.share-btn i {
    margin-right: 5px;
}

/* Share Dropdown */
.share-dropdown {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 10px;
    margin-bottom: 10px;
    display: none;
    min-width: 180px;
    z-index: 1001;
}

.share-dropdown.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.share-dropdown:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

.share-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    margin: 2px 0;
    transition: background 0.2s ease;
}

.share-option:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.share-option i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.truthsocial-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.gab-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.share-option img {
    display: inline-block;
    vertical-align: middle;
}

.share-option span {
    vertical-align: middle;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.selected-reference {
    font-weight: bold;
    color: #333;
}

@keyframes fadeIn {
    from { opacity: 0; bottom: 10px; }
    to { opacity: 1; bottom: 20px; }
}

.bible-error {
    color: #e74c3c;
    padding: 10px;
    background: #fadbd8;
    border-radius: 4px;
    margin-top: 10px;
}

/* Arabic/Persian content */
[dir="rtl"] .bible-select option {
    direction: rtl;
    text-align: right;
}

[lang="ar"] {
    font-family: 'Traditional Arabic', 'Arial', sans-serif;
    line-height: 2
}

[lang="fa"] {
    font-family: 'Nazanin', 'Arial', sans-serif;
}

/* Greek Font Support */
.greek-text {
    font-family: "New Athena Unicode", "Palatino Linotype", serif;
    font-size: 1.15em;
    line-height: 1.8;
}

/* Language Specific Selectors */
#bible-language option[value="ell"] {
    font-family: inherit; /* Prevent Greek font in dropdown */
}

/* Font controls styling */
.font-controls-container {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
}

.font-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 5px 12px;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.font-controls button {
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #333;
}

.font-controls button:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.font-controls button:active {
    background: #e0e0e0;
}

.font-controls button#font-reset {
    font-size: 16px;
    color: #0035B9;
}

.font-controls button#font-decrease {
    font-size: 13px;
    color: #e74c3c;
}

.font-controls button#font-increase {
    font-size: 19px;
    color: #27ae60;
}

/* Word Cloud */
#word-cloud-container {
    background: #f8f9fa;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid #e1e5eb;
}

#word-cloud-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.highlighted-word {
    background-color: #FFEB3B;
    padding: 2px 4px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.word-tag.active {
    background: #e74c3c;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.word-tag {
    cursor: pointer;
    transition: all 0.2s ease;
    background: #0035B9;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    margin: 3px;
    display: inline-block;
    font-size: 14px;
}

.word-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background: #2980b9;
}

[lang="ar"] .word-tag,
[lang="fa"] .word-tag,
[lang="he"] .word-tag,
[lang="yi"] .word-tag {
    direction: rtl;
    font-family: 'Traditional Arabic', 'Nazanin', 'Arial', sans-serif;
}

[lang="el"] .word-tag {
    font-family: "New Athena Unicode", "Palatino Linotype", serif;
}

/* Responsive */
@media (max-width: 600px) {
    .chapter-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    #chapter-title {
        order: -1;
    }
    
    .nav-button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .bible-controls {
        grid-template-columns: 1fr;
    }
    
    .bible-content {
        font-size: 1rem;
    }
    
    .verse-content {
        font-size: 1rem;
    }
}
