/* Import OpenDyslexic font */
@import url('https://fonts.googleapis.com/css2?family=OpenDyslexic:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    transition: font-family 0.3s ease;
}

/* Police OpenDyslexic active */
body.dyslexic-font {
    font-family: 'OpenDyslexic', 'Arial', sans-serif;
}

/* S'assurer que le contenu du livre hérite de la police du body */
body:not(.dyslexic-font) .texte-content {
    font-family: 'Georgia', 'Times New Roman', serif;
}

body.dyslexic-font .texte-content {
    font-family: 'OpenDyslexic', 'Arial', sans-serif;
    line-height: 2.0;
    letter-spacing: 0.02em;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

#app {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 70vh;
}

/* Utilitaires */
.hidden {
    display: none !important;
}

.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    color: #666;
}

/* Bibliothèque */
.bibliotheque {
    animation: fadeIn 0.5s ease-in-out;
}

.bibliotheque-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.bibliotheque-header h2 {
    color: #2c3e50;
    margin: 0;
}

.bibliotheque-stats {
    color: #7f8c8d;
    font-size: 0.9rem;
    background-color: #ecf0f1;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.bibliotheque-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-container {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-container input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-container input:focus {
    border-color: #3498db;
}

.btn-clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
}

.btn-clear-search:hover {
    background-color: #f0f0f0;
    color: #e74c3c;
}

.view-toggles {
    display: flex;
    gap: 0.5rem;
}

.btn-view {
    background-color: #ecf0f1;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.btn-view.active {
    background-color: #3498db;
    color: white;
}

.btn-view:hover:not(.active) {
    background-color: #bdc3c7;
}

/* Bouton police dyslexique */
.font-toggle.active {
    background-color: #9b59b6;
    color: white;
}

.font-toggle:hover:not(.active) {
    background-color: #d1c4e9;
}

.livres-loading {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.livres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-in-out;
}

.livres-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.livre-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.livre-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.livre-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.livre-card:hover::before {
    opacity: 1;
}

.livre-card-header {
    margin-bottom: 1rem;
}

.livre-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.livre-card-meta {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.livre-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.8;
}

.livre-progress-mini {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 6px;
    width: 100px;
    overflow: hidden;
}

.livre-progress-mini .progress-fill {
    height: 100%;
    background-color: #f39c12;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.list-view .livre-card {
    flex-direction: row;
    align-items: center;
    min-height: 100px;
    padding: 1.5rem;
}

.list-view .livre-card-header {
    flex-grow: 1;
    margin-bottom: 0;
    margin-right: 1rem;
}

.list-view .livre-card-footer {
    flex-shrink: 0;
}

.bibliotheque-vide {
    text-align: center;
    padding: 4rem 2rem;
    color: #7f8c8d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.bibliotheque-vide h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

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

/* Interface de lecture - Plein écran */
.lecteur {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* Onglet pour faire descendre la navigation */
.nav-tab {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 30px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    backdrop-filter: blur(10px);
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 1002;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    opacity: 1;
}

/* Cacher l'onglet quand nécessaire */
.nav-tab.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-100%);
}

.nav-tab:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    height: 35px;
}

.nav-tab-indicator {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.nav-tab:hover .nav-tab-indicator {
    color: white;
    transform: scale(1.2);
}

/* Barre de navigation minimaliste auto-hide */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1001;
    height: 60px;
    transition: all 0.3s ease;
    color: white;
}

.top-nav.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-center {
    flex: 1;
    text-align: center;
    margin: 0 1rem;
    overflow: hidden;
}

.nav-center h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: white;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Bouton audio spécifique */
.audio-btn.playing {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
    color: #4CAF50;
}

.audio-btn.loading {
    opacity: 0.6;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.9; }
    100% { opacity: 0.6; }
}

