@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
    --primary-bg: #101820;
    --card-bg: #1c1f26;
    --text-color-services: #ffffff;
    --text-muted: #d1d5db;
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --border-radius: 16px;
    --shadow-light: 0px 6px 18px rgba(255, 255, 255, 0.1);
    --shadow-hover: 0px 10px 30px rgba(255, 255, 255, 0.25);
    --transition: all 0.6s ease-in-out;
    --highlight: #3b82f6;
}

/* 🌟 RESET */
* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden;
    /* color: var(--text-color-services); */
    scroll-behavior: smooth;
}

/* 📌 HEADER */
.services-header {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(-40px);
    animation: fadeIn 1.5s ease-out forwards;
}

.services-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-color-services);
}

.services-header p {
    font-size: 16px;
    color: var(--text-muted);
}

/* 📌 CONTAINER PRINCIPAL */
.services-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    max-width: 1200px;
    margin: auto;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

/* 🌟 Apparition fluide */
body.loaded .services-container {
    opacity: 1;
    transform: translateY(0);
}

/* 📌 CARTES */
.service-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    text-align: center;
    width: 320px;
    box-shadow: var(--shadow-light);
    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(50px);
}

/* 🌟 Apparition progressive fluide */
.service-card:nth-child(1) { animation: fadeInSmooth 1.8s 0.5s ease-out forwards; }
.service-card:nth-child(2) { animation: fadeInSmooth 1.8s 1s ease-out forwards; }
.service-card:nth-child(3) { animation: fadeInSmooth 1.8s 1.5s ease-out forwards; }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInSmooth {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 🖼 IMAGE */
.image-container {
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    position: relative;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

/* 🎭 OVERLAY */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    padding: 20px;
    text-align: center;
}

.image-overlay p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    max-width: 85%;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

/* 🖼 Effet de survol ultra fluide */
.image-container:hover img {
    opacity: 0.2;
    transform: scale(1.08);
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.image-container:hover .image-overlay p {
    opacity: 1;
    transform: translateY(0);
}

/* 📌 CONTENU */
.service-content {
    padding: 18px;
    text-align: center;
}

.service-content h3 {
    font-size: 16px;
    color: var(--text-color-services);
    font-weight: 600;
    transition: var(--transition);
}

.service-card:hover .service-content h3 {
    transform: scale(1.05);
}

/* 🌟 RESPONSIVE DESIGN */

/* 📱 TABLETTES */
@media (max-width: 992px) {
    .services-container {
        flex-wrap: wrap;
        gap: 20px;
    }

    .service-card {
        width: 90%;
        max-width: 400px;
    }

    .image-container {
        height: 300px;
    }
}

/* 📱 TÉLÉPHONES */
@media (max-width: 768px) {
    .services-container {
        flex-direction: column;
        align-items: center;
    }

    .service-card {
        width: 100%;
        max-width: 350px;
    }

    .image-container {
        height: 280px;
    }

    .service-content h3 {
        font-size: 14px;
    }

    .image-overlay p {
        font-size: 12px;
    }
}

/* 📱 PETITS ÉCRANS (max-width: 576px) */
@media (max-width: 576px) {
    .service-card {
        width: 100%;
        max-width: 320px;
    }

    .image-container {
        height: 250px;
    }

    .service-content h3 {
        font-size: 13px;
    }

    .image-overlay p {
        font-size: 11px;
    }
}
