/* =====================================================
   BIBLIOTHEQUE PAROISSIALE DU VEXIN - STYLES GLOBAUX
   Design: Bibliothèque paroissiale traditionnelle
   ===================================================== */

/* === IMPORTS & VARIABLES === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Source+Sans+Pro:wght@300;400;500;600&family=Cinzel:wght@400;500;600;700&display=swap');

:root {
    /* Couleurs principales */
    --primary-dark: #1a2a3a;      /* Bleu marine profond */
    --primary: #2c3e50;           /* Bleu marine */
    --primary-light: #34495e;     /* Bleu gris */

    /* Couleurs secondaires - Contraste WCAG AA amélioré */
    --secondary: #4a5a6a;         /* Gris bleuté (contraste 7:1) */
    --secondary-light: #667788;   /* Gris moyen (contraste 4.5:1) */

    /* Accents - Or liturgique */
    --accent-gold: #c9a227;       /* Or antique */
    --accent-gold-light: #d4af37; /* Or clair */
    --accent-gold-pale: #f4e4ba;  /* Or très pâle */

    /* Couleurs liturgiques */
    --liturgical-purple: #4a235a; /* Violet - Avent, Carême */
    --liturgical-purple-light: #7d3c98;
    --liturgical-red: #8b0000;    /* Rouge - Martyrs, Pentecôte */
    --liturgical-green: #1e5631;  /* Vert - Temps ordinaire */
    --liturgical-white: #f5f5dc;  /* Blanc/Crème - Fêtes */
    --marian-blue: #1e3a5f;       /* Bleu marial */
    --marian-blue-light: #2e5a8f;
    --parchment: #f5f0e1;         /* Parchemin ancien */
    --parchment-dark: #e8dcc8;
    --sepia: #704214;             /* Sépia pour textes anciens */

    /* Neutres */
    --white: #ffffff;
    --off-white: #f8f9fa;
    --cream: #fdfbf7;
    --light-gray: #ecf0f1;
    --medium-gray: #95a5a6;       /* Amélioré pour meilleur contraste */
    --dark-gray: #5f6c7d;         /* Amélioré pour contraste 4.5:1 */
    --text-dark: #1a252f;         /* Plus foncé pour meilleur contraste */
    --text-light: #4a5568;        /* Amélioré pour contraste 7:1 */

    /* Focus - Accessibilité */
    --focus-ring: #2563eb;        /* Bleu vif pour focus visible */
    --focus-ring-offset: 2px;

    /* États */
    --success: #27ae60;
    --success-light: #d5f4e2;
    --warning: #f39c12;
    --warning-light: #fef3d5;
    --danger: #c0392b;
    --danger-light: #fadbd8;
    --info: #3498db;
    --info-light: #d6eaf8;

    /* Typographie */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Sans Pro', 'Segoe UI', Tahoma, sans-serif;
    --font-liturgical: 'Cinzel', 'Playfair Display', Georgia, serif; /* Police style médiéval */

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

    /* Bordures & Ombres */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

/* Réduire les animations pour les utilisateurs qui le préfèrent */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--cream);
    min-height: 100vh;
}

/* === ACCESSIBILITÉ === */

/* Lien "Aller au contenu" pour navigation clavier */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-dark);
    color: var(--white);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--spacing-md);
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Focus visible pour navigation clavier */
:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
    border-radius: var(--radius-sm);
}

/* Focus amélioré pour les boutons */
button:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Focus amélioré pour les liens */
a:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Focus amélioré pour les inputs */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 0;
    border-color: var(--focus-ring);
}

/* Texte pour lecteurs d'écran uniquement */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Classe pour rendre visible au focus (ex: skip link) */
.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* === FOND DÉCORATIF === */
.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        linear-gradient(135deg, var(--cream) 0%, var(--off-white) 50%, var(--light-gray) 100%);
}

.page-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(201, 162, 39, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(44, 62, 80, 0.03) 0%, transparent 50%);
}

/* Motif subtil de livres */
.page-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10h8v40h-8zM22 10h6v40h-6zM32 10h4v40h-4zM40 10h10v40h-10z' fill='%231a2a3a' fill-opacity='1'/%3E%3C/svg%3E");
}

/* === CONTENEUR PRINCIPAL === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.container-narrow {
    max-width: 800px;
}

.container-wide {
    max-width: 1400px;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
    border-radius: 2px;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-light);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-gold);
}

/* === HEADER === */
.header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: var(--spacing-lg) var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20h15v60h-15zM40 20h10v60h-10zM55 20h8v60h-8zM68 20h12v60h-12z' fill='%23ffffff' fill-opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header-logo img {
    height: 70px;
    width: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.header-title {
    color: var(--white);
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header-title::after {
    display: none;
}

.header-subtitle {
    color: var(--accent-gold-pale);
    font-size: 0.95rem;
    font-weight: 400;
    margin-top: var(--spacing-xs);
    font-style: italic;
}

.header-actions {
    display: flex;
    gap: var(--spacing-md);
}

/* === NAVIGATION === */
.nav {
    background: var(--white);
    border-bottom: 1px solid var(--light-gray);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-content {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    flex-wrap: wrap;
}

.nav-link {
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--text-dark);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--light-gray);
}

