/*
 * Biblioray - Stylesheet Moderne
 * Version: 2.0
 * Date: 2025-11-15
 */

/* ========================================
   IMPORTS & FONTS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Serif:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Couleurs principales */
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #4da3ff;

    --secondary-color: #2C3E50;
    --secondary-dark: #1a252f;
    --secondary-light: #34495E;

    --accent-color: #FFD700;
    --accent-dark: #e6c200;

    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;

    /* Nuances de gris */
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Texte */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #f2f2f2;

    /* Fond */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #2C3E50;

    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Typographie */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Noto Serif', Georgia, serif;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Animations */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
}

/* Mode sombre */
body.night-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-dark: #121212;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* Support prefers-color-scheme */
@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-dark: #121212;
        --text-primary: #e0e0e0;
        --text-secondary: #a0a0a0;
    }
}

/* ========================================
   BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

/* Texte biblique - police serif élégante */
.bible-text,
.scripture {
    font-family: var(--font-serif);
    font-size: var(--font-size-lg);
    line-height: 1.4;
}

/* ========================================
   LINKS
   ======================================== */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

a:hover {
    color: var(--primary-dark);
}

/* Effet underline animé */
a.animated-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-base);
}

a.animated-link:hover::after {
    width: 100%;
}

/* ========================================
   CONTAINERS
   ======================================== */
.container {
    max-width: 1200px;
    margin: 80px auto 40px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-2xl);
    transition: all var(--transition-base);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   BUTTONS
   ======================================== */
button,
.button,
input[type="submit"],
input[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

button:hover,
.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

button:active,
.button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Ripple effect */
button::before,
.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before,
.button:active::before {
    width: 300px;
    height: 300px;
}

/* Variantes de boutons */
.button-secondary {
    background-color: var(--gray-600);
}

.button-secondary:hover {
    background-color: var(--gray-700);
}

.button-success {
    background-color: var(--success-color);
}

.button-danger {
    background-color: var(--danger-color);
}

.button-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.button-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ========================================
   FORMS
   ======================================== */
input,
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   VERSES - Version fidèle à l'ancien
   ======================================== */
.verse {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-left: 5px solid #007bff;
    border-radius: 5px;
    direction: ltr;
    line-height: 1.5;
    position: relative;
}

body.night-mode .verse {
    background-color: #2a2a2a;
    border-left-color: #4da3ff;
}

/* Pour RTL (hébreu) */
.verse.rtl {
    direction: rtl;
    border-left: none;
    border-right: 5px solid #007bff;
}

body.night-mode .verse.rtl {
    border-right-color: #4da3ff;
}

/* Numéro simple sans cercle */
.verse-number {
    font-weight: bold;
    color: #007bff;
}


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

.verse-text {
    font-family: 'Times New Roman', serif;
    display: inline;
}

/* Effet hover léger */
.verse:hover {
    background-color: #eef5ff;
    transition: background-color 0.2s ease;
}

body.night-mode .verse:hover {
    background-color: #333333;
}

/* Positionnement des boutons d'actions */
.verse-actions {
    position: absolute;
    top: 5px;
    display: flex;
    gap: 5px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.verse:hover .verse-actions {
    opacity: 1;
}

.ltr-actions {
    right: 5px;
}

.rtl-actions {
    left: 5px;
}

/* Boutons d'actions */
.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.1);
}

body.night-mode .crossref-btn,
body.night-mode .share-btn {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Pour les très petits écrans */
@media (max-width: 768px) {
    .verse {
        padding: 8px;
        margin-bottom: 12px;
        font-size: 0.95em;
    }
    
    .verse-actions {
        opacity: 1; /* Toujours visible sur mobile */
    }
    
    .crossref-btn,
    .share-btn {
        padding: 2px 5px;
        font-size: 11px;
    }
}

/* ========================================
   ARTICLES
   ======================================== */
.article {
    background: var(--secondary-light);
    color: var(--text-light);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

.article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.article h2,
.article-title {
    color: var(--accent-color);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    font-size: var(--font-size-2xl);
    transition: color var(--transition-base);
}

.article:hover h2,
.article:hover .article-title {
    color: var(--accent-dark);
}

.article .excerpt {
    color: var(--gray-300);
    margin-bottom: var(--spacing-lg);
    line-height: 1.7;
}

.article small {
    color: var(--gray-400);
    font-size: var(--font-size-sm);
}

.lang-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-left: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   TABS
   ======================================== */
.tab {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--spacing-md);
    margin-top: 60px;
    box-shadow: var(--shadow-lg);
}

.tab button,
.tablinks {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-400);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
}

