/* ============================================
   DOCUMENTS SECTION STYLES
   ============================================ */

.hp-documents {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef2f9 100%);
    padding: 4rem 0;
}

.hp-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.hp-document-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(122, 11, 11, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 350px;
}

.hp-document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(122, 11, 11, 0.15);
    border-color: #7A0B0B;
}

.hp-document-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(122, 11, 11, 0.1), rgba(8, 6, 107, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: #7A0B0B;
    flex-shrink: 0;
}

.hp-document-card h3 {
    color: #08066B;
    font-size: 1.3rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.hp-document-card p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-document {
    background: linear-gradient(135deg, #7A0B0B, #a01010);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
    text-decoration: none;
}

.btn-document:hover {
    background: linear-gradient(135deg, #5a0808, #7A0B0B);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(122, 11, 11, 0.3);
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.3s ease;
}

.modal-container.modal-lg {
    max-width: 1000px;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #08066B, #1a1a8f);
    color: white;
}

.modal-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

.fiche-image-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.fiche-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: zoom-in;
}

.fiche-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.image-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.image-viewer-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-viewer-img {
    width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.image-viewer-caption {
    margin-top: 1rem;
    color: #f4f4f4;
    font-size: 0.95rem;
    text-align: center;
    max-width: 90%;
}

.image-viewer-close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    color: #08066B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.image-viewer-close:hover {
    transform: scale(1.05);
}

.fiche-image-label {
    font-weight: 600;
    color: #08066B;
    font-size: 0.95rem;
    margin: 0;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    border-top: 2px solid #f0f0f0;
    background: #f8f9ff;
    justify-content: flex-end;
}

.btn-primary {
    background: linear-gradient(135deg, #7A0B0B, #a01010);
    color: white;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a0808, #7A0B0B);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(122, 11, 11, 0.3);
}

.btn-secondary {
    background: #e9ecef;
    color: #08066B;
    padding: 0.9rem 2rem;
    border: 2px solid #08066B;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #08066B;
    color: white;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .hp-documents-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hp-document-card {
        padding: 2rem;
        min-height: auto;
    }

    .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1.5rem;
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .fiche-images-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hp-document-card {
        padding: 1.5rem;
        min-height: 300px;
    }

    .hp-document-icon {
        width: 60px;
        height: 60px;
    }

    .hp-document-card h3 {
        font-size: 1.1rem;
    }

    .btn-document {
        font-size: 0.85rem;
        padding: 0.7rem 1.2rem;
    }
}

/* ============================================
   DOCUMENT CONTENT STYLES (for modals)
   ============================================ */

.modal-document-body {
    padding: 2.5rem !important;
}

.document-content {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.8;
    color: #333;
}

.document-content h3 {
    color: #08066B;
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.document-content h4 {
    color: #555;
    font-size: 1rem;
    margin-top: 1.2rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.document-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #555;
}

.document-content ul,
.document-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.document-content li {
    margin-bottom: 0.6rem;
    color: #555;
    line-height: 1.6;
}

.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.document-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.document-content table th,
.document-content table td {
    border: 1px solid #ddd;
    padding: 12px 10px;
    text-align: left;
    font-size: 0.9rem;
}

.document-content table th {
    background-color: #08066B;
    color: white;
    font-weight: 600;
}

.document-content table tr:nth-child(even) {
    background-color: #f8f9ff;
}

.document-content table tr:hover {
    background-color: #f0f0f0;
}

.fiche-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 0;
}

@media (max-width: 768px) {
    .modal-document-body {
        padding: 1.5rem !important;
    }

    .document-content h3 {
        font-size: 1.1rem;
    }

    .document-content h4 {
        font-size: 0.95rem;
    }

    .table-container {
        margin: 1rem 0;
    }

    .document-content table th,
    .document-content table td {
        padding: 8px 6px;
        font-size: 0.85rem;
    }
}