.nav-link.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--primary-light);
}

/* === BOUTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    color: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #2ecc71 100%);
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #e74c3c 100%);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dark);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--light-gray);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.85rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* === CARTES === */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    padding: var(--spacing-lg);
    position: relative;
}

.card-header h3 {
    color: var(--white);
    margin: 0;
    font-size: 1.25rem;
}

.card-header-accent {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    color: var(--primary-dark);
}

.card-header-accent h3 {
    color: var(--primary-dark);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--off-white);
    border-top: 1px solid var(--light-gray);
}

/* Carte livre */
.book-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-card .card-body {
    flex: 1;
}

.book-card-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.book-card-author {
    color: var(--secondary);
    font-style: italic;
    margin-bottom: var(--spacing-md);
}

.book-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: auto;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
}

.badge-available {
    background: var(--success-light);
    color: var(--success);
}

.badge-borrowed {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-overdue {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-category {
    background: var(--info-light);
    color: var(--info);
}

/* === FORMULAIRES === */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.form-input::placeholder {
    color: var(--medium-gray);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-help {
    font-size: 0.85rem;
    color: var(--dark-gray);
    margin-top: var(--spacing-xs);
}

.form-error {
    font-size: 0.85rem;
    color: var(--danger);
    margin-top: var(--spacing-xs);
}

.form-input.error {
    border-color: var(--danger);
}

/* Champ de recherche stylisé */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .form-input {
    padding-left: 45px;
}

.search-input-wrapper::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235d6d7e'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
}

/* === TABLEAUX === */
.table-wrapper {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.table th {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.table th:first-child {
    border-radius: var(--radius-lg) 0 0 0;
}

.table th:last-child {
    border-radius: 0 var(--radius-lg) 0 0;
}

/* Sortable columns */
.table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background var(--transition-fast);
}

.table th.sortable:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.table th.sortable.sorted {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    color: var(--primary-dark);
}

.table th .sort-indicator {
    font-size: 0.75rem;
    margin-left: 4px;
    opacity: 0.9;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--off-white);
}

.table tbody tr:nth-child(even) {
    background: var(--cream);
}

.table tbody tr:nth-child(even):hover {
    background: var(--light-gray);
}

.table tbody tr.borrowed {
    background: var(--warning-light);
}

.table tbody tr.overdue {
    background: var(--danger-light);
}

/* === SECTIONS === */
.section {
    padding: var(--spacing-2xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-header h2 {
    display: inline-block;
}

.section-header p {
    max-width: 600px;
    margin: var(--spacing-lg) auto 0;
    font-size: 1.1rem;
}

/* Section héro */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: var(--white);
    padding: var(--spacing-3xl) var(--spacing-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10h8v40h-8zM22 10h6v40h-6zM32 10h4v40h-4zM40 10h10v40h-10z' fill='%23ffffff' fill-opacity='0.03'/%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
    color: var(--accent-gold-pale);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xl);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* === GRILLES === */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

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

.pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--light-gray);
    background: var(--white);
    color: var(--text-dark);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

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

.pagination-ellipsis {
    padding: 0 var(--spacing-xs);
    color: var(--secondary);
    font-weight: 500;
}

.pagination-select {
    margin-left: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--text-dark);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.pagination-select:hover {
    border-color: var(--primary);
}

.pagination-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* === MODALES === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 42, 58, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--dark-gray);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--light-gray);
    color: var(--text-dark);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--light-gray);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* === ALERTES === */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-warning {
    background: var(--warning-light);
    color: #9a7b0a;
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: var(--info-light);
    color: #1a5276;
    border-left: 4px solid var(--info);
}

/* === FOOTER === */
.footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-text {
    color: var(--accent-gold-pale);
    font-size: 0.9rem;
    margin: 0;
}

.footer-links {
    margin-top: var(--spacing-md);
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.footer-links a {
    color: var(--white);
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-gold-light);
}

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

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-accent { color: var(--accent-gold); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--dark-gray); }

.bg-primary { background: var(--primary); }
.bg-white { background: var(--white); }
.bg-cream { background: var(--cream); }
.bg-light { background: var(--off-white); }

.mt-0 { margin-top: 0; }
.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-0 { margin-bottom: 0; }
.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-0 { padding: 0; }
.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

