/* Styles pour le footer */
.footer {
    background-color: #f8fafc;
    color: #4b5563;
    padding: 3rem 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.footer a {
    transition: color 0.2s ease-in-out;
}

.footer a:hover {
    color: #4f46e5;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-about {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .footer-about {
        grid-column: auto;
    }
}

.footer-logo {
    margin-bottom: 1.25rem;
}

.footer-logo img {
    height: 2.5rem;
    width: auto;
}

.footer-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 1.5rem;
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 2.5rem;
    height: 2px;
    background-color: #4f46e5;
}

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

.footer-links-list li {
    margin-bottom: 0.5rem;
}

/* Styles de base pour tous les liens du footer */
.footer-links-list a,
.footer-legal a.legal-link,
.footer-legal a.privacy-link {
    display: inline-block;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    padding: 0.25rem 0;
}

/* Effet de survol pour tous les liens du footer */
.footer-links-list a:hover,
.footer-legal a.legal-link:hover,
.footer-legal a.privacy-link:hover {
    color: #4f46e5;
    transform: translateX(4px);
}

/* Suppression de la transformation pour les liens légaux si nécessaire */
.footer-legal a.legal-link,
.footer-legal a.privacy-link {
    transform: none;
}

.footer-legal a.legal-link:hover,
.footer-legal a.privacy-link:hover {
    transform: none;
}

.footer-contact .contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.footer-contact .contact-icon {
    margin-right: 0.75rem;
    color: #4f46e5;
    margin-top: 0.25rem;
}

.footer-contact .contact-text {
    color: #4b5563;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.footer-contact a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-contact a:hover {
    color: #4f46e5;
}

.footer-bottom {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        text-align: left;
    }
}

.footer-copyright {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .footer-copyright {
        margin-bottom: 0;
    }
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .footer-legal {
        justify-content: flex-end;
    }
}

.footer-legal a {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.footer-legal a:hover {
    color: #4f46e5;
}

.footer-legal .separator {
    color: #d1d5db;
    user-select: none;
}

/* Styles pour le bouton de retour en haut */
.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #4f46e5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: none;
    outline: none;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.scroll-top-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5);
}

.scroll-top-btn i {
    font-size: 1.25rem;
}

/* Styles pour les modales légales */
#legal-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#legal-modal.hidden {
    display: none;
}

#legal-modal:not(.hidden) {
    display: flex;
    opacity: 1;
}

#legal-modal .modal-content {
    background-color: white;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 800px;
    margin: 2rem auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#legal-modal .modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#legal-modal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* Bouton de fermeture de la modale légale - Style Evensia Premium */
#legal-modal .close-modal {
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #4f46e5; /* --primary-blue */
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10010;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
    margin: 0;
    opacity: 0.9;
}

#legal-modal .close-modal:hover,
#legal-modal .close-modal:focus {
    color: white;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); /* --gradient-primary */
    border-color: transparent;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.15);
    opacity: 1;
}

#legal-modal .close-modal:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

#legal-modal .close-modal:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.3);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

/* Amélioration de l'accessibilité pour le focus clavier */
#legal-modal .close-modal:focus:not(:focus-visible) {
    outline: none;
}

/* Styles pour la modale - Harmonisation avec le thème Evensia */
#legal-modal {
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

#legal-modal [data-modal-content] {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-out;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#legal-modal:not(.hidden) [data-modal-content] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#legal-modal.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out 0.15s;
}

#legal-modal.hidden [data-modal-content] {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
}

/* En-tête de la modale */
#legal-modal .sticky.top-0 {
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

#legal-modal #modal-title {
    color: #2C3E50; /* --dark-blue */
    font-weight: 600;
    margin: 0;
}

/* Corps de la modale */
#legal-modal .flex-1 {
    background: white;
}

/* Pied de page de la modale */
#legal-modal .sticky.bottom-0 {
    background: #f8fafc; /* --light-gray */
    border-top: 1px solid #e2e8f0;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Bouton de fermeture dans le footer */
#legal-modal .sticky.bottom-0 .close-modal {
    position: static;
    background: #4f46e5; /* --primary-blue */
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    width: auto;
    height: auto;
    line-height: 1.5;
}

#legal-modal .sticky.bottom-0 .close-modal:hover {
    background: #4338ca; /* Une teinte plus foncée de primary-blue */
    transform: translateY(-1px);
}

#legal-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: 100%;
}

#legal-modal .modal-body-content {
    max-height: 100%;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar styling */
#legal-modal .modal-body-content::-webkit-scrollbar {
    width: 6px;
}

#legal-modal .modal-body-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#legal-modal .modal-body-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#legal-modal .modal-body-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#legal-modal .modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

#legal-modal .btn-close {
    background-color: #4f46e5;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#legal-modal .btn-close:hover {
    background-color: #4338ca;
}

/* Styles pour le contenu des mentions légales et CGU */
.legal-content {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #4b5563;
}

.legal-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.legal-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.legal-content p {
    margin-bottom: 1rem;
}

.legal-content ul, .legal-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

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

.legal-content a {
    color: #4f46e5;
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-content a:hover {
    color: #4338ca;
    text-decoration: underline;
}

/* Animation pour le bouton de retour en haut */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-top-btn.visible {
    animation: fadeInUp 0.3s ease forwards;
}

/* Responsive pour les petits écrans */
@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-about, .footer-links, .footer-contact {
        text-align: center;
    }
    
    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-legal {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .footer-legal .separator {
        display: none;
    }
    
    .scroll-top-btn {
        width: 2.5rem;
        height: 2.5rem;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .scroll-top-btn i {
        font-size: 1rem;
    }
}
