/* Style des cartes de fonctionnalités */
.features.card {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(145deg, #ffffff, #f5f7ff);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    overflow: hidden;
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    perspective: 1000px;
    isolation: isolate;
}

.features.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 0 0, var(--primary-color) 0%, transparent 50%),
        radial-gradient(circle at 100% 0, var(--primary-color) 0%, transparent 50%),
        radial-gradient(circle at 0 100%, var(--primary-color) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, var(--primary-color) 0%, transparent 50%);
    background-size: 100px 100px;
    background-position: 0 0, 100% 0, 0 100%, 100% 100%;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    mix-blend-mode: overlay;
}

.features.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: transparent;
    background: linear-gradient(145deg, #ffffff, #f5f7ff);
}

.features.card:hover::before {
    opacity: 0.1;
}

.features.card::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        /* Coin supérieur gauche - Design abstrait */
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0C0 30 5 35 35 35L35 0L0 0Z' fill='%23f3f4f6' fill-opacity='0.8'/%3E%3Cpath d='M0 0C0 40 8 48 48 48L48 0L0 0Z' fill='%23f3f4f6' fill-opacity='0.4'/%3E%3Ccircle cx='15' cy='15' r='3' fill='var(--primary-color)' fill-opacity='0.4'/%3E%3C/svg%3E"),
        /* Coin supérieur droit - Motif géométrique */
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M100 0C70 0 65 5 65 35L100 35L100 0Z' fill='%23f3f4f6' fill-opacity='0.8'/%3E%3Cpath d='M100 0L100 48C60 48 52 40 52 0L100 0Z' fill='%23f3f4f6' fill-opacity='0.4'/%3E%3Cpath d='M85 15L95 15L90 25Z' fill='var(--primary-color)' fill-opacity='0.4'/%3E%3C/svg%3E"),
        /* Coin inférieur gauche - Vagues */
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 100C30 100 35 95 35 65L0 65L0 100Z' fill='%23f3f4f6' fill-opacity='0.8'/%3E%3Cpath d='M0 100C40 100 48 92 48 52L0 52L0 100Z' fill='%23f3f4f6' fill-opacity='0.4'/%3E%3Cpath d='M10 75Q15 85 20 75Q25 65 30 75' stroke='var(--primary-color)' stroke-width='2' stroke-opacity='0.4' fill='none'/%3E%3C/svg%3E"),
        /* Coin inférieur droit - Points connectés */
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M100 100C70 100 65 95 65 65L100 65L100 100Z' fill='%23f3f4f6' fill-opacity='0.8'/%3E%3Cpath d='M100 100C60 100 52 92 52 52L100 52L100 100Z' fill='%23f3f4f6' fill-opacity='0.4'/%3E%3Ccircle cx='75' cy='75' r='2' fill='var(--primary-color)' fill-opacity='0.4'/%3E%3Ccircle cx='85' cy='85' r='2' fill='var(--primary-color)' fill-opacity='0.4'/%3E%3Cline x1='75' y1='75' x2='85' y2='85' stroke='var(--primary-color)' stroke-opacity='0.4'/%3E%3C/svg%3E");
    background-position: 0 0, 100% 0, 0 100%, 100% 100%;
    background-repeat: no-repeat;
    background-size: 60px;
    z-index: -1;
    opacity: 0;
    transition: all 0.5s ease;
}

.features.card:hover::after {
    opacity: 1;
    animation: cornerRotate 3s ease-in-out infinite;
}