.w-100 { width: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.animate-fadeIn {
    animation: fadeIn var(--transition-slow) ease-out;
}

.animate-slideUp {
    animation: slideUp var(--transition-slow) ease-out;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }

    .header-logo {
        flex-direction: column;
    }

    .header-title {
        font-size: 1.5rem;
    }

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

    .nav-link {
        text-align: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .table-wrapper {
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
    }

    .hero {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .card-body {
        padding: var(--spacing-md);
    }
}

/* === AUTOCOMPLETE === */
.autocomplete-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: -2px;
}

.autocomplete-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    color: var(--text-dark);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--light-gray);
}

.autocomplete-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--primary);
    color: var(--white);
}

.autocomplete-item strong {
    font-weight: 600;
    color: var(--accent-gold);
}

.autocomplete-item:hover strong,
.autocomplete-item.active strong {
    color: var(--accent-gold-pale);
}

/* Scrollbar styling for dropdown */
.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 0 0 var(--radius-md) 0;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: var(--radius-sm);
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Input with active autocomplete */
.autocomplete-wrapper .form-input:focus {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.autocomplete-wrapper .form-input:not(:focus) + .autocomplete-dropdown {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        max-height: 200px;
    }

    .autocomplete-item {
        padding: var(--spacing-md);
    }
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: var(--white);
    border-left: 4px solid var(--primary);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s ease-in forwards;
}

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

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

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.toast-message {
    color: var(--secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--secondary);
    opacity: 0.7;
    transition: opacity 0.2s;
    border-radius: var(--radius-sm);
}

.toast-close:hover {
    opacity: 1;
    background: var(--light-gray);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    border-radius: 0 0 0 var(--radius-md);
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Toast Types */
.toast.toast-success {
    border-left-color: var(--success);
    background: linear-gradient(to right, var(--success-light) 0%, var(--white) 100%);
}

.toast.toast-success .toast-icon {
    color: var(--success);
}

.toast.toast-success .toast-progress {
    background: var(--success);
}

.toast.toast-error {
    border-left-color: var(--danger);
    background: linear-gradient(to right, var(--danger-light) 0%, var(--white) 100%);
}

.toast.toast-error .toast-icon {
    color: var(--danger);
}

.toast.toast-error .toast-progress {
    background: var(--danger);
}

.toast.toast-warning {
    border-left-color: var(--warning);
    background: linear-gradient(to right, var(--warning-light) 0%, var(--white) 100%);
}

.toast.toast-warning .toast-icon {
    color: var(--warning);
}

.toast.toast-warning .toast-progress {
    background: var(--warning);
}

.toast.toast-info {
    border-left-color: var(--info);
    background: linear-gradient(to right, var(--info-light) 0%, var(--white) 100%);
}

.toast.toast-info .toast-icon {
    color: var(--info);
}

.toast.toast-info .toast-progress {
    background: var(--info);
}

/* Toast responsive */
@media (max-width: 480px) {
    .toast-container {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        left: var(--spacing-sm);
        max-width: none;
    }

    .toast {
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }

    .toast.toast-exit {
        animation: none;
        opacity: 0;
    }

    .toast-progress {
        animation: none;
        width: 0;
    }
}

/* =====================================================
   ÉLÉMENTS CATHOLIQUES TRADITIONNELS
   ===================================================== */

/* === CROIX STYLISÉE === */
.cross-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.cross-icon svg {
    width: 24px;
    height: 24px;
}

.cross-icon.large svg {
    width: 32px;
    height: 32px;
}

/* Croix avec effet doré */
.cross-ornate {
    position: relative;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(201, 162, 39, 0.3);
}

/* === TITRE AVEC CROIX === */
.title-with-cross {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.title-with-cross .cross-icon {
    animation: gentleGlow 3s ease-in-out infinite;
}

@keyframes gentleGlow {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; filter: drop-shadow(0 0 8px rgba(201, 162, 39, 0.5)); }
}

/* === BORDURES DÉCORATIVES ENLUMINURES === */
.ornate-border {
    position: relative;
    border: 2px solid var(--accent-gold);
    border-radius: var(--radius-lg);
}

.ornate-border::before,
.ornate-border::after {
    content: '✦';
    position: absolute;
    color: var(--accent-gold);
    font-size: 1rem;
}

.ornate-border::before {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 0 8px;
}

.ornate-border::after {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 0 8px;
}

/* Coins décorés */
.ornate-corners {
    position: relative;
}

.ornate-corners::before,
.ornate-corners::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-gold);
}

.ornate-corners::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: var(--radius-md);
}

.ornate-corners::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: var(--radius-md);
}

