/* ==========================================================================
   Social Features CSS (Tasks 51-60, 151-170)
   ========================================================================== */

/* ==========================================================================
   51. Like Button
   ========================================================================== */

.like-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.like-button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.like-button.is-liked {
    background: var(--color-primary-pale);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.like-button.is-liked .like-icon {
    animation: heartBeat 0.4s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.like-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.like-button .like-icon {
    transition: fill var(--transition-fast), color var(--transition-fast);
}

.like-count {
    font-variant-numeric: tabular-nums;
}

/* Like section in single post */
.article-likes {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--space-xl);
}

.article-likes-label {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

/* ==========================================================================
   53. Share Buttons
   ========================================================================== */

.share-buttons-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-xl) 0;
}

.share-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.share-buttons {
    display: flex;
    gap: var(--space-sm);
}

.share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: white;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

/* Telegram */
.share-btn--telegram {
    background: linear-gradient(135deg, #0088cc 0%, #00a8e6 100%);
}

.share-btn--telegram:hover {
    background: linear-gradient(135deg, #0099dd 0%, #00b9f7 100%);
}

/* VK */
.share-btn--vk {
    background: linear-gradient(135deg, #4C75A3 0%, #5B88B9 100%);
}

.share-btn--vk:hover {
    background: linear-gradient(135deg, #5a84b0 0%, #6a96c4 100%);
}

/* Odnoklassniki (OK) */
.share-btn--ok {
    background: linear-gradient(135deg, #EE8208 0%, #F7971E 100%);
}

.share-btn--ok:hover {
    background: linear-gradient(135deg, #ff9418 0%, #ffa833 100%);
}

/* WhatsApp */
.share-btn--whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.share-btn--whatsapp:hover {
    background: linear-gradient(135deg, #34e075 0%, #19a090 100%);
}

/* Copy Link */
.share-btn--copy {
    background: var(--color-surface-alt);
    color: var(--color-text-secondary);
}

.share-btn--copy:hover {
    background: var(--color-primary);
    color: white;
}

.share-btn--copy.copied {
    background: var(--color-success, #10B981);
    color: white;
}

/* Viber */
.share-btn--viber {
    background: linear-gradient(135deg, #59267c 0%, #7c519b 100%);
}

.share-btn--viber:hover {
    background: linear-gradient(135deg, #6b2d94 0%, #8f60aa 100%);
}

/* Share Counts */
.share-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--color-primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn {
    position: relative;
}

/* Article share section */
.article-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--space-xl);
}

.article-share-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* ==========================================================================
   54. Telegram Widget Styles
   ========================================================================== */

.telegram-widget {
    background: linear-gradient(135deg, #0088cc 0%, #00a8e6 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    color: white;
    text-align: center;
}

.telegram-widget-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.telegram-widget-text {
    font-size: 0.9375rem;
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

.telegram-widget-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: white;
    color: #0088cc;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.telegram-widget-btn:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-2px);
}

/* ==========================================================================
   55. VK Widget Styles
   ========================================================================== */

.vk-widget-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

/* ==========================================================================
   57. PWA Install Button
   ========================================================================== */

.pwa-install-btn {
    position: fixed;
    bottom: var(--space-xl);
    left: var(--space-xl);
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 72, 109, 0.4);
    transition: all var(--transition-fast);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.pwa-install-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pwa-install-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 72, 109, 0.5);
}

.pwa-install-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   58. Dark Mode Enhanced
   ========================================================================== */

.dark-mode-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.dark-mode-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dark-mode-toggle.active {
    background: var(--color-primary);
}

.dark-mode-toggle.active::after {
    transform: translateX(22px);
}

.dark-mode-toggle svg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
}

.dark-mode-toggle .sun-icon {
    left: 6px;
    opacity: 0;
    color: white;
}

.dark-mode-toggle .moon-icon {
    right: 6px;
    opacity: 1;
    color: var(--color-text-muted);
}

.dark-mode-toggle.active .sun-icon {
    opacity: 1;
}

.dark-mode-toggle.active .moon-icon {
    opacity: 0;
}

/* ==========================================================================
   59. Newsletter Forms Enhanced
   ========================================================================== */

.newsletter-ajax-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.newsletter-ajax-form .newsletter-input {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition-fast);
}

.newsletter-ajax-form .newsletter-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.newsletter-ajax-form .newsletter-btn {
    width: 100%;
    padding: var(--space-md);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.newsletter-ajax-form .newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 72, 109, 0.4);
}

.newsletter-ajax-form .newsletter-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.newsletter-message {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
}

.newsletter-message.success {
    background: var(--color-success-pale, rgba(16, 185, 129, 0.1));
    color: var(--color-success, #10B981);
}

.newsletter-message.error {
    background: var(--color-error-pale, rgba(239, 68, 68, 0.1));
    color: var(--color-error, #EF4444);
}

/* Newsletter box (in article) */
.newsletter-box {
    background: var(--gradient-primary);
    color: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    margin-top: var(--space-2xl);
    text-align: center;
}

.newsletter-box-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.newsletter-box h3 {
    color: white;
    margin-bottom: var(--space-md);
}

.newsletter-box p {
    opacity: 0.9;
    margin-bottom: var(--space-lg);
}

.newsletter-inline-form {
    display: flex;
    gap: var(--space-sm);
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-inline-form input {
    flex: 1;
    padding: var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.newsletter-inline-form button {
    white-space: nowrap;
}

.newsletter-box small {
    font-size: 0.875rem;
    opacity: 0.7;
    margin-top: var(--space-md);
    display: block;
}

/* ==========================================================================
   Push Notification Permission Button
   ========================================================================== */

.push-notification-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.push-notification-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.push-notification-btn svg {
    width: 18px;
    height: 18px;
}

.push-notification-btn.subscribed {
    background: var(--color-success, #10B981);
    border-color: var(--color-success, #10B981);
    color: white;
}

/* ==========================================================================
   Social Meta (Post Footer)
   ========================================================================== */

.post-social-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--space-xl);
}

.post-social-stats {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.post-social-stat {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

.post-social-stat svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Floating Share Sidebar (Mobile)
   ========================================================================== */

.share-sidebar-mobile {
    display: none;
    position: fixed;
    right: var(--space-md);
    bottom: calc(var(--space-xl) + 70px);
    z-index: var(--z-fixed);
}

.share-sidebar-toggle {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(212, 72, 109, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.share-sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 72, 109, 0.5);
}

.share-sidebar-toggle svg {
    width: 24px;
    height: 24px;
}

.share-sidebar-buttons {
    position: absolute;
    bottom: 64px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
}

.share-sidebar-mobile.active .share-sidebar-buttons {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-sidebar-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.share-sidebar-btn:hover {
    transform: scale(1.1);
}

.share-sidebar-btn--telegram {
    background: linear-gradient(135deg, #0088cc 0%, #00a8e6 100%);
}

.share-sidebar-btn--vk {
    background: linear-gradient(135deg, #4C75A3 0%, #5B88B9 100%);
}

.share-sidebar-btn--whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.share-sidebar-btn--copy {
    background: var(--color-surface-alt);
    color: var(--color-text-secondary);
}

/* ==========================================================================
   Push Notification Prompt
   ========================================================================== */

.push-notification-prompt {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-modal);
    width: 90%;
    max-width: 400px;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    padding: var(--space-lg);
    animation: slideUp 0.3s ease;
}

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

.push-notification-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-md);
}

.push-notification-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-primary-pale);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.push-notification-text h4 {
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

.push-notification-text p {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

.push-notification-actions {
    display: flex;
    gap: var(--space-sm);
    width: 100%;
}

.push-notification-btn-yes,
.push-notification-btn-no {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.push-notification-btn-yes {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.push-notification-btn-yes:hover {
    opacity: 0.9;
}

.push-notification-btn-no {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.push-notification-btn-no:hover {
    background: var(--color-surface-alt);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .share-buttons-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .share-buttons-wrapper .share-buttons {
        display: none; /* Hide inline buttons on mobile */
    }
    
    .share-btn {
        width: 40px;
        height: 40px;
    }
    
    .share-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* Show floating sidebar on mobile */
    .share-sidebar-mobile {
        display: block;
    }
    
    .article-likes {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .newsletter-inline-form {
        flex-direction: column;
    }
    
    .pwa-install-btn {
        left: var(--space-md);
        bottom: calc(var(--space-md) + 70px);
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }
    
    .post-social-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Push notification prompt adjustments */
    .push-notification-prompt {
        bottom: calc(var(--space-lg) + 70px);
    }
}

/* ==========================================================================
   Print Styles (hide social elements)
   ========================================================================== */

@media print {
    .share-buttons-wrapper,
    .like-button,
    .pwa-install-btn,
    .newsletter-box,
    .telegram-widget,
    .push-notification-btn {
        display: none !important;
    }
}
