/**
 * Share Widget Styles
 * Social sharing buttons for news and project pages
 */

/* ===== Horizontal Share Bar (News Pages) ===== */
.share-widget {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    margin-top: var(--spacing-4);
    flex-wrap: wrap;
}

.share-widget__label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-inline-end: var(--spacing-2);
}

.share-widget__buttons {
    display: flex;
    gap: var(--spacing-2);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #fff;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.share-btn:active {
    transform: translateY(-1px);
}

.share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Platform-specific hover colors */
.share-btn--facebook:hover {
    background: #1877f2;
}

.share-btn--x:hover {
    background: #000;
}

.share-btn--linkedin:hover {
    background: #0a66c2;
}

.share-btn--whatsapp:hover {
    background: #25d366;
}

.share-btn--copy:hover {
    background: var(--color-primary);
}

/* Copy success state */
.share-btn--copy.share-btn--copied {
    background: #10b981;
}

.share-btn--copy.share-btn--copied svg {
    animation: copySuccess 0.3s ease;
}

@keyframes copySuccess {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== Floating Sidebar (Project Pages) ===== */
.share-sidebar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

[dir="rtl"] .share-sidebar {
    left: auto;
    right: 20px;
}

.share-sidebar.is-visible {
    opacity: 1;
    visibility: visible;
}

.share-sidebar .share-btn {
    background: var(--bg-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

/* Platform-specific colors for sidebar */
.share-sidebar .share-btn--facebook {
    color: #1877f2;
}

.share-sidebar .share-btn--x {
    color: #000;
}

.share-sidebar .share-btn--linkedin {
    color: #0a66c2;
}

.share-sidebar .share-btn--whatsapp {
    color: #25d366;
}

.share-sidebar .share-btn--copy {
    color: var(--color-primary);
}

/* Sidebar hover - background changes to brand color */
.share-sidebar .share-btn--facebook:hover {
    background: #1877f2;
    color: #fff;
}

.share-sidebar .share-btn--x:hover {
    background: #000;
    color: #fff;
}

.share-sidebar .share-btn--linkedin:hover {
    background: #0a66c2;
    color: #fff;
}

.share-sidebar .share-btn--whatsapp:hover {
    background: #25d366;
    color: #fff;
}

.share-sidebar .share-btn--copy:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ===== In-Article Share Bar ===== */
.share-inline {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-4) 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: var(--spacing-6) 0;
}

.share-inline__label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.share-inline .share-btn {
    background: var(--bg-secondary);
}

/* Platform-specific colors for inline share */
.share-inline .share-btn--facebook {
    color: #1877f2;
}

.share-inline .share-btn--x {
    color: #000;
}

.share-inline .share-btn--linkedin {
    color: #0a66c2;
}

.share-inline .share-btn--whatsapp {
    color: #25d366;
}

.share-inline .share-btn--copy {
    color: var(--color-primary);
}

/* Inline hover - background changes to brand color */
.share-inline .share-btn--facebook:hover {
    background: #1877f2;
    color: #fff;
}

.share-inline .share-btn--x:hover {
    background: #000;
    color: #fff;
}

.share-inline .share-btn--linkedin:hover {
    background: #0a66c2;
    color: #fff;
}

.share-inline .share-btn--whatsapp:hover {
    background: #25d366;
    color: #fff;
}

.share-inline .share-btn--copy:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .share-sidebar {
        display: none;
    }

    .share-widget {
        justify-content: center;
    }

    .share-btn {
        width: 36px;
        height: 36px;
    }

    .share-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ===== Dark Mode Support ===== */
[data-theme="dark"] .share-sidebar .share-btn {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .share-inline .share-btn {
    background: var(--bg-tertiary, var(--bg-secondary));
}