.tab button:hover,
.tablinks:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.tab button.active,
.tablinks.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.tabcontent {
    display: none;
    padding: var(--spacing-xl);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    padding: var(--spacing-md) var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all var(--transition-base);
}

.navbar.scrolled {
    padding: var(--spacing-sm) var(--spacing-xl);
    backdrop-filter: blur(10px);
    background: rgba(44, 62, 80, 0.95);
}

/* ========================================
   DROPDOWN
   ======================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-md);
    z-index: 1001;
    top: calc(100% + 0.5rem);
    left: 0;
    overflow: hidden;
    animation: dropdownSlide 0.3s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: var(--spacing-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.dropdown-content a:hover {
    background-color: var(--gray-100);
    padding-left: calc(var(--spacing-md) + 0.5rem);
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-2xl) 0;
}

.pagination a {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.pagination a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */
.language-switcher {
    background: var(--secondary-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.language-switcher h3 {
    color: var(--accent-color);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-lg);
}

.language-switcher a {
    display: inline-block;
    margin: var(--spacing-sm);
    padding: 0.625rem 1.25rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: all var(--transition-base);
}

.language-switcher a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.language-switcher a.active {
    background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

/* ========================================
   FOOTER
   ======================================== */
.footer-center {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--gray-500);
    font-size: var(--font-size-sm);
}

.banner-text {
    text-align: center;
    padding: var(--spacing-2xl);
    margin: var(--spacing-2xl) 0;
}

.banner-text h1 {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-md);
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--bg-primary);
    margin: 10% auto;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-xl);
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: white;
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    z-index: 3000;
    animation: toastSlideIn 0.4s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.warning { border-left: 4px solid var(--warning-color); }
.toast.info { border-left: 4px solid var(--info-color); }

/* ========================================
   LOADING SPINNER
   ======================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-300);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }

    .container {
        margin: 60px var(--spacing-md) var(--spacing-xl);
        padding: var(--spacing-lg);
        border-radius: var(--radius-md);
    }

    .tab {
        flex-direction: column;
        align-items: stretch;
    }

    .tab button,
    .tablinks {
        width: 100%;
        text-align: center;
    }


    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-xl); }

    .banner-text h1 {
        font-size: var(--font-size-3xl);
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: calc(100% - 2rem);
    }
}


/* Styles pour les boutons des livres */
.book-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    justify-content: center;
    margin: 0 auto;
    max-width: 1200px;
}