.page-info {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 50px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.page-select-mini {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    width: 45px;
    text-align: center;
}

.page-select-mini:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

.page-select-mini option {
    background: #333;
    color: white;
}

.livre-info {
    flex-grow: 1;
    text-align: center;
    margin: 0 1rem;
}

.livre-progress {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    background-color: #ecf0f1;
    border-radius: 10px;
    height: 8px;
    width: 200px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.btn-retour {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-retour:hover {
    background-color: #7f8c8d;
}

#livre-titre {
    color: #ffffff;
    flex-grow: 1;
    text-align: center;
    margin: 0;
}

.page-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.page-indicator {
    background-color: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.page-selector {
    position: relative;
}


.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;
}

/* Layout livre ouvert - Responsive automatique */
.livre-ouvert {
    display: flex;
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
    background-color: #ffffff;
    height: 100vh;
    width: 100vw;
}

/* Mode paysage : côte à côte */
@media (orientation: landscape) {
    .livre-ouvert {
        flex-direction: row;
    }
    
    .page-image,
    .page-texte {
        flex: 1;
        width: 50vw;
        height: 100vh;
    }
}

/* Mode portrait : empilé */
@media (orientation: portrait) {
    .livre-ouvert {
        flex-direction: column;
    }
    
    .page-image,
    .page-texte {
        flex: 1;
        width: 100vw;
        height: 50vh;
    }
}

.page-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.5rem;
    overflow: hidden;
}

.page-image img {
    max-width: calc(100% - 1rem);
    max-height: calc(100% - 1rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.95);
}

.page-image img.loaded {
    opacity: 1;
    transform: scale(1);
}

.page-image img.loaded:hover {
    transform: scale(1.02);
}

/* Placeholder de chargement d'image */
.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(100% - 1rem);
    height: calc(100% - 1rem);
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: 8px;
    color: #999;
    font-size: 1.1rem;
    animation: shimmerPlaceholder 2s infinite linear;
    border: 2px dashed #ddd;
}

.image-placeholder .placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.image-placeholder .placeholder-text {
    font-weight: 500;
    text-align: center;
}

@keyframes shimmerPlaceholder {
    0% {
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    }
    100% {
        background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px;
    }
}

.page-texte {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 0;
    overflow: hidden;
}

.texte-content {
    position: relative;
    padding: 3rem;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #2c3e50;
    font-family: inherit;
    background-color: #ffffff;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    
    /* Scrollbar personnalisée */
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 152, 219, 0.3) transparent;
}

.texte-content::-webkit-scrollbar {
    width: 8px;
}

.texte-content::-webkit-scrollbar-track {
    background: transparent;
}

.texte-content::-webkit-scrollbar-thumb {
    background-color: rgba(52, 152, 219, 0.3);
    border-radius: 10px;
    border: 2px solid transparent;
}

.texte-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(52, 152, 219, 0.5);
}

.texte-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
    text-indent: 2rem;
    hyphens: auto;
}

.texte-content p:first-child {
    margin-top: 0;
    text-indent: 0;
}

.texte-content p:last-child {
    margin-bottom: 0;
}

/* Styles pour le contenu markdown */
.texte-content h1,
.texte-content h2,
.texte-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.texte-content h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.texte-content h2 {
    font-size: 1.5rem;
}

.texte-content h3 {
    font-size: 1.3rem;
}

.texte-content strong {
    color: #e74c3c;
    font-weight: bold;
}

.texte-content em {
    font-style: italic;
    color: #8e44ad;
}

.texte-content ul,
.texte-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.texte-content li {
    margin-bottom: 0.5rem;
}

.texte-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background-color: #ecf0f1;
    border-left: 4px solid #3498db;
    font-style: italic;
}

.texte-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Forcer tout le texte markdown en noir */
.texte-content *,
.texte-content h1,
.texte-content h2,
.texte-content h3,
.texte-content strong,
.texte-content em {
    color: black !important;
}

/* Indicateur de scroll */
.scroll-indicator {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(128, 128, 128, 0.4);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.4rem;
    border-radius: 50%;
    font-size: 0.8rem;
    opacity: 0.5;
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 32px;
    height: 32px;
}

