/* ==============================================
   SHARE MODAL
   Модалка "Поделиться" для web-версии.
   В Telegram/VK используются нативные методы.
   ============================================== */

.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10000;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.share-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.share-modal {
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

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

/* Полоска-ручка сверху */
.share-modal-handle {
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 12px auto 0;
}

.share-modal-header {
    padding: 16px 20px 12px;
    text-align: center;
}

.share-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* Сетка кнопок соцсетей */
.share-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px 16px 16px;
}

.share-modal-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.share-modal-btn:hover {
    background: #f3f4f6;
}

.share-modal-btn:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

.share-modal-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.share-modal-btn-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

/* Цвета иконок */
.share-icon-telegram {
    background: #2AABEE;
    color: #fff;
}

.share-icon-whatsapp {
    background: #25D366;
    color: #fff;
}

.share-icon-vk {
    background: #0077FF;
    color: #fff;
}

.share-icon-copy {
    background: #f3f4f6;
    color: #374151;
}

.share-icon-more {
    background: #f3f4f6;
    color: #374151;
}

/* SVG иконки внутри кнопок */
.share-modal-btn-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Разделитель */
.share-modal-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 0 20px;
}

/* Блок превью ссылки */
.share-modal-link-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 16px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.share-modal-link-text {
    flex: 1;
    font-size: 13px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
}

.share-modal-link-copy-btn {
    padding: 6px 12px;
    border: none;
    background: #3b82f6;
    color: #fff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.share-modal-link-copy-btn:hover {
    background: #2563eb;
}

.share-modal-link-copy-btn.copied {
    background: #22c55e;
}

/* Кнопка "Отмена" */
.share-modal-cancel {
    display: block;
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 14px;
    border: none;
    background: #f3f4f6;
    color: #374151;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.share-modal-cancel:hover {
    background: #e5e7eb;
}

/* Уведомление "Скопировано" (toast) */
.share-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1f2937;
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.share-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* На десктопе — модалка по центру */
@media (min-width: 600px) {
    .share-modal-overlay {
        align-items: center;
        padding: 20px;
    }

    .share-modal {
        border-radius: 20px;
        transform: translateY(30px);
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
    }

    .share-modal-overlay.active .share-modal {
        transform: translateY(0);
        opacity: 1;
    }

    .share-modal-handle {
        display: none;
    }
}

/* Safe area для устройств с вырезом */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .share-modal-cancel {
        margin-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}
