/**
 * Styles pour les boutons de partage social
 * Boutons colorés avec icônes pour Facebook, WhatsApp, Twitter, Email et Copier
 */

/* Conteneur des boutons de partage */
.social-share-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 0;
}

/* Styles de base pour tous les boutons */
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.share-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.share-btn:active {
    transform: scale(0.95);
}

/* Icônes SVG */
.share-btn svg {
    width: 20px;
    height: 20px;
    color: white;
    pointer-events: none;
}

/* Effet hover général */
.share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Facebook - Bleu officiel */
.share-facebook {
    background: #1877F2;
}

.share-facebook:hover {
    background: #1666D9;
}

/* WhatsApp - Vert officiel */
.share-whatsapp {
    background: #25D366;
}

.share-whatsapp:hover {
    background: #1EBE57;
}

/* Twitter/X - Noir officiel */
.share-twitter {
    background: #000000;
}

.share-twitter:hover {
    background: #1A1A1A;
}

/* Email - Rouge Gmail */
.share-email {
    background: #EA4335;
}

.share-email:hover {
    background: #D33426;
}

/* Copier le lien - Gris neutre */
.share-copy {
    background: #6B7280;
}

.share-copy:hover {
    background: #4B5563;
}

/* Animation lors du clic sur copier */
.share-copy:active {
    background: #10B981;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .social-share-buttons {
        gap: 8px;
        margin-top: 12px;
        padding: 10px 0;
    }

    .share-btn {
        width: 36px;
        height: 36px;
    }

    .share-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .social-share-buttons {
        gap: 6px;
        margin-top: 10px;
        padding: 8px 0;
    }

    .share-btn {
        width: 32px;
        height: 32px;
    }

    .share-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Tooltip au survol */
.share-btn::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.share-btn::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.share-btn:hover::before,
.share-btn:hover::after {
    opacity: 1;
}

/* Masquer les tooltips sur mobile pour éviter les conflits */
@media (max-width: 768px) {
    .share-btn::before,
    .share-btn::after {
        display: none;
    }
}

/* Animation de chargement pour le bouton copier */
@keyframes copyPulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }
}

.share-copy.copying {
    animation: copyPulse 0.6s ease;
}

/* Séparateur visuel optionnel avant les boutons */
.social-share-buttons::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(0, 0, 0, 0.1) 50%,
        transparent
    );
    position: absolute;
    top: 0;
    left: 0;
}

.social-share-buttons {
    position: relative;
    padding-top: 16px;
}

/* Alternative : affichage en ligne sans séparateur */
.social-share-buttons.inline {
    padding-top: 12px;
}

.social-share-buttons.inline::before {
    display: none;
}

/* Accessibilité - Mode haut contraste */
@media (prefers-contrast: high) {
    .share-btn {
        border: 2px solid white;
    }

    .share-btn:focus {
        box-shadow: 0 0 0 3px yellow;
    }
}

/* Accessibilité - Préférence pour mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .share-btn {
        transition: none;
    }

    .share-btn:hover {
        transform: none;
    }

    .share-btn::before,
    .share-btn::after {
        transition: none;
    }
}

/* Mode sombre - Support */
@media (prefers-color-scheme: dark) {
    .social-share-buttons::before {
        background: linear-gradient(
            to right,
            transparent,
            rgba(255, 255, 255, 0.15) 50%,
            transparent
        );
    }

    .share-btn {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .share-btn:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    }
}

/* Variante compacte */
.social-share-buttons.compact {
    gap: 6px;
    margin-top: 8px;
    padding: 8px 0;
}

.social-share-buttons.compact .share-btn {
    width: 32px;
    height: 32px;
}

.social-share-buttons.compact .share-btn svg {
    width: 16px;
    height: 16px;
}

/* Variante grande */
.social-share-buttons.large {
    gap: 14px;
    margin-top: 20px;
    padding: 16px 0;
}

.social-share-buttons.large .share-btn {
    width: 48px;
    height: 48px;
}

.social-share-buttons.large .share-btn svg {
    width: 24px;
    height: 24px;
}

/* État désactivé */
.share-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Animation de succès pour la copie */
@keyframes successCheck {
    0% {
        transform: scale(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

.share-copy.success svg {
    animation: successCheck 0.5s ease;
}
