/*
 * Biblioray — Pages CSS
 * Complète styles.css avec les styles spécifiques à chaque page.
 * À inclure dans chaque page après styles.css :
 *   <link rel="stylesheet" href="/assets/css/biblioray-pages.css">
 * Ensuite supprimer les blocs <style> inline des pages PHP.
 */

/* ============================================================
   INDEX — Page d'accueil
   ============================================================ */

.language-toggle {
    display: block;
    text-align: center;
    margin: 10px 0 6px;
}
.language-toggle a {
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}
.language-toggle a:hover { color: #0056b3; }

h1.bible-main-title {
    font-size: 1.2em;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

.search-container {
    text-align: center;
    margin: 20px auto;
    padding: 0 15px;
    max-width: 600px;
    width: 100%;
}
.search-container form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}
.search-container input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
.search-container input[type="text"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
}
.search-container input[type="submit"] {
    width: 100%;
    padding: 12px 25px;
    font-size: 16px;
    background-color: #007bff;
    color: white !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.search-container input[type="submit"]:hover { background-color: #0056b3; }

#suggestions {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    text-align: left;
}
#suggestions p {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    margin: 0;
    color: #333;
}
#suggestions p:hover { background: #f0f4ff; }

.random-proverb {
    background-color: #fff0f0;
    border-left: 4px solid #dc3545;
    padding: 12px 18px;
    margin: 16px auto;
    max-width: 760px;
    border-radius: 4px;
    text-align: center;
}
.random-proverb blockquote {
    margin: 0 0 6px;
    font-style: normal;
    color: #333;
    font-size: 1em;
    overflow-wrap: break-word;
}
.random-proverb cite {
    font-style: normal;
    font-weight: bold;
    color: #dc3545;
}

.bible-books-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
}
.bible-books-column {
    flex: 1;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
}
.bible-books-column h2 {
    font-size: 1.1em;
    color: #007bff;
    text-align: center;
    margin-top: 0;
}
.bible-books-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.bible-books-list li { margin: 5px; }
.bible-books-list a {
    display: block;
    padding: 8px 12px;
    background-color: #007bff;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
    transition: background-color 0.3s;
}
.bible-books-list a:hover { background-color: #0056b3; }

/* ============================================================
   DETAILS — Chapitres d'un livre
   ============================================================ */

h2.book-title {
    text-align: center;
    color: #007bff;
    font-size: 1.6em;
    margin-bottom: 10px;
}
.back-link {
    text-align: center;
    margin-bottom: 20px;
}
.back-link a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}
.back-link a:hover { text-decoration: underline; }

