/* Stacked Testimonials Section Styles */

/* Container principal */
.testimonials-stack-container {
    position: relative;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible; /* Permettre aux cartes de dépasser */
    padding: 90px 0; /* Ajouter du padding pour éviter les débordements */
}

/* Ajustement de la hauteur pour mobile */
@media (max-width: 768px) {
    .testimonials-stack-container {
        min-height: 400px;
        padding: 80px 0;
    }
}

@media (max-width: 480px) {
    .testimonials-stack-container {
        min-height: 350px;
        padding: 60px 0;
    }
}

/* Padding mobile pour cohérence avec les services */
@media (max-width: 480px) {
    .testimonials-stack-container {
        padding: 60px 24px; /* Même padding que les services mobile */
    }
}

/* Stack de cartes */
.testimonials-stack {
    position: relative;
    width: 350px;
    height: 450px;
    perspective: 1000px;
    overflow: visible; /* Permettre aux cartes de dépasser */
}

/* Cartes de témoignages empilées */
.testimonial-card-stack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.9);
    border: 2px solid rgba(71, 85, 105, 0.5);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
    user-select: none;
    z-index: 1;
    color: white;
}

.testimonial-card-stack:active {
    cursor: grabbing;
}

/* Positionnement des cartes */
.testimonial-card-stack.front {
    z-index: 3;
    transform: rotate(-6deg) translateX(0%);
    border-color: rgba(179, 136, 255, 0.6);
    box-shadow: 0 25px 50px rgba(179, 136, 255, 0.2);
}

.testimonial-card-stack.middle {
    z-index: 2;
    transform: rotate(0deg) translateX(33%);
    opacity: 0.6;
    border-color: rgba(71, 85, 105, 0.4);
}

.testimonial-card-stack.middle .testimonial-text {
    color: white; 
}

.testimonial-card-stack.back {
    z-index: 1;
    transform: rotate(6deg) translateX(66%);
    opacity: 0.3;
    border-color: rgba(71, 85, 105, 0.3);
}

.testimonial-card-stack.back .testimonial-text {
    color: white; /* Gris pour la carte back */
}

/* Avatar */
.testimonial-avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 2px solid rgba(71, 85, 105, 0.5);
    object-fit: cover;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.testimonial-card-stack.front .testimonial-avatar {
    border-color: rgba(179, 136, 255, 0.6);
    box-shadow: 0 0 20px rgba(179, 136, 255, 0.3);
}

/* Avatar par défaut avec initiales */
.testimonial-avatar-default {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 2px solid rgba(71, 85, 105, 0.5);
    background: linear-gradient(135deg, #b388ff 0%, #9b6dff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.testimonial-card-stack.front .testimonial-avatar-default {
    border-color: rgba(179, 136, 255, 0.8);
    box-shadow: 0 0 20px rgba(179, 136, 255, 0.4);
    transform: scale(1.05);
}

/* Texte du témoignage */
.testimonial-text {
    font-size: 1.125rem;
    font-style: italic;
    color: white; 
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonial-card-stack.front .testimonial-text {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Auteur */
.testimonial-author {
    font-size: 0.875rem;
    font-weight: 500;
    color: #b388ff;
    margin-bottom: 0.5rem;
}

/* Entreprise */
.testimonial-company {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
}

/* Étoiles de notation */
.testimonial-stars {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.testimonial-stars svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #fbbf24;
    transition: transform 0.2s ease;
}

.testimonial-card-stack.front .testimonial-stars svg {
    transform: scale(1.1);
}

/* Instructions pour mobile */
.testimonials-instructions {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px) rotate(10deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

.testimonial-card-stack.entering {
    animation: cardSlideIn 0.5s ease-out;
}

/* États de drag */
.testimonial-card-stack.dragging {
    transition: none;
    z-index: 10;
}

.testimonial-card-stack.drag-left {
    transform: rotate(-8deg) translateX(-10%);
    opacity: 0.7;
}

.testimonial-card-stack.drag-right {
    transform: rotate(8deg) translateX(10%);
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .testimonials-stack {
        width: 80%;
        max-width: 280px;
        height: 320px;
        margin-left: -10px; /* Décalage vers la gauche */
    }
    
    .testimonial-card-stack {
        padding: 0.9rem;
    }
    
    .testimonial-avatar,
    .testimonial-avatar-default {
        width: 70px;
        height: 70px;
        font-size: 1rem;
    }
    
    .testimonial-text {
        font-size: 0.85rem;
    }
    
    .testimonial-author {
        font-size: 0.7rem;
    }
    
    .testimonial-company {
        font-size: 0.6rem;
    }
    
    /* Ajustement des positions pour mobile */
    .testimonial-card-stack.middle {
        transform: rotate(0deg) translateX(18%);
    }
    
    .testimonial-card-stack.back {
        transform: rotate(2deg) translateX(35%);
    }
}

@media (max-width: 480px) {
    .testimonials-stack {
        width: 75%;
        max-width: 260px;
        height: 300px;
        margin-left: -15px; /* Décalage vers la gauche plus prononcé */
    }
    
    .testimonial-card-stack {
        padding: 0.7rem;
    }
    
    .testimonial-avatar,
    .testimonial-avatar-default {
        width: 60px;
        height: 60px;
        font-size: 0.9rem;
    }
    
    .testimonial-text {
        font-size: 0.75rem;
    }
    
    .testimonial-author {
        font-size: 0.65rem;
    }
    
    .testimonial-company {
        font-size: 0.55rem;
    }
    
    /* Réduction des rotations pour mobile */
    .testimonial-card-stack.front {
        transform: rotate(-2deg) translateX(0%);
    }
    
    .testimonial-card-stack.middle {
        transform: rotate(0deg) translateX(12%);
    }
    
    .testimonial-card-stack.back {
        transform: rotate(2deg) translateX(25%);
    }
}

/* Support pour les préférences de réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    .testimonial-card-stack {
        transition: none;
    }
    
    .testimonial-card-stack.entering {
        animation: none;
    }
    
    .testimonials-instructions {
        animation: none;
    }
}

/* Amélioration de l'accessibilité */
.testimonial-card-stack:focus {
    outline: 2px solid #b388ff;
    outline-offset: 4px;
}

/* Forcer le mode sombre sur tous les navigateurs */
.testimonial-card-stack {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(71, 85, 105, 0.5) !important;
    color: white !important;
}

/* Fallback pour backdrop-filter sur iOS/Safari */
@supports not (backdrop-filter: blur(16px)) {
    .testimonial-card-stack {
        background: rgba(30, 41, 59, 0.95) !important;
    }
}

/* Support spécifique pour iOS/Safari */
@supports (-webkit-backdrop-filter: blur(16px)) {
    .testimonial-card-stack {
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
}
