/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f6f5f7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.library-nav {
    background: linear-gradient(to right, #ffffff, #f8f9fa);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
    border-bottom: 2px solid #e84c0e;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo-img {
    height: 45px;
    width: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.nav-logo-img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-link {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: #e84c0e;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover {
    color: #e84c0e;
}

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

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.5rem 1rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .nav-link {
        font-size: 0.95rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
    }

    .nav-logo-img {
        height: 40px;
    }
}

/* Main Content */
.library-main {
    margin-top: 80px;
    flex: 1;
    padding: 20px;
}

/* Footer */
.library-footer {
    background: #333;
    color: white;
    padding: 20px 0;
    margin-top: auto;
}

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

/* Conteneur principal de la bibliothèque */
.library-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Poppins', sans-serif;
}

.library-header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(to right, #dc5507, #e84c0e);
    color: white;
    padding: 40px 20px;
    border-radius: 10px;
}

.library-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.library-header h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.library-header h3 {
    font-size: 1.5em;
}

.library-presentation {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.library-presentation h2 {
    color: #e84c0e;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.library-description p {
    line-height: 1.8;
    color: #444;
    margin-bottom: 30px;
}

.library-stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.library-stats h3 {
    color: #e84c0e;
    margin-bottom: 20px;
}

.library-features ul {
    list-style: none;
    padding: 0;
}

.library-features li {
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-left: 4px solid #e84c0e;
    border-radius: 0 8px 8px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.service-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card i {
    font-size: 2em;
    color: #e84c0e;
    margin-bottom: 15px;
}

.service-card h4 {
    color: #333;
    margin-bottom: 10px;
}

.service-card p {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Styles pour le tableau de statistiques */
.stats-container {
    overflow-x: auto;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.stats-table th,
.stats-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.stats-table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
}

.stats-table td {
    color: #666;
}

.stats-table tbody tr:hover {
    background-color: #f8f9fa;
}

.stats-table tbody tr td:first-child {
    font-weight: 600;
    color: #e84c0e;
}

.stats-table tbody tr td:last-child {
    font-weight: 600;
    color: #333;
}

/* Style pour les cellules numériques */
.stats-table td:nth-child(4),
.stats-table td:nth-child(5),
.stats-table td:nth-child(6),
.stats-table td:nth-child(7) {
    text-align: right;
}

/* Style pour l'en-tête des colonnes numériques */
.stats-table th:nth-child(4),
.stats-table th:nth-child(5),
.stats-table th:nth-child(6),
.stats-table th:nth-child(7) {
    text-align: right;
}

/* Responsive design pour le tableau */
@media (max-width: 768px) {
    .stats-container {
        margin: 10px -20px;
        border-radius: 0;
    }
    
    .stats-table {
        font-size: 14px;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 8px 10px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .library-header h1 {
        font-size: 1.8em;
    }

    .library-header h2 {
        font-size: 1.4em;
    }

    .library-header h3 {
        font-size: 1.2em;
    }

    .library-presentation {
        padding: 20px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .library-main {
        margin-top: 140px;
    }
}

/* Styles pour la page des journaux */
.journals-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Section des filtres */
.filters-section {
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-bar input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.search-bar button {
    padding: 0 20px;
    background: #e84c0e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #d44000;
}

.filters {
    display: flex;
    gap: 15px;
}

.filters select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-width: 150px;
}

/* Grille des journaux */
.journals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.journal-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 520px; /* Hauteur fixe pour uniformité */
}

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

.journal-image {
    position: relative;
    height: 350px; /* Hauteur fixe pour la zone PDF */
    background: #f8f9fa;
    overflow: hidden;
}

.journal-image embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Empêche l'interaction avec le PDF dans la carte */
}

.journal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.journal-card:hover .journal-overlay {
    opacity: 1;
}

.preview-btn {
    padding: 12px 24px;
    background: white;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-btn:hover {
    background: #e84c0e;
    color: white;
    transform: scale(1.05);
}

.journal-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.journal-info h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.journal-date {
    color: #666;
    font-size: 0.95em;
    margin: 0;
}

.journal-stats {
    display: flex;
    gap: 15px;
    color: #666;
    font-size: 0.9em;
    margin-top: auto;
}

.journal-stats i {
    color: #e84c0e;
    margin-right: 5px;
}

.journal-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.action-btn {
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

/* Modal d'aperçu amélioré */
.preview-modal .modal-content {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
}

.preview-modal .modal-body {
    padding: 0;
    height: 80vh;
    display: block;
}

.preview-modal .preview-image {
    height: 100%;
    background: #f8f9fa;
    border-radius: 0;
}

.preview-modal embed {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .journals-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .journal-card {
        height: 480px;
    }

    .journal-image {
        height: 300px;
    }

    .journal-info {
        padding: 15px;
    }

    .journal-actions {
        grid-template-columns: 1fr;
    }

    .preview-modal .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .journal-card {
        height: 450px;
    }

    .journal-image {
        height: 250px;
    }
}

/* Notifications */
.notifications-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.notifications-container {
    width: 300px;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
}

.notification i {
    margin-right: 12px;
    font-size: 1.2em;
}

.notification.success {
    border-left: 4px solid #48bb78;
}

.notification.success i {
    color: #48bb78;
}

.notification.info {
    border-left: 4px solid #4299e1;
}

.notification.info i {
    color: #4299e1;
}

.notification .notification-message {
    flex: 1;
    margin-right: 10px;
}

.notification .close-notification {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    font-size: 1.1em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification .close-notification:hover {
    opacity: 1;
}

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

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.close-modal:hover {
    color: #333;
}

/* Feedback Specific Styles */
.rating {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.star {
    font-size: 24px;
    cursor: pointer;
    color: #ecc94b;
    transition: transform 0.2s;
}

.star:hover {
    transform: scale(1.2);
}

.star i {
    transition: color 0.2s;
}

textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 100px;
}

.submit-feedback {
    width: 100%;
    padding: 12px;
    background: #e84c0e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.submit-feedback:hover {
    background: #d44000;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination-btn {
    padding: 8px 15px;
    border: none;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: background 0.3s;
}

.pagination-btn:hover {
    background: #f8f9fa;
}

.page-number {
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.page-number.active {
    background: #e84c0e;
    color: white;
}

.page-number:hover:not(.active) {
    background: #f8f9fa;
}

.page-dots {
    color: #666;
}

/* Modal d'aperçu */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
}

.preview-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #666;
    font-size: 1.5em;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #333;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0 0 5px;
    color: #333;
}

.modal-header p {
    color: #666;
    margin: 0;
}

.modal-body {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.preview-image {
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: auto;
}

.preview-info h3 {
    margin: 0 0 15px;
    color: #333;
}

.preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.preview-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.preview-list li:last-child {
    border-bottom: none;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .journal-actions {
        grid-template-columns: 1fr;
    }

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

/* Styles pour les modals */
.preview-modal,
.audio-modal,
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
}

.preview-modal.show,
.audio-modal.show,
.share-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Audio Player */
.audio-player {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.player-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #e84c0e;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-btn:hover {
    background: #d44000;
    transform: scale(1.05);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-control input[type="range"] {
    width: 100px;
}

.reading-progress {
    text-align: center;
}

.progress-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    margin: 10px 0;
    position: relative;
}

#progressFill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #e84c0e;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Share Modal */
.share-options {
    margin-bottom: 20px;
}

.share-options input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
}

.social-share {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.social-btn {
    padding: 12px;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.social-btn:hover {
    opacity: 0.9;
}

.social-btn.facebook {
    background: #1877f2;
}

.social-btn.twitter {
    background: #1da1f2;
}

.social-btn.linkedin {
    background: #0a66c2;
}

.social-btn.whatsapp {
    background: #25d366;
}

/* Responsive Design pour les modals */
@media (max-width: 768px) {
    .social-share {
        grid-template-columns: 1fr;
    }

    .audio-controls {
        flex-direction: column;
    }

    .volume-control {
        width: 100%;
    }

    .volume-control input[type="range"] {
        width: 100%;
    }
}

/* Feedback Modal */
.feedback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-modal.show {
    display: flex;
    opacity: 1;
}

.feedback-modal .modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    margin: auto;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.feedback-modal.show .modal-content {
    transform: translateY(0);
}

.feedback-modal .modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.feedback-modal h2 {
    margin: 0;
    color: #2d3748;
    font-size: 1.5em;
}

.feedback-modal .rating {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.feedback-modal .star {
    font-size: 1.8em;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: #ecc94b;
}

.feedback-modal .star:hover {
    transform: scale(1.2);
}

.feedback-modal textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 20px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.feedback-modal .submit-feedback {
    width: 100%;
    padding: 12px;
    background: #e84c0e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s ease;
}

.feedback-modal .submit-feedback:hover {
    background: #d44000;
}

.feedback-modal .close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.2em;
    color: #718096;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.feedback-modal .close-modal:hover {
    color: #2d3748;
}

/* Suggestions */
.suggestions-container {
    margin: 20px auto;
    max-width: 1200px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.suggestions-container h3 {
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestions-container h3 i {
    color: #ecc94b;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.suggestion-card {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.suggestion-card:hover {
    transform: translateY(-2px);
}

.suggestion-card h4 {
    margin: 0 0 10px 0;
    color: #2d3748;
}

.suggestion-card p {
    color: #718096;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.view-suggestion {
    background: #e84c0e;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.view-suggestion:hover {
    background: #d44000;
}
