/* Ajustement de la section services */
#services {
    position: relative;
    min-height: 100vh;
    padding: 80px 0 40px 0;
    overflow: visible;
}

.services-scroll-container {
    position: absolute;
    top: 5%;
    left: 0;
    width: 100%;
    overflow: hidden;
    z-index: 0;
    transform: scaleY(2);
    pointer-events: none;
}

.services-background-text {
    display: inline-block;
    font-size: 4.5vw;
    font-weight: 1000;
    color: rgba(34, 114, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: -1px;
    white-space: nowrap;
    font-family: 'ImpactWeb', Impact, Arial, sans-serif;
    animation: scroll-text 60s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.services-background-text.reverse {
    animation: scroll-text-reverse 60s linear infinite;
    color: transparent;
    -webkit-text-stroke: 1px rgba(34, 114, 255, 0.3);
}

@keyframes scroll-text {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes scroll-text-reverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Contenu de la section */
.services-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 45px;
    padding: 0 20px;
}

/* Wrapper pour les cartes */
.services-cards-wrapper {
    position: relative;
    width: 100%;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    perspective: 2000px;
    gap: 0;
}

/* ── Boutons flèches ───────────────────────────────────────────── */
.cards-arrow-button {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.25);
    z-index: 10;
    position: relative;
    /* small horizontal margin so arrows are outside the stack */
    margin: 0 12px;
}

.cards-arrow-button svg {
    width: 22px;
    height: 22px;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s ease, transform 0.2s ease;
}

.cards-arrow-button:hover {
    background: linear-gradient(135deg,
        rgba(34, 114, 255, 0.45) 0%,
        rgba(34, 114, 255, 0.25) 100%);
    border-color: rgba(34, 114, 255, 0.7);
    box-shadow:
        0 10px 36px rgba(34, 114, 255, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.cards-arrow-button:hover svg {
    stroke: #fff;
}

.cards-arrow-button:active {
    transform: scale(0.95);
}

.cards-arrow-button:disabled,
.cards-arrow-button.disabled {
    opacity: 0.25;
    pointer-events: none;
    cursor: default;
}

/* Icône flèches animées sur la carte d'intro */
.arrows-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.arrow-left-anim {
    animation: nudge-left 1.8s ease-in-out infinite;
}

.arrow-right-anim {
    animation: nudge-right 1.8s ease-in-out infinite;
}

@keyframes nudge-left {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50%       { transform: translateX(-6px); opacity: 1; }
}

@keyframes nudge-right {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50%       { transform: translateX(6px); opacity: 1; }
}

/* ── Compteur de cartes ───────────────────────────────────────── */
.cards-counter {
    text-align: center;
    font-family: 'ImpactWeb', Impact, Arial, sans-serif;
    font-size: 0.85em;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: -30px; /* pull up closer to the stack */
    user-select: none;
}

/* Stack de cartes avec effet 3D */
.services-cards-stack {
    position: relative;
    width: 85%;
    max-width: 750px;
    height: 380px;
    margin: 0 auto;
    transform-style: preserve-3d;
}

.service-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0.18) 50%,
            rgba(34, 114, 255, 0.12) 100%);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
    transform-style: preserve-3d;
}

/* Effet de lumière animé sur les cartes */
.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.15) 50%,
            transparent 70%);
    transform: rotate(45deg);
    animation: shimmer 8s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% {
        transform: rotate(45deg) translateX(-100%);
        opacity: 0;
    }
    40%, 60% { opacity: 1; }
    50% { transform: rotate(45deg) translateX(100%); }
}

/* Décalage initial pour l'effet de pile 3D */
.service-card[data-index="0"] {
    transform: translateY(0px) translateZ(0px) scale(1);
    z-index: 4;
    opacity: 1;
}
.service-card[data-index="1"] {
    transform: translateY(12px) translateZ(-80px) scale(0.97);
    z-index: 3;
    opacity: 0.9;
    filter: brightness(0.95);
}
.service-card[data-index="2"] {
    transform: translateY(24px) translateZ(-160px) scale(0.94);
    z-index: 2;
    opacity: 0.85;
    filter: brightness(0.9);
}
.service-card[data-index="3"] {
    transform: translateY(36px) translateZ(-240px) scale(0.91);
    z-index: 1;
    opacity: 0.8;
    filter: brightness(0.85);
}