.book-buttons button {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    flex: 1 0 calc(16.666% - 8px); /* 6 boutons par ligne sur desktop */
    min-width: 120px;
    max-width: 150px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.book-buttons button:hover {
    background: linear-gradient(145deg, #2980b9, #2471a3);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

.book-buttons button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.book-buttons button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.book-buttons button:hover::after {
    left: 100%;
}

/* Tablettes (768px - 1024px) */
@media (max-width: 1024px) {
    .book-buttons {
        gap: 6px;
        padding: 12px;
    }
    
    .book-buttons button {
        flex: 1 0 calc(25% - 6px); /* 4 boutons par ligne */
        padding: 10px 14px;
        font-size: 0.9em;
        min-width: 100px;
        max-width: 130px;
    }
}

/* Tablettes petites (600px - 768px) */
@media (max-width: 768px) {
    .book-buttons {
        gap: 6px;
        padding: 10px;
    }
    
    .book-buttons button {
        flex: 1 0 calc(33.333% - 6px); /* 3 boutons par ligne */
        padding: 9px 12px;
        font-size: 0.85em;
        min-width: 90px;
        max-width: 120px;
    }
}

/* Mobiles (480px - 600px) */
@media (max-width: 600px) {
    .book-buttons {
        gap: 5px;
        padding: 8px;
    }
    
    .book-buttons button {
        flex: 1 0 calc(50% - 5px); /* 2 boutons par ligne */
        padding: 8px 10px;
        font-size: 0.8em;
        min-width: 80px;
        max-width: 110px;
        border-radius: 6px;
    }
}

/* Petits mobiles (< 480px) */
@media (max-width: 480px) {
    .book-buttons {
        gap: 4px;
        padding: 6px;
    }
    
    .book-buttons button {
        flex: 1 0 calc(50% - 4px); /* 2 boutons par ligne */
        padding: 7px 8px;
        font-size: 0.75em;
        min-width: 70px;
        max-width: 100px;
        border-radius: 5px;
    }
}

/* Très petits écrans (< 360px) */
@media (max-width: 360px) {
    .book-buttons {
        gap: 3px;
        padding: 5px;
    }
    
    .book-buttons button {
        flex: 1 0 calc(50% - 3px);
        padding: 6px 6px;
        font-size: 0.7em;
        min-width: 60px;
        max-width: 90px;
    }
}

/* Pour les écrans très larges (> 1600px) */
@media (min-width: 1600px) {
    .book-buttons {
        max-width: 1400px;
    }
    
    .book-buttons button {
        flex: 1 0 calc(12.5% - 8px); /* 8 boutons par ligne */
        max-width: 140px;
        padding: 14px 18px;
        font-size: 1em;
    }
}

/* Amélioration pour l'accessibilité */
.book-buttons button:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Animation au chargement */
@keyframes buttonFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-buttons button {
    animation: buttonFadeIn 0.3s ease forwards;
}

/* Stagger l'animation pour chaque bouton */
.book-buttons button:nth-child(n) {
    animation-delay: calc(var(--index, 0) * 0.05s);
}

/* Pour ajouter un effet de "pressed" */
.book-buttons button.loading {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    cursor: wait;
    transform: scale(0.98);
}

/* Indicateur de chargement */
.book-buttons button.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .navbar,
    .footer-center,
    .banner-text,
    .language-switcher,
    .pagination,
    button,
    .button {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
        margin: 0;
    }

    .verse {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion pour accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   CROSS-REFERENCES VOTING SYSTEM
   ============================================ */

.crossref-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.crossref-item:hover {
    background: var(--bg-hover, rgba(0, 123, 255, 0.05));
}

.crossref-item.vote-updated {
    animation: voteUpdate 0.6s ease;
}

@keyframes voteUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); background: var(--primary-color-light, #e7f3ff); }
}

.crossref-voting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 4px;
    background: var(--bg-primary, white);
    cursor: pointer;
    transition: all 0.2s ease;
}

.vote-btn:hover:not(:disabled) {
    background: var(--bg-secondary, #f8f9fa);
    border-color: var(--primary-color, #007bff);
    transform: translateY(-1px);
}

.vote-btn:active:not(:disabled) {
    transform: translateY(0);
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vote-btn.vote-up:hover:not(:disabled) {
    color: #28a745;
    border-color: #28a745;
}

.vote-btn.vote-down:hover:not(:disabled) {
    color: #dc3545;
    border-color: #dc3545;
}

.vote-count {
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

.score {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    margin-left: 0.5rem;
}

.suggest-crossref-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    background: var(--accent-color, #FFD700);
    color: var(--text-dark, #2C3E50);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggest-crossref-btn:hover {
    background: #f0c800;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.crossref-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: modalFadeIn 0.3s ease;
}

.crossref-modal.closing {
    animation: modalFadeOut 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.crossref-modal-content {
    background: var(--bg-primary, white);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.crossref-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.crossref-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.crossref-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.crossref-modal-close:hover {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary);
}

.crossref-modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
}

.crossref-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.crossref-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: var(--bg-dark, #2C3E50);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
}

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

.crossref-toast-success {
    background: #28a745;
}

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

.crossref-toast-info {
    background: #007bff;
}

@media (max-width: 768px) {
    .crossref-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .crossref-voting {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: space-between;
    }

    .crossref-modal-content {
        width: 95%;
    }

    .crossref-toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}

body.night-mode .crossref-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.night-mode .vote-btn {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.night-mode .vote-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}
