/* Стили для функционала "Поделиться статьей" */

.article-share-section {
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.share-label {
    font-weight: 600;
    color: #495057;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.share-label:hover {
    color: #3498db;
}

.share-label i {
    color: #6c757d;
    font-size: 18px;
    transition: color 0.3s ease;
}

.share-label:hover i {
    color: #3498db;
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Скрываем социальные кнопки по умолчанию */
.share-actions .share-button:not(.copy-link-btn) {
    display: none;
}

/* Popup для социальных сетей */
.share-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.share-popup.active {
    display: flex;
}

.share-popup-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.share-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.share-popup-title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.share-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.share-popup-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.share-popup-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.share-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.share-button:active {
    transform: translateY(0);
}

/* Кнопка копирования ссылки */
.copy-link-btn {
    background: #3498db;
    color: white;
    border: 2px solid #3498db;
}

.copy-link-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
    color: white;
}

.copy-link-btn.copied {
    background: #28a745;
    border-color: #28a745;
    animation: copySuccess 0.5s ease;
}

@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Социальные кнопки */
.telegram-btn {
    background: #0088cc;
    color: white;
    border: 2px solid #0088cc;
}

.telegram-btn:hover {
    background: #006699;
    border-color: #006699;
    color: white;
}

.whatsapp-btn {
    background: #25d366;
    color: white;
    border: 2px solid #25d366;
}

.whatsapp-btn:hover {
    background: #1da851;
    border-color: #1da851;
    color: white;
}

.facebook-btn {
    background: #3b5998;
    color: white;
    border: 2px solid #3b5998;
}

.facebook-btn:hover {
    background: #2d4373;
    border-color: #2d4373;
    color: white;
}

.email-btn {
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
}

.email-btn:hover {
    background: #545b62;
    border-color: #545b62;
    color: white;
}

.instagram-btn {
    background: #e4405f;
    color: white;
    border: 2px solid #e4405f;
}

.instagram-btn:hover {
    background: #c13584;
    border-color: #c13584;
    color: white;
}

.twitter-btn {
    background: #222222;
    color: white;
    border: 2px solid #222222;
}

.twitter-btn:hover {
    background: #1da1f2;
    border-color: #1da1f2;
    color: white;
}

/* URL поле для копирования */
.url-copy-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px;
    min-width: 300px;
    max-width: 100%;
}

.url-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #495057;
    background: transparent;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
}

.url-copy-btn {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    color: #6c757d;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.url-copy-btn:hover {
    background: #2980b9;
    color: #ffffff;
}

.url-copy-btn.copied {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Уведомление об успешном копировании */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.copy-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.copy-notification i {
    font-size: 16px;
}

/* Мобильная версия: скрыть копирование в основном блоке, показать в popup */
@media (max-width: 779px) {
  .article-share-section .copy-link-btn,
  .article-share-section .url-copy-container {
    display: none !important;
  }
  .share-popup-copy-container {
    display: block !important;
  }
}

/* По умолчанию скрываем копирование в popup на десктопе */
.share-popup-copy-container {
  display: none;
  margin-bottom: 18px;
  text-align: center;
}

.share-popup-copy-container .url-input {
  width: 90%;
  margin-bottom: 8px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
	
.article-share-section {
    margin: 0;
    padding: 0;
    background: inherit;
    border-radius: 8px;
    border: 0 solid #e9ecef;
    display: flex;
		flex-direction: row;
		align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}
    
    .share-label {
        text-align: center;
        justify-content: center;
    }
    
    .share-actions {
        justify-content: center;
				flex-wrap: wrap;
				width: 100%;
    }
    
    .url-copy-container {
        min-width: auto;
        max-width: 100%;
    }
    
    .url-input {
        font-size: 12px;
    }
    
    .share-button {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .share-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .share-button {
        width: 100%;
        justify-content: center;
    }
    
    .url-copy-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .url-copy-btn {
        width: 100%;
        text-align: center;
    }
}

/* Анимация для иконок */
.share-button i {
    transition: transform 0.3s ease;
}

.share-button:hover i {
    transform: scale(1.1);
}

/* Состояние загрузки */
.share-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.share-button.loading i {
    animation: spin 1s linear infinite;
}

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