/**
 * Social Sharing Buttons - Clean Styles
 * Compatible with Tailwind CSS
 */

/* Social Sharing Section Animation */
.mtq-social-sharing {
    position: relative;
    overflow: hidden;
}

.mtq-social-sharing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    animation: slideIn 2s ease-in-out infinite;
}

@keyframes slideIn {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Button Hover Effects */
.social-share-btn {
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
}

.social-share-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
    z-index: 0;
}

.social-share-btn:hover::before {
    width: 100%;
    height: 100%;
}

/* Focus States */
.social-share-btn:focus {
    outline: 2px solid #fff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5) !important;
}

.social-share-btn:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5) !important;
}

/* Ensure proper z-index */
.social-share-btn span,
.social-share-btn svg {
    position: relative !important;
    z-index: 10 !important;
    pointer-events: none !important;
}

/* Animation for icons */
.social-share-btn:hover svg {
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: scale(1.1) rotate(5deg) translateY(0px); 
    }
    50% { 
        transform: scale(1.1) rotate(-5deg) translateY(-3px); 
    }
}

/* Counter Animation */
.animate-counter {
    display: inline-block;
    transition: all 0.3s ease;
}

.animate-counter.counting {
    animation: bounceCount 0.6s ease;
    color: #059669 !important;
    font-weight: bold;
}

@keyframes bounceCount {
    0%, 20%, 50%, 80%, 100% { 
        transform: translateY(0); 
    }
    40% { 
        transform: translateY(-5px); 
    }
    60% { 
        transform: translateY(-3px); 
    }
}

/* Copy Success State */
.social-share-btn.copy-success {
    background-color: #10b981 !important;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.1); 
    }
    100% { 
        transform: scale(1); 
    }
}

/* Ripple Effect */
.ripple-effect {
    pointer-events: none;
}

.social-share-btn:hover .ripple-effect {
    animation: ripple 0.6s linear;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Loading State for Buttons */
.social-share-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.social-share-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Copy Success State */
.social-share-btn.copy-success {
    background-color: #10b981 !important;
    animation: copySuccess 2s ease;
}

@keyframes copySuccess {
    0% { background-color: inherit; }
    20% { background-color: #10b981; }
    100% { background-color: inherit; }
}

/* Mobile Responsive Enhancements */
@media (max-width: 640px) {
    .mtq-social-sharing {
        padding: 1.5rem 0;
    }
    
    .social-share-btn {
        width: 3.5rem !important;
        height: 3.5rem !important;
        border-radius: 50% !important;
    }
    
    .social-share-btn svg {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .social-share-btn {
        width: 4rem !important;
        height: 4rem !important;
        border-radius: 50% !important;
    }
    
    .social-share-btn svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
}

/* Large screen optimizations */
@media (min-width: 1024px) {
    .social-share-btn {
        width: 4.5rem !important;
        height: 4.5rem !important;
        border-radius: 50% !important;
    }
    
    .social-share-btn svg {
        width: 1.75rem !important;
        height: 1.75rem !important;
    }
}

/* Accessibility Focus States */
/* Fix accessibility and interaction issues */
.social-share-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5);
}

.social-share-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5);
}

.social-share-btn:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s ease;
}

/* Ensure buttons are properly clickable */
.social-share-btn {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
}

/* Fix z-index issues */
.social-share-btn * {
    pointer-events: none;
}

.social-share-btn {
    pointer-events: all;
}

/* Print Styles */
@media print {
    .mtq-social-sharing {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .social-share-btn {
        border: 2px solid;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .social-share-btn,
    .social-share-btn::before,
    .social-share-btn svg,
    .animate-counter,
    .mtq-social-sharing::before {
        animation: none !important;
        transition: none !important;
    }
    
    .social-share-btn:hover {
        transform: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mtq-social-sharing {
        background: linear-gradient(to right, #1f2937, #111827) !important;
    }
    
    .social-share-btn {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    }
}

/* Tooltip Styles */
.social-share-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 4px;
}

.social-share-btn[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(0, 0, 0, 0.9);
    z-index: 1000;
    pointer-events: none;
}

/* Share Statistics Animation */
.share-stats-container {
    transition: all 0.3s ease;
}

.share-stats-container:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.2);
}

/* Thank You Message Animation */
#share-thank-you {
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Platform-Specific Button Colors (Fallback) */
.social-share-btn[data-network="facebook"] {
    background: linear-gradient(135deg, #1877f2, #166fe5) !important;
}

.social-share-btn[data-network="twitter"] {
    background: linear-gradient(135deg, #1da1f2, #0c85d0) !important;
}

.social-share-btn[data-network="whatsapp"] {
    background: linear-gradient(135deg, #25d366, #20ba5a) !important;
}

.social-share-btn[data-network="telegram"] {
    background: linear-gradient(135deg, #0088cc, #006aa5) !important;
}

.social-share-btn[data-network="linkedin"] {
    background: linear-gradient(135deg, #0077b5, #005885) !important;
}

.social-share-btn[data-network="pinterest"] {
    background: linear-gradient(135deg, #bd081c, #8c0613) !important;
}

.social-share-btn[data-network="email"] {
    background: linear-gradient(135deg, #6b7280, #4b5563) !important;
}

.social-share-btn[data-network="copy"] {
    background: linear-gradient(135deg, #64748b, #475569) !important;
}
