/* Social Media Sharing Widget Styles */

:root {
    --social-primary: #1a1a1a;
    --social-accent: #0066ff;
    --social-bg: #ffffff;
    --social-border: #e0e0e0;
    --social-text: #333333;
    --social-text-light: #666666;
    --social-shadow: rgba(0, 0, 0, 0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --social-primary: #ffffff;
        --social-bg: #1f1f1f;
        --social-border: #333333;
        --social-text: #ffffff;
        --social-text-light: #cccccc;
        --social-shadow: rgba(0, 0, 0, 0.3);
    }
}

/* Main Widget Container */
.social-share-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9990;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    touch-action: none;
    user-select: none;
}

@media (max-width: 768px) {
    .social-share-widget {
        bottom: 20px;
        right: 20px;
    }
}

/* Toggle Button */
.social-share-toggle {
    background: linear-gradient(135deg, var(--social-accent) 0%, #0052cc 100%);
    color: white;
    border: none;
    border-radius: 50px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    active: grab;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 0;
}

.social-share-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
}

.social-share-toggle:active {
    cursor: grabbing;
}

.social-share-toggle svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* Content Panel */
.social-share-content {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: var(--social-bg);
    border-radius: 16px;
    padding: 24px;
    min-width: 320px;
    max-width: 380px;
    box-shadow: 0 20px 60px var(--social-shadow);
    border: 1px solid var(--social-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.social-share-widget.active .social-share-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.social-share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.social-share-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--social-text);
    letter-spacing: -0.5px;
}

.social-share-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--social-text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.social-share-close:hover {
    background: var(--social-border);
    color: var(--social-text);
}

/* Share All Button */
.social-share-all-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--social-accent) 0%, #0052cc 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.2);
}

.social-share-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

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

/* Grid Layout */
.social-share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 500px) {
    .social-share-content {
        min-width: 280px;
        max-width: 100vw;
        right: -20px;
    }
    
    .social-share-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Individual Platform Buttons */
.social-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--social-border);
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    color: var(--social-text);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.social-share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
    z-index: 0;
}

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

.social-share-btn svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
}

.social-share-btn span {
    position: relative;
    z-index: 1;
}

/* Platform-specific colors */
.social-share-btn.facebook {
    background: #E7F3FF;
    color: #1877f2;
}

.social-share-btn.facebook:hover {
    background: #1877f2;
    color: white;
    transform: translateY(-2px);
}

.social-share-btn.twitter {
    background: #F3F3F3;
    color: #000000;
}

@media (prefers-color-scheme: dark) {
    .social-share-btn.twitter {
        background: #333333;
        color: #ffffff;
    }
}

.social-share-btn.twitter:hover {
    background: #000000;
    color: white;
    transform: translateY(-2px);
}

.social-share-btn.linkedin {
    background: #EFF6FF;
    color: #0a66c2;
}

.social-share-btn.linkedin:hover {
    background: #0a66c2;
    color: white;
    transform: translateY(-2px);
}

.social-share-btn.pinterest {
    background: #FFE7E7;
    color: #e60023;
}

.social-share-btn.pinterest:hover {
    background: #e60023;
    color: white;
    transform: translateY(-2px);
}

.social-share-btn.whatsapp {
    background: #E7F8F2;
    color: #25d366;
}

.social-share-btn.whatsapp:hover {
    background: #25d366;
    color: white;
    transform: translateY(-2px);
}

.social-share-btn.email {
    background: #FFF3E0;
    color: #d97706;
}

.social-share-btn.email:hover {
    background: #d97706;
    color: white;
    transform: translateY(-2px);
}

.social-share-btn.telegram {
    background: #E0F7FF;
    color: #0088cc;
}

.social-share-btn.telegram:hover {
    background: #0088cc;
    color: white;
    transform: translateY(-2px);
}

.social-share-btn.reddit {
    background: #FFE7D9;
    color: #ff4500;
}

.social-share-btn.reddit:hover {
    background: #ff4500;
    color: white;
    transform: translateY(-2px);
}

.social-share-btn.copy-link {
    background: var(--social-border);
    color: var(--social-text);
}

.social-share-btn.copy-link:hover {
    background: var(--social-text);
    color: var(--social-bg);
    transform: translateY(-2px);
}

/* Modal Styles */
.social-share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.social-share-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.social-share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.social-share-modal-content {
    position: relative;
    background: var(--social-bg);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.social-share-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    color: var(--social-text-light);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.social-share-modal-close:hover {
    background: var(--social-border);
    color: var(--social-text);
}

.social-share-modal-content h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--social-text);
    letter-spacing: -0.5px;
}

.social-share-modal-content p {
    margin: 0 0 24px 0;
    color: var(--social-text-light);
    font-size: 14px;
    line-height: 1.5;
}

.social-share-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

@media (max-width: 500px) {
    .social-share-modal-content {
        padding: 28px;
    }
    
    .social-share-modal-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.social-share-modal-grid .social-share-btn {
    padding: 16px 12px;
}

/* URL Section */
.social-share-url-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--social-border);
}

.social-share-url-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--social-text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.social-share-url-box {
    display: flex;
    gap: 8px;
}

#shareUrlInput {
    flex: 1;
    border: 1px solid var(--social-border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: var(--social-text);
    background: var(--social-border);
}

#copyUrlBtn {
    background: var(--social-accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#copyUrlBtn:hover {
    background: #0052cc;
    transform: translateY(-1px);
}

/* Toast Notification */
.social-share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--social-primary);
    color: var(--social-bg);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    animation: slideUpToast 0.3s ease;
    pointer-events: none;
}

@keyframes slideUpToast {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .social-share-widget,
    .social-share-content,
    .social-share-modal-content,
    .social-share-btn,
    .social-share-toggle {
        transition: none !important;
        animation: none !important;
    }
}

/* Print styles */
@media print {
    .social-share-widget,
    .social-share-modal {
        display: none !important;
    }
}