/* === STYLE PARCHEMIN POUR CITATIONS === */
.parchment-style {
    background: linear-gradient(135deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    border: 1px solid var(--parchment-dark);
    border-radius: var(--radius-lg);
    box-shadow:
        inset 0 0 30px rgba(112, 66, 20, 0.05),
        0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.parchment-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    border-radius: inherit;
}

/* Citation bloc style parchemin */
.quote-parchment {
    padding: var(--spacing-xl);
    margin: var(--spacing-lg) 0;
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--sepia);
    text-align: center;
    line-height: 1.8;
}

.quote-parchment .quote-text {
    font-size: 1.15rem;
    position: relative;
    display: block;
    margin-bottom: var(--spacing-md);
}

.quote-parchment .quote-text::before {
    content: '«';
    font-size: 2.5rem;
    color: var(--accent-gold);
    position: absolute;
    left: -1.5rem;
    top: -0.5rem;
    font-style: normal;
    line-height: 1;
}

.quote-parchment .quote-text::after {
    content: '»';
    font-size: 2.5rem;
    color: var(--accent-gold);
    position: absolute;
    right: -1.5rem;
    bottom: -0.5rem;
    font-style: normal;
    line-height: 1;
}

.quote-parchment .quote-author {
    font-size: 0.95rem;
    font-style: normal;
    color: var(--liturgical-purple);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.quote-parchment .quote-author::before,
.quote-parchment .quote-author::after {
    content: '—';
    color: var(--accent-gold);
}

/* === CARTES STYLE CATHOLIQUE === */
.card-catholic {
    border-top: 3px solid var(--accent-gold);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(201, 162, 39, 0.1);
}

.card-catholic .card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--marian-blue) 100%);
    border-bottom: 2px solid var(--accent-gold);
}

.card-catholic .card-header h2,
.card-catholic .card-header h3 {
    font-family: var(--font-liturgical);
    letter-spacing: 0.5px;
}

/* === SÉPARATEUR DÉCORATIF === */
.divider-ornate {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--spacing-xl) 0;
    color: var(--accent-gold);
}

.divider-ornate::before,
.divider-ornate::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent-gold), transparent);
}

.divider-ornate .divider-icon {
    padding: 0 var(--spacing-md);
    font-size: 1.2rem;
}

/* === HEADER AMÉLIORÉ CATHOLIQUE === */
.header-catholic {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--marian-blue) 50%, var(--primary) 100%);
}

.header-catholic::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent-gold) 20%,
        var(--accent-gold-light) 50%,
        var(--accent-gold) 80%,
        transparent 100%
    );
}

.header-catholic .library-title {
    font-family: var(--font-liturgical);
    letter-spacing: 1px;
}

/* === LETTRINES DÉCORATIVES === */
.lettrine {
    float: left;
    font-family: var(--font-liturgical);
    font-size: 3.5rem;
    line-height: 0.8;
    padding-right: var(--spacing-sm);
    padding-top: var(--spacing-xs);
    color: var(--liturgical-purple);
    text-shadow: 2px 2px 0 var(--accent-gold-pale);
}

/* === BOUTON STYLE LITURGIQUE === */
.btn-liturgical {
    background: linear-gradient(135deg, var(--liturgical-purple) 0%, var(--liturgical-purple-light) 100%);
    color: var(--white);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-liturgical::before {
    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;
}

.btn-liturgical:hover::before {
    left: 100%;
}

.btn-liturgical:hover {
    background: linear-gradient(135deg, var(--liturgical-purple-light) 0%, var(--liturgical-purple) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 35, 90, 0.4);
}

/* === BADGES LITURGIQUES === */
.badge-liturgical {
    background: var(--liturgical-purple);
    color: var(--white);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.badge-marian {
    background: var(--marian-blue);
    color: var(--white);
}

.badge-gold {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    color: var(--primary-dark);
}

/* === VITRAIL SUBTIL EN FOND === */
.vitrail-bg {
    position: relative;
}

.vitrail-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(201, 162, 39, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(30, 58, 95, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(74, 35, 90, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.vitrail-bg > * {
    position: relative;
    z-index: 1;
}

/* === RESPONSIVE POUR ÉLÉMENTS CATHOLIQUES === */
@media (max-width: 768px) {
    .quote-parchment {
        padding: var(--spacing-lg);
    }

    .quote-parchment .quote-text::before,
    .quote-parchment .quote-text::after {
        font-size: 2rem;
    }

    .lettrine {
        font-size: 2.5rem;
    }

    .ornate-border::before,
    .ornate-border::after {
        font-size: 0.8rem;
    }
}

/* === IMPRESSION === */
@media print {
    .header,
    .nav,
    .footer,
    .btn,
    .pagination,
    .toast-container {
        display: none;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--light-gray);
    }
}