.scroll-indicator:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.scroll-arrow {
    font-size: 1rem;
    animation: bounce 2s infinite;
    line-height: 1;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Styles supprimés - navigation maintenant dans top-nav */

/* Messages d'erreur */
.error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #e74c3c;
    color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 400px;
    text-align: center;
}

.error-message::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.btn-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.error-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.error-action-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.error-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Mode plein écran natif du navigateur */
.lecteur:fullscreen {
    background-color: #000;
}

.lecteur:fullscreen .livre-ouvert {
    background-color: #111;
    margin-top: 0;
    margin-bottom: 0;
    height: 100vh;
}

.lecteur:fullscreen .top-nav {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.lecteur:fullscreen .texte-content {
    background-color: #222 !important;
    color: #ffffff !important;
}

.lecteur:fullscreen .texte-content p {
    color: #ffffff !important;
}

.lecteur:fullscreen .texte-content div {
    color: #ffffff !important;
}

.lecteur:fullscreen .texte-content span {
    color: #ffffff !important;
}

/* Police en mode fullscreen */
body:not(.dyslexic-font) .lecteur:fullscreen .texte-content {
    font-family: 'Georgia', 'Times New Roman', serif;
}

body.dyslexic-font .lecteur:fullscreen .texte-content {
    font-family: 'OpenDyslexic', 'Arial', sans-serif;
    line-height: 2.0;
    letter-spacing: 0.02em;
}

/* Styles markdown en mode fullscreen */
.lecteur:fullscreen .texte-content h1,
.lecteur:fullscreen .texte-content h2,
.lecteur:fullscreen .texte-content h3 {
    color: #ffffff !important;
}

.lecteur:fullscreen .texte-content h1 *,
.lecteur:fullscreen .texte-content h2 *,
.lecteur:fullscreen .texte-content h3 *,
.lecteur:fullscreen .texte-content p *,
.lecteur:fullscreen .texte-content div * {
    color: inherit !important;
}

.lecteur:fullscreen .texte-content h1 {
    border-bottom-color: #3498db;
}


.lecteur:fullscreen .texte-content blockquote {
    background-color: #333;
    color: #ffffff !important;
    border-left-color: #3498db;
}

.lecteur:fullscreen .texte-content blockquote * {
    color: #ffffff !important;
}

.lecteur:fullscreen .texte-content code {
    background-color: #333;
}

/* Règle universelle pour tout le texte en mode plein écran */
.lecteur:fullscreen .texte-content,
.lecteur:fullscreen .texte-content * {
    color: #ffffff !important;
}

.lecteur:fullscreen .page-image {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.lecteur:fullscreen .page-texte {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

/* Ajustements pour les modes paysage/portrait en plein écran */
@media (orientation: landscape) {
    .lecteur:fullscreen .page-image,
    .lecteur:fullscreen .page-texte {
        height: 100vh;
    }
}

@media (orientation: portrait) {
    .lecteur:fullscreen .page-image,
    .lecteur:fullscreen .page-texte {
        height: 50vh;
    }
}

/* S'assurer que la bibliothèque n'est pas affectée */
.bibliotheque {
    position: relative;
    width: 100%;
    height: auto;
    background-color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    #app {
        padding: 1rem;
    }
    
    .lecteur-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .livre-ouvert {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
        min-height: auto;
    }
    
    .page-image {
        order: 1;
        min-height: 300px;
    }
    
    .page-texte {
        order: 2;
        min-height: 200px;
    }
    
    .texte-content {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .navigation {
        gap: 1rem;
    }
    
    .btn-nav {
        padding: 0.8rem 1.5rem;
        min-width: 120px;
        font-size: 0.9rem;
    }
    
    .livres-list {
        flex-direction: column;
        align-items: center;
    }
    
    .livre-card {
        min-width: 280px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .navigation {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .btn-nav {
        width: 100%;
        max-width: 200px;
    }
    
    .livre-card {
        min-width: 250px;
        padding: 1.2rem 1.5rem;
    }
    
    .error-message {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}