/* ========================================
   chapter-styles.css - Biblioray
   Version corrigée : boutons alignés verticalement
   ======================================== */

/* Reset et styles de base */
body {
    margin: 0;
    padding: 0;
}

.verse {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;     /* CHANGÉ : aligne sur la ligne de base du texte */
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px;
    background-color: #f5f5f5;
    border-left: 5px solid #007bff;
    border-radius: 5px;
    direction: ltr;
    line-height: 1.4;
}

.verse.rtl {
    direction: rtl;
    border-left: none;
    border-right: 5px solid #007bff;
}

/* Numéro de verset */
.verse-number {
    display: inline-block;
    background: none;
    border-radius: 0;
    width: auto;
    height: auto;
    padding: 0;
    margin-right: 5px;
    color: #007bff;
    font-weight: bold;
    font-size: 1em;
    flex-shrink: 0;
}

.verse.rtl .verse-number {
    margin-right: 0;
    margin-left: 5px;
}

/* Texte du verset */
.verse-text {
    color: #000000;
    display: inline;
    line-height: 1.4;
    font-size: 1.05em;
    flex: 1;
}

/* Actions (boutons) - alignés à droite et sur la même ligne */
.verse-actions {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;        /* Pousse les boutons à droite */
}

/* Pour RTL : boutons à gauche */
.verse.rtl .verse-actions {
    margin-left: 0;
    margin-right: auto;
}

/* Supprimer les anciens positionnements */
.ltr-actions, .rtl-actions {
    position: static;
    right: auto;
    left: auto;
    top: auto;
}

/* Boutons individuels */
.crossref-btn,
.share-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.crossref-btn:hover,
.share-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

/* Titres et navigation */
h2.chapter-title {
    text-align: center;
    color: #007bff;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Navigation entre chapitres */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.chapter-nav a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chapter-nav a:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.chapter-nav-arrows {
    display: flex;
    gap: 15px;
}

.bottom-nav {
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Conteneur principal */
.container {
    max-width: 90%;
    margin: 0 auto;
    padding: 10px;
}

/* ===== STYLES DES MODALES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 15px;
    width: 80%;
    max-width: 600px;
    border-radius: 6px;
    position: relative;
    line-height: 1.4;
}

.close {
    position: absolute;
    right: 12px;
    top: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    background: none;
    border: none;
}

.close:hover {
    color: #000;
}

/* Références croisées */
.crossref-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crossref-item {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    line-height: 1.3;
}

.crossref-link {
    text-decoration: none;
    color: #007bff;
    font-size: 0.9em;
}

.crossref-link:hover {
    text-decoration: underline;
}

.crossref-header {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
    padding-bottom: 3px;
    border-bottom: 1px solid #eee;
}

.crossref-more {
    font-style: italic;
    color: #888;
    font-size: 0.85em;
    text-align: center;
    padding: 3px 0;
}

.votes {
    color: #666;
    font-size: 0.85em;
    margin-left: 6px;
}

/* Partage */
.share-preview {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin: 12px 0;
    border-left: 3px solid #007bff;
}

.share-preview .verse-text {
    font-style: italic;
    margin-bottom: 5px;
    line-height: 1.3;
    font-size: 0.95em;
    color: #333;
}

.share-preview .verse-ref {
    font-size: 0.85em;
    color: #666;
    font-weight: bold;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.share-option {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    background: white;
    font-size: 0.9em;
    cursor: pointer;
}

.share-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-option.whatsapp {
    border-color: #25D366;
    color: #25D366;
}

.share-option.facebook {
    border-color: #1877F2;
    color: #1877F2;
}

.share-option.x {
    border-color: #000000;
    color: #000000;
}

.share-option.copy {
    border-color: #666;
    color: #666;
}

/* Toast notifications */
.crossref-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    color: white;
    font-weight: 500;
}

.crossref-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.crossref-toast-success {
    background: #2ecc71;
}

.crossref-toast-error {
    background: #e74c3c;
}

.crossref-toast-info {
    background: #3498db;
}

/* Animation pour les mises à jour de vote */
.vote-updated {
    animation: votePulse 0.6s ease;
}

@keyframes votePulse {
    0% { background-color: transparent; }
    50% { background-color: rgba(52, 152, 219, 0.1); }
    100% { background-color: transparent; }
}

/* ===== MODE NUIT ===== */
body.night-mode .verse {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-left-color: #bb86fc;
}

body.night-mode .verse.rtl {
    border-right-color: #bb86fc;
    border-left: none;
}

body.night-mode .verse-number {
    color: #bb86fc;
}

body.night-mode .verse-text {
    color: #e0e0e0;
}

body.night-mode h2.chapter-title {
    color: #bb86fc;
}

body.night-mode .chapter-nav a {
    color: #bb86fc;
}

body.night-mode .chapter-nav a:hover {
    background-color: rgba(187, 134, 252, 0.15);
}

body.night-mode .modal-content {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.night-mode .close {
    color: #aaa;
}

body.night-mode .close:hover {
    color: #fff;
}

body.night-mode .crossref-item {
    border-bottom-color: #444;
}

body.night-mode .crossref-header {
    color: #aaa;
    border-bottom-color: #444;
}

body.night-mode .share-preview {
    background: #1e1e1e;
    border-left-color: #bb86fc;
}

body.night-mode .share-preview .verse-text {
    color: #e0e0e0;
}

body.night-mode .share-preview .verse-ref {
    color: #aaa;
}

body.night-mode .share-option {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

/* ===== RESPONSIVE : petits écrans ===== */
@media (max-width: 768px) {
    .container {
        max-width: 95%;
        padding: 5px;
    }
    
    .verse {
        padding: 8px;
        gap: 6px;
    }
    
    .verse-number {
        font-size: 0.9em;
    }
    
    .verse-text {
        font-size: 0.95em;
    }
    
    .verse-actions {
        gap: 3px;
    }
    
    .crossref-btn,
    .share-btn {
        padding: 1px 4px;
        font-size: 10px;
    }
    
    .chapter-nav {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .chapter-nav-arrows {
        justify-content: center;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 90%;
    }
}

/* ===== TRÈS PETITS ÉCRANS ===== */
@media (max-width: 480px) {
    .verse {
        margin-bottom: 10px;
        padding: 6px;
    }
    
    .verse-text {
        font-size: 0.9em;
    }
}

/* ===== BOUTON SHARE COMPACT ===== */
.share-btn {
    padding: 2px 3px;
    font-size: 10px;
    min-width: 20px;
    width: auto;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.02);
}

/* Mode nuit */
body.night-mode .share-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.night-mode .share-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile encore plus compact */
@media (max-width: 768px) {
    .share-btn {
        padding: 1px 2px;
        font-size: 9px;
        min-width: 16px;
    }
}