/* Style de base de l'hexagone */
.hexagon-wrapper {
    margin: auto;
    display: flex;
    text-align: initial;
    width: 200px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.counter-icon.hexagon {
    position: relative;
    width: 20%;
    height: 35%;
    margin: 0 auto;
    color: white;
    display: flex;
    align-content: center;
    justify-content: center;
    transition: 0.5s;
    border-radius: 5px;
    background: var(--primary-color);
    transform-style: preserve-3d;
    transform: translateZ(20px);
}

.counter-icon.hexagon i {
    z-index: 1;
    margin: auto;
    font-size: 30px;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    padding: 18px;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

/* Effet hexagone avec pseudo-éléments */
.counter-icon.hexagon:before,
.counter-icon.hexagon:after {
    position: absolute;
    content: "";
    background: inherit;
    height: 100%;
    width: 100%;
    border-radius: 0;
    transition: 0.5s;
    transform-origin: center;
}

.counter-icon.hexagon:before {
    transform: rotateZ(60deg);
    border-radius: 5px;
}

.counter-icon.hexagon:after {
    transform: rotateZ(-60deg);
    border-radius: 5px;
}

/* Classes spécifiques pour les différentes couleurs */
.main-features-1 .hexagon {
    background: var(--primary-color);
}

.main-features-2 .hexagon {
    background: forestgreen;
}

.main-features-3 .hexagon {
    background: rgba(var(--secondary-rgb), 1);
}

.main-features-4 .hexagon {
    background: rgb(var(--info-rgb));
}

.main-features-5 .hexagon {
    background: rgb(var(--secondary-rgb));
}

.main-features-6 .hexagon {
    background: rgb(var(--danger-rgb));
}

.main-features-7 .hexagon {
    background: var(--primary-color);
}

.main-features-8 .hexagon {
    background: rgb(var(--warning-rgb));
}

/* Effet de lueur au survol */
.hexagon-wrapper::after {
    content: '';
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.2) 0%,
            transparent 80%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.features.card:hover .hexagon-wrapper::after {
    opacity: 1;
}

/* Animation d'apparition */
@keyframes hexagonAppear {
    0% {
        transform: scale(0.5) rotate(-180deg) translateZ(0);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg) translateZ(20px);
        opacity: 1;
    }
}

.counter-icon.hexagon {
    animation: hexagonAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Style du contenu de la carte */
.counter-body {
    padding: 20px 10px;
}

.counter-body h4 {
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.counter-body p {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    transition: all 0.3s ease;
}

/* Effets de survol améliorés */
.features.card:hover .counter-icon.hexagon {
    transform: translateY(-5px) rotate(15deg) scale(1.1);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.25);
}

.features.card:hover .counter-icon.hexagon::before {
    opacity: 0.6;
    filter: blur(10px);
}

.features.card:hover .counter-icon.hexagon i {
    transform: scale(1.1);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive design pour les hexagones */
@media (max-width: 768px) {
    .hexagon-wrapper {
        width: 70px;
        height: 70px;
        margin-bottom: 25px;
    }

    .counter-icon.hexagon i {
        font-size: 28px;
    }
}

@media (max-width: 576px) {
    .hexagon-wrapper {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .counter-icon.hexagon i {
        font-size: 24px;
    }
}

/* Effet de glassmorphisme pour les cartes */
.features.card.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animation des icônes */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.counter-icon.hexagon:hover i {
    animation: pulse 1s infinite;
}

/* Animation des coins */
@keyframes cornerRotate {
    0% {
        background-size: 60px;
        opacity: 0.7;
    }

    25% {
        background-size: 65px;
        opacity: 0.9;
    }

    50% {
        background-size: 60px;
        opacity: 0.7;
    }

    75% {
        background-size: 55px;
        opacity: 0.5;
    }

    100% {
        background-size: 60px;
        opacity: 0.7;
    }
}

/* Animation des coins au survol avec GSAP */
.corner-animation {
    position: absolute;
    width: 30px;
    height: 30px;
    pointer-events: none;
}

.corner-top-left {
    top: 0;
    left: 0;
    border-top: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
    border-top-left-radius: 8px;
}

.corner-top-right {
    top: 0;
    right: 0;
    border-top: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    border-top-right-radius: 8px;
}

.corner-bottom-left {
    bottom: 0;
    left: 0;
    border-bottom: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
    border-bottom-left-radius: 8px;
}

.corner-bottom-right {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    border-bottom-right-radius: 8px;
}

/* Animation d'apparition progressive des coins */
@keyframes cornerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.features.card {
    animation: cornerFadeIn 0.5s ease-out forwards;
}