/**
 * Pear Analytics Social Sharing - Styles
 * Version: 2.0.0
 */

/* Main container */
.pear-social-sharing-widget {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    clear: both;
}

.pear-social-sharing-widget.auto-inserted {
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(to right, #f9fafb 0%, #ffffff 50%, #f9fafb 100%);
}

/* Widget heading */
.pear-ss-heading {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    text-align: center;
}

/* EMPHASIZED AI STYLE - ChatGPT and Perplexity prominent in single line */
.pear-social-sharing-widget.emphasized-ai-style {
    text-align: left;
}

.pear-social-sharing-widget.emphasized-ai-style .pear-ss-all-buttons-inline {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Separator between AI and traditional buttons */
.pear-ss-separator {
    display: inline-block;
    width: 1px;
    height: 36px;
    background: #e5e7eb;
    margin: 0 8px;
    align-self: center;
}

/* After Byline positioning */
.pear-ss-after-byline-wrapper {
    margin: 20px 0 30px 0;
}

.pear-ss-after-byline-wrapper .pear-social-sharing-widget {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

/* For themes with entry-meta or byline classes */
.entry-meta + .pear-ss-after-byline-wrapper,
.byline + .pear-ss-after-byline-wrapper {
    margin-top: 15px;
}

/* Large AI buttons */
.pear-ss-button.pear-ss-size-large {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 600;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    height: 42px;
    justify-content: center;
    box-sizing: border-box;
}

.pear-ss-button.pear-ss-size-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Medium traditional buttons - same height as large */
.pear-ss-button.pear-ss-size-medium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
    min-width: 42px;
    height: 42px;
    box-sizing: border-box;
}

.pear-ss-button.pear-ss-size-medium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Small buttons (deprecated but kept for compatibility) */
.pear-ss-button.pear-ss-size-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.pear-ss-button.pear-ss-size-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Normal size buttons */
.pear-ss-button.pear-ss-size-normal {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.pear-ss-button.pear-ss-size-normal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Icon styles */
.pear-ss-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pear-ss-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Label styles */
.pear-ss-label {
    margin-left: 10px;
    white-space: nowrap;
}

.pear-ss-size-large .pear-ss-label {
    font-size: 16px;
}

.pear-ss-size-small .pear-ss-label {
    display: none; /* Never show labels on small buttons */
}

/* Network-specific colors - AI Networks Emphasized */
.pear-ss-chatgpt {
    background: linear-gradient(135deg, #10a37f 0%, #0d8c6c 100%);
    color: #ffffff;
}

.pear-ss-chatgpt:hover {
    background: linear-gradient(135deg, #0d8c6c 0%, #0a7359 100%);
    color: #ffffff;
}

.pear-ss-perplexity {
    background: #ffffff;
    color: #20808D;
    border: 2px solid #20808D;
    box-sizing: border-box;
}

.pear-ss-perplexity:hover {
    background: #20808D;
    color: #ffffff;
    border: 2px solid #20808D;
}

/* Traditional Networks - Smaller, more subtle */
.pear-ss-facebook {
    background-color: #1877f2;
    color: #ffffff;
}

.pear-ss-facebook:hover {
    background-color: #166fe5;
    color: #ffffff;
}

.pear-ss-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff;
}

.pear-ss-instagram:hover {
    background: linear-gradient(45deg, #e8851f 0%, #d45928 25%, #ca1530 50%, #b81054 75%, #a60675 100%);
    color: #ffffff;
}

.pear-ss-linkedin {
    background-color: #0077b5;
    color: #ffffff;
}

.pear-ss-linkedin:hover {
    background-color: #006097;
    color: #ffffff;
}

.pear-ss-x {
    background-color: #000000;
    color: #ffffff;
}

.pear-ss-x:hover {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* Hover effect for AI buttons */
.pear-ss-chatgpt.pear-ss-size-large:hover {
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

.pear-ss-perplexity.pear-ss-size-large:hover {
    box-shadow: 0 4px 12px rgba(32, 128, 141, 0.3);
    transform: translateY(-2px);
}

/* Horizontal layout */
.pear-social-sharing-widget.horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Vertical layout */
.pear-social-sharing-widget.vertical {
    display: flex;
    flex-direction: column;
    max-width: 200px;
    gap: 10px;
}

.pear-social-sharing-widget.vertical .pear-ss-button {
    width: 100%;
    justify-content: flex-start;
}

/* Minimal style */
.pear-social-sharing-widget.minimal .pear-ss-button {
    background-color: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
}

.pear-social-sharing-widget.minimal .pear-ss-button:hover {
    border-color: currentColor;
}

.pear-social-sharing-widget.minimal .pear-ss-facebook:hover {
    color: #1877f2;
    border-color: #1877f2;
    background-color: rgba(24, 119, 242, 0.05);
}

.pear-social-sharing-widget.minimal .pear-ss-instagram:hover {
    color: #e4405f;
    border-color: #e4405f;
    background-color: rgba(228, 64, 95, 0.05);
}

.pear-social-sharing-widget.minimal .pear-ss-linkedin:hover {
    color: #0077b5;
    border-color: #0077b5;
    background-color: rgba(0, 119, 181, 0.05);
}

.pear-social-sharing-widget.minimal .pear-ss-x:hover {
    color: #000000;
    border-color: #000000;
    background-color: rgba(0, 0, 0, 0.05);
}

.pear-social-sharing-widget.minimal .pear-ss-chatgpt:hover {
    color: #10a37f;
    border-color: #10a37f;
    background-color: rgba(16, 163, 127, 0.05);
}

.pear-social-sharing-widget.minimal .pear-ss-perplexity {
    color: #20808D;
    border-color: #20808D;
    background-color: #ffffff;
}

.pear-social-sharing-widget.minimal .pear-ss-perplexity:hover {
    background: #20808D;
    color: #ffffff;
    border-color: #20808D;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .pear-social-sharing-widget.emphasized-ai-style .pear-ss-all-buttons-inline {
        justify-content: center;
    }
    
    .pear-ss-button.pear-ss-size-large {
        min-width: 130px;
        padding: 8px 16px;
        font-size: 14px;
        height: 38px;
    }
    
    .pear-ss-button.pear-ss-size-medium {
        padding: 8px 12px;
        min-width: 38px;
        height: 38px;
    }
    
    .pear-ss-separator {
        height: 24px;
        margin: 0 6px;
    }
    
    .pear-ss-heading {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* On very small screens, allow wrapping */
    .pear-social-sharing-widget.emphasized-ai-style .pear-ss-all-buttons-inline {
        justify-content: center;
    }
    
    .pear-ss-button.pear-ss-size-large {
        min-width: 110px;
        padding: 7px 14px;
        font-size: 13px;
        height: 36px;
    }
    
    .pear-ss-button.pear-ss-size-medium {
        padding: 7px 10px;
        height: 36px;
        min-width: 36px;
    }
    
    /* Hide separator on very small screens */
    .pear-ss-separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .pear-social-sharing-widget.horizontal:not(.emphasized-ai-style) .pear-ss-label {
        display: none;
    }
    
    .pear-social-sharing-widget.horizontal:not(.emphasized-ai-style) .pear-ss-button {
        padding: 10px;
        width: 44px;
        height: 44px;
        justify-content: center;
    }
}

/* Animation for share action */
@keyframes share-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 163, 127, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 163, 127, 0);
    }
}

.pear-ss-button.sharing {
    animation: share-pulse 1s;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pear-social-sharing-widget.auto-inserted {
        background: linear-gradient(to right, #1f2937 0%, #111827 50%, #1f2937 100%);
        border-color: #374151;
    }
    
    .pear-ss-heading {
        color: #f3f4f6;
    }
    
    .pear-social-sharing-widget.minimal .pear-ss-button {
        color: #d1d5db;
        border-color: #4b5563;
    }
}

/* Print styles */
@media print {
    .pear-social-sharing-widget {
        display: none;
    }
}

/* Accessibility improvements */
.pear-ss-button:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

.pear-ss-button:focus:not(:focus-visible) {
    outline: none;
}

/* Loading state */
.pear-ss-button.loading {
    pointer-events: none;
    opacity: 0.6;
}

.pear-ss-button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Special hover effect for AI buttons */
.pear-ss-button.pear-ss-size-large::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.pear-ss-button.pear-ss-size-large:hover::before {
    opacity: 1;
}