.chapters-info {
    margin-bottom: 16px;
    color: #333;
    font-size: 0.95em;
}
.chapters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
.chapters-container a { text-decoration: none; }
.chapter-item {
    padding: 10px;
    background-color: #007bff;
    color: white !important;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    width: 50px;
    font-size: 1em;
    transition: background-color 0.3s;
    box-sizing: border-box;
}
.chapter-item:hover { background-color: #0056b3; }

/* ============================================================
   CHAPTER — Lecture des versets
   ============================================================ */

h2.chapter-title {
    text-align: center;
    color: #007bff;
    font-size: 1.4em;
    margin-bottom: 15px;
}
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.chapter-nav a {
    color: #007bff !important;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
}
.chapter-nav a:hover { text-decoration: underline; }
.chapter-nav-arrows { display: flex; gap: 15px; }
.bottom-nav {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    justify-content: center;
}

/* Versets */
.verse {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid #007bff;
    line-height: 1.7;
}
.verse.rtl { border-left: none; border-right: 3px solid #007bff; direction: rtl; }
.verse-number { font-weight: bold; color: #007bff; margin-right: 6px; font-size: 0.85em; }
.verse-text   { color: #333; }

.verse-actions { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.verse-actions.rtl-actions { margin-left: 0; margin-right: 8px; }
.crossref-btn, .share-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 0.85em;
    transition: background 0.2s;
    vertical-align: middle;
}
.crossref-btn:hover { background: #e8f0fe; border-color: #007bff; }
.share-btn:hover    { background: #fff3e0; border-color: #ff9800; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.modal-content h3 { color: #007bff; margin-top: 0; font-size: 1.1em; }
.close {
    position: absolute; top: 12px; right: 16px;
    font-size: 1.4em; background: none; border: none;
    cursor: pointer; color: #666;
}
.close:hover { color: #333; }

/* Partage */
.share-preview { background: #f9f9f9; padding: 12px; border-radius: 6px; margin-bottom: 14px; }
.share-preview .verse-text { font-style: italic; color: #333; }
.share-preview .verse-ref  { font-weight: bold; color: #007bff; margin-top: 6px; font-size: 0.9em; }
.share-options { display: flex; flex-direction: column; gap: 10px; }
.share-option {
    display: flex !important; align-items: center !important; gap: 10px !important;
    padding: 12px 18px !important; border-radius: 6px !important;
    text-decoration: none !important; color: #ffffff !important;
    font-size: 1em !important; font-weight: 600 !important;
    cursor: pointer !important; border: none !important;
    width: 100% !important; box-sizing: border-box !important;
    transition: opacity 0.2s !important;
}
.share-option * { color: #ffffff !important; }
.share-option:hover { opacity: 0.88 !important; color: #ffffff !important; }
.share-option.whatsapp { background-color: #25d366 !important; }
.share-option.facebook { background-color: #1877f2 !important; }
.share-option.x        { background-color: #1a1a1a !important; }
.share-option.copy     { background-color: #6c757d !important; }

/* ============================================================
   SEARCH — Résultats de recherche
   ============================================================ */

.pagination {
    margin: 20px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.pagination a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff !important;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
}
.pagination a:hover { background-color: #0056b3; }
.pagination span    { color: #666; font-size: 0.9em; }

/* ============================================================
   ARTICLES — Liste des articles
   ============================================================ */

.language-switcher {
    background: #34495E;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}
.language-switcher h3 { color: #FFD700; margin: 0 0 10px; font-size: 1em; }
.language-switcher a {
    display: inline-block;
    margin: 5px;
    padding: 8px 15px;
    background-color: #3498db;
    color: #fff !important;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
}
.language-switcher a:hover  { background-color: #2980b9; }
.language-switcher a.active { background-color: #27ae60; }

.article {
    background: #34495E;
    color: #f2f2f2;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.article h2 { color: #FFD700; margin-bottom: 10px; font-size: 1.2em; }
.article h2 a { color: #FFD700 !important; text-decoration: none; }
.article h2 a:hover { text-decoration: underline; }

.lang-badge {
    display: inline-block;
    padding: 2px 7px;
    background-color: #7f8c8d;
    color: #fff !important;
    font-size: 0.72em;
    border-radius: 3px;
    margin-left: 8px;
    text-transform: uppercase;
    vertical-align: middle;
}

.excerpt { margin-bottom: 12px; color: #ddd; font-size: 0.95em; }
.article small { color: #aaa; font-size: 0.85em; }

.read-more, .edit-link {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    background-color: #3498db;
    color: #fff !important;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.9em;
    transition: background-color 0.3s;
}
.read-more:hover  { background-color: #2980b9; }
.edit-link { margin-left: 8px; background-color: #e67e22; }
.edit-link:hover  { background-color: #ca6f1e; }

.no-articles {
    background: #34495E;
    padding: 40px;
    text-align: center;
    border-radius: 5px;
    color: #bdc3c7;
}

.banner-text { text-align: center; padding: 30px 20px; color: #FFD700; }
.banner-text h2 { font-size: 2em; margin-bottom: 8px; }
.banner-text p  { color: #ccc; font-style: italic; }

/* ============================================================
   ARTICLE — Page d'un article
   ============================================================ */

h1.article-title {
    color: #2C3E50;
    font-size: 1.6em;
    margin-bottom: 8px;
    line-height: 1.3;
}
.content { color: #333; font-size: 1em; line-height: 1.8; margin-bottom: 30px; }
.content p    { margin-bottom: 1em; }
.content h2   { color: #2C3E50; margin: 1.5em 0 0.5em; }
.content h3   { color: #34495E; margin: 1.2em 0 0.4em; }
.content img  { max-width: 100%; height: auto; border-radius: 4px; }
.content blockquote {
    border-left: 4px solid #3498db;
    margin: 1em 0;
    padding: 8px 16px;
    background: #f0f4ff;
    color: #444;
    font-style: italic;
}

.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 28px; }
.share-btn {
    display: inline-flex !important; align-items: center !important;
    gap: 7px !important; padding: 9px 18px !important;
    border-radius: 7px !important; text-decoration: none !important;
    color: #ffffff !important; font-size: 0.9em !important;
    font-weight: 600 !important; border: none !important;
    cursor: pointer !important; transition: opacity 0.2s !important;
}
.share-btn:hover { opacity: 0.88 !important; color: #ffffff !important; }
.share-btn-facebook { background-color: #1877f2 !important; }
.share-btn-twitter  { background-color: #1a1a1a !important; }
.share-btn-whatsapp { background-color: #25d366 !important; }
.share-btn-copy     { background-color: #6c757d !important; }

.article-navigation {
    display: flex; flex-wrap: wrap;
    justify-content: space-between; align-items: center;
    gap: 10px; padding: 20px 0;
    border-top: 1px solid #eee; margin-top: 30px;
}
.article-navigation a {
    color: #007bff !important; text-decoration: none;
    font-size: 0.9em; font-weight: 500;
    padding: 6px 10px; border-radius: 4px;
    transition: background 0.2s;
}
.article-navigation a:hover { background: #f0f4ff; }

/* ============================================================
   CONTACT & SOUTENIR
   ============================================================ */

.contact-form label { font-weight: bold; display: block; margin: 12px 0 4px; }
.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%; padding: 10px 12px;
    border: 1px solid #ccc; border-radius: 5px;
    font-size: 0.95em; box-sizing: border-box;
    font-family: inherit;
}
.message-success {
    background: #d4edda; color: #155724;
    border: 1px solid #c3e6cb;
    padding: 12px 16px; border-radius: 5px;
    margin-bottom: 16px;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer-center {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: #999;
    font-size: 0.85em;
}

/* ============================================================
   RTL
   ============================================================ */

[dir="rtl"] .bible-books-list   { text-align: right; }
[dir="rtl"] .bible-books-column { direction: rtl; }
[dir="rtl"] .random-proverb { border-left: none; border-right: 4px solid #dc3545; }
[dir="rtl"] .verse { border-left: none; border-right: 3px solid #007bff; direction: rtl; }
[dir="rtl"] .verse-actions { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .chapter-nav { direction: rtl; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .bible-books-container { flex-direction: column; }
    .chapter-nav    { flex-direction: column; align-items: flex-start; }
    .share-buttons  { flex-direction: column; }
    .share-btn      { width: 100%; justify-content: center; }
    .article-navigation { flex-direction: column; align-items: flex-start; }
    .chapters-container .chapter-item { width: 44px; padding: 8px; font-size: 0.9em; }
}

@media (max-width: 480px) {
    .search-container input[type="text"],
    .search-container input[type="submit"] { width: 100%; }
    .chapter-nav-arrows { flex-direction: column; gap: 8px; }
}
