:root {
    --primary-color: #2d3748;
    --green: #9bc53d;
    --bg-color: #f8f9fa;           /* Fond de page */
    --card-bg: #ffffff;            /* Fond des cartes */
    --text-light: #67758a;         /* Texte secondaire */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --footer-height: 50px;
}

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

html {
    scroll-behavior: smooth;
}

@font-face {
    font-family: "Ayuthaya";
    src: url('Ayuthaya.ttf');
}

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-color);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    padding-bottom: var(--footer-height);
    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%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232d3748' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 0 1rem 1rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 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='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.08' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 1;
}

header h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 4.5rem;
    color: var(--green);
    margin-bottom: 0.3rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    line-height: 1.3;
}

header p {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.resources-section {
    margin-bottom: 2rem;
}

.resources-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.resource-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.resource-image {
    height: 220px;
    overflow: hidden;
}

.resource-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.resource-card:hover .resource-image img {
    transform: scale(1.05);
}

.resource-content {
    padding: .75rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.resource-content h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    color: var(--primary-color);
}

.resource-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.resource-preview {
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.resource-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-details {
    padding: 0.6rem 1rem;
    background-color: var(--green);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-details:hover {
    background-color: var(--primary-color);
}

.btn-access {
    padding: 0.6rem 1rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.btn-access:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-access i {
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

/* 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;
    overflow: auto;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    position: relative;
    background-color: white;
    max-width: 800px;
    width: 100%;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

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

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--green);
}

#modalTitle {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.modal-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

#modalContent {
    margin-bottom: 1.5rem;
}

#modalContent p {
    margin-bottom: 1rem;
}

#modalContent ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    border-radius: 4px;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
}

.modal-btn:hover {
    color: var(--green);
}

.modal-btn i {
    margin-right: 0.5rem;
}

body.modal-open {
    overflow: hidden;
}

/* Footer */
footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--footer-height);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    text-align: center;
    padding: 0 .5rem;
    background-color: var(--primary-color);
    color: white;
    z-index: 100;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 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='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: 0;
}

footer span, footer a {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
    color: var(--green);
}

.separator {
    margin: 0 0.75rem;
}

.license-part {
    margin: 0 0.5rem;
}

.contact-part a {
    margin-left: 4px;
}

.mobile-text {
    display: none;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Media Queries */
@media (max-width: 1024px) {
    .resources-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: .5rem 1rem;
    }  

    header h1 {
        font-size: 3rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .resources-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }

    footer {
        flex-wrap: wrap;
        justify-content: center;
        padding: .4rem 0;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 0 1rem;
    }
}

/* Ajustements pour le footer à 730px */
@media (max-width: 734px) {
    :root {
        --footer-height: 50px; /* Hauteur pour deux lignes */
        --buttons-height: 67px;
    }
    
    footer {
        flex-wrap: wrap; /* Permet le retour à la ligne */
        justify-content: center;
        padding: .4rem 0;
    }
    
    .copyright-part {
        flex-basis: 100%; /* Force le passage à la ligne suivante */
        text-align: center;
    }
    
    /* Cache le premier séparateur */
    .copyright-part + .separator {
        display: none;
    }
    
    /* Centre les éléments de la seconde ligne */
    .license-part, .contact-part, .license-part + .separator {
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 576px) { 
    header h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    main {
        padding: 1.5rem 1rem 4rem;
    }
    
    .resources-container {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .resource-image {
        height: 160px;
    }
    
    .resource-actions {
        flex-direction: column;
    }
    
    .btn-details, .btn-access {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    #modalTitle {
        font-size: 1.5rem;
    }
    
    .modal-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 405px) {
    footer {
        display: block;
        padding: .4rem 0;
        text-align: center;
    }

    .copyright-part {
        display: block;
        width: 100%;
    }
    
    .license-part, .contact-part {
        display: inline-block;
    }
    
    .separator {
        display: none !important;
        margin: 0;
    }
    
    .license-part + .separator {
        display: inline-block !important;
    }
    
    .contact-part .contact-text, 
    .contact-part .email-text {
        display: none;
    }
    
    .contact-part .mobile-text {
        display: inline;
    }
}