/**
 * CSS para Componente de Compartilhamento Social
 * 
 * Este arquivo contém estilos específicos para os botões de compartilhamento
 * social, incluindo animações, hover effects e responsividade.
 */

/* ===== VARIÁVEIS CSS ===== */
:root {
    --social-facebook: #1877f2;
    --social-facebook-hover: #166fe5;
    --social-twitter: #1da1f2;
    --social-twitter-hover: #0d8bd9;
    --social-whatsapp: #25d366;
    --social-whatsapp-hover: #1ebe57;
    --social-linkedin: #0077b5;
    --social-linkedin-hover: #005885;
    --social-email: #6b7280;
    --social-email-hover: #4b5563;
    
    --social-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --social-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --social-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===== COMPONENTE PRINCIPAL ===== */
.social-share-component {
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: var(--social-shadow);
}

.social-share-component::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--social-facebook), var(--social-twitter), var(--social-whatsapp), var(--social-linkedin));
    border-radius: 12px 12px 0 0;
}

/* ===== TÍTULO ===== */
.social-share-component h3 {
    color: #1e293b;
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.social-share-component h3 svg {
    color: #3b82f6;
    flex-shrink: 0;
}

/* ===== BOTÕES SOCIAIS ===== */
.social-share-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--social-transition);
    box-shadow: var(--social-shadow);
    border: none;
    cursor: pointer;
    overflow: hidden;
}

/* Efeito de brilho nos botões */
.social-share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.social-share-btn:hover::before {
    left: 100%;
}

.social-share-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--social-shadow-hover);
}

.social-share-btn:active {
    transform: translateY(0) scale(0.98);
}

.social-share-btn:focus {
    outline: none;
    ring: 2px solid rgba(59, 130, 246, 0.5);
    ring-offset: 2px;
}

/* ===== CORES DOS BOTÕES ===== */
.social-share-btn.facebook {
    background-color: var(--social-facebook);
    color: white;
}

.social-share-btn.facebook:hover {
    background-color: var(--social-facebook-hover);
}

.social-share-btn.twitter {
    background-color: var(--social-twitter);
    color: white;
}

.social-share-btn.twitter:hover {
    background-color: var(--social-twitter-hover);
}

.social-share-btn.whatsapp {
    background-color: var(--social-whatsapp);
    color: white;
}

.social-share-btn.whatsapp:hover {
    background-color: var(--social-whatsapp-hover);
}

.social-share-btn.linkedin {
    background-color: var(--social-linkedin);
    color: white;
}

.social-share-btn.linkedin:hover {
    background-color: var(--social-linkedin-hover);
}

.social-share-btn.email {
    background-color: var(--social-email);
    color: white;
}

.social-share-btn.email:hover {
    background-color: var(--social-email-hover);
}

/* ===== BOTÕES COMPACTOS ===== */
.social-share-btn.compact {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
}

.social-share-btn.compact svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ===== CONTAINER DOS BOTÕES ===== */
.social-share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.social-share-buttons.vertical {
    flex-direction: column;
    align-items: stretch;
}

.social-share-buttons.vertical .social-share-btn {
    width: 100%;
    justify-content: flex-start;
}

/* ===== SEÇÃO DE COPIAR URL ===== */
.copy-url-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.copy-url-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.copy-url-input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #f9fafb;
    font-size: 0.875rem;
    color: #374151;
    transition: var(--social-transition);
}

.copy-url-input:focus {
    outline: none;
    border-color: #3b82f6;
    ring: 2px solid rgba(59, 130, 246, 0.2);
    background-color: white;
}

.copy-url-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: var(--social-transition);
    white-space: nowrap;
}

.copy-url-btn:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.copy-url-btn:active {
    transform: scale(0.98);
}

.copy-url-btn.success {
    background-color: #10b981;
    border-color: #059669;
    color: white;
}

.copy-url-btn.success:hover {
    background-color: #059669;
}

/* ===== ANIMAÇÕES ===== */
@keyframes shareButtonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.social-share-btn.animate-pulse {
    animation: shareButtonPulse 2s infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.social-share-component {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== ESTADOS DE LOADING ===== */
.social-share-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.social-share-btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 640px) {
    .social-share-component {
        padding: 1rem;
        margin: 0 -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .social-share-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .social-share-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
    }
    
    .copy-url-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-url-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .social-share-component h3 {
        font-size: 1rem;
        text-align: center;
    }
    
    .social-share-btn {
        font-size: 0.8125rem;
        padding: 0.75rem;
    }
}

/* ===== MODO ESCURO ===== */
@media (prefers-color-scheme: dark) {
    .social-share-component {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: #334155;
        color: #f1f5f9;
    }
    
    .social-share-component h3 {
        color: #f1f5f9;
    }
    
    .copy-url-input {
        background-color: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .copy-url-input:focus {
        background-color: #334155;
        border-color: #3b82f6;
    }
    
    .copy-url-btn {
        background-color: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .copy-url-btn:hover {
        background-color: #475569;
    }
}

/* ===== ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce) {
    .social-share-btn,
    .copy-url-input,
    .copy-url-btn,
    .social-share-component {
        transition: none;
        animation: none;
    }
    
    .social-share-btn:hover {
        transform: none;
    }
}

/* ===== IMPRESSÃO ===== */
@media print {
    .social-share-component {
        display: none;
    }
}

/* ===== TOOLTIPS ===== */
.social-share-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 0.25rem;
}

.social-share-btn[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    z-index: 10;
}

/* ===== CONTADOR DE COMPARTILHAMENTOS (OPCIONAL) ===== */
.share-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* ===== INDICADOR DE SUCESSO ===== */
.share-success-indicator {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background-color: #10b981;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: var(--social-shadow-hover);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
} 