/* Hover effect sur la carte principale */
.service-card[data-index="0"]:hover {
    transform: translateY(-8px) translateZ(16px) scale(1.02);
    box-shadow:
        0 25px 80px rgba(34, 114, 255, 0.25),
        0 10px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
    border-color: rgba(34, 114, 255, 0.4);
}





@keyframes cardSwipeBack {
    0% {
        
        opacity: 0;
        
    }
    100% {
        
        opacity: 1;
        
    }
}

/* Bouton de réinitialisation */
.reset-cards-button {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2272ff 0%, #64b5f6 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(34, 114, 255, 0.4);
    z-index: 100;
}

.reset-cards-button.visible {
    opacity: 1;
    visibility: visible;
}

.reset-cards-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(34, 114, 255, 0.6);
}

.reset-cards-button:active {
    transform: scale(0.95);
}

.reset-cards-button svg {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s ease;
}

.reset-cards-button:hover svg {
    transform: rotate(-180deg);
}

/* ── Images des cartes ───────────────────────────────────────── */
.service-card-image {
    width: 100%;
    height: 55%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.04) 100%);
}

.service-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            transparent,
            rgba(34, 114, 255, 0.6),
            transparent);
    animation: slide 4s infinite;
}

@keyframes slide {
    0%, 100% { transform: translateX(-100%); opacity: 0; }
    40%, 60%  { opacity: 1; }
    50%       { transform: translateX(100%); }
}

.service-card-image img {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.service-card:hover .service-card-image img {
    transform: scale(1.06) translateY(-4px);
    filter: drop-shadow(0 12px 24px rgba(34, 114, 255, 0.4));
}

/* ── Contenu texte des cartes ────────────────────────────────── */
.service-card-content {
    padding: 25px;
    color: white;
    position: relative;
}

.service-card-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25px;
    width: 45px;
    height: 3px;
    background: linear-gradient(90deg, #2272ff, transparent);
    border-radius: 2px;
}

.service-card-content h3 {
    font-size: 1.5em;
    margin-bottom: 0px;
    margin-top: 10px;
    background: linear-gradient(135deg, #2272ff 0%, #64b5f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(34, 114, 255, 0.3);
}

.service-card-content p {
    font-size: 0.95em;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ── Tableau matériel ────────────────────────────────────────── */
.equipment-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    z-index: 1;
    overflow-x: auto;
}

.equipment-table {
    width: 100%;
    border-collapse: collapse;
    color: #2272ff;
}

.equipment-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95em;
    border-bottom: 2px solid rgba(33, 33, 33, 0.3);
    border-right: 1px solid rgba(33, 33, 33, 0.2);
    color: white;
}

.equipment-table thead th:last-child { border-right: none; }

.equipment-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(33, 33, 33, 0.5);
    border-right: 1px solid rgba(33, 33, 33, 0.5);
    font-size: 0.92em;
}

.equipment-table tbody td:last-child  { border-right: none; }
.equipment-table tbody tr:last-child td { border-bottom: none; }

.equipment-table tbody tr:hover {
    background: rgba(34, 114, 255, 0.1);
    transition: background 0.3s ease;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    #services { padding: 60px 0 25px 0; }

    .services-background-text {
        font-size: 5rem;
    }
    .services-content {
        gap: 30px;
        padding: 0 15px;
    }

    .services-cards-wrapper {
        min-height: 500px;
        padding: 22px 0;
        perspective: 1500px;
        gap: 0;
    }

    .cards-arrow-button {
        width: 40px;
        height: 40px;
        margin: 0 6px;
    }

    .cards-arrow-button svg {
        width: 18px;
        height: 18px;
    }

    .services-cards-stack {
        width: 85%;
        height: 380px;
    }

    .service-card { border-radius: 18px; }

    .service-card-content { padding: 10px; }
    .service-card-content::before { left: 18px; width: 38px; }
    .service-card-content h3 { font-size: 1.20em; }
    .service-card-content p  { font-size: 0.84em; }

    .equipment-container { width: 95%; padding: 14px; }

    .equipment-table thead th,
    .equipment-table tbody td {
        padding: 8px 10px;
        font-size: 0.82em;
    }
}

@keyframes cardSwipeOut {
    0% {
        opacity: 1;
        
    }
    100% {
        
        opacity: 0;
        
    }
}

@keyframes mouse-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes dot-scroll {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(30px);
        opacity: 0.3;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}