/* ============================================
   MemoryMantle Sharing Modal & Components
   ============================================ */

/* ---- Overlay ---- */
.mm-share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: mmShareFadeIn 0.2s ease;
}
.mm-share-overlay.closing {
    animation: mmShareFadeOut 0.2s ease forwards;
}

/* ---- Modal ---- */
.mm-share-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.75rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: mmShareSlideUp 0.3s ease;
}
.mm-share-overlay.closing .mm-share-modal {
    animation: mmShareSlideDown 0.2s ease forwards;
}

/* ---- Close button ---- */
.mm-share-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}
.mm-share-close:hover {
    background: #f0ede8;
    color: #333333;
}

/* ---- Title & name ---- */
.mm-share-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.mm-share-title i { color: #2a2a2a; }
.mm-share-name {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0 0 1.25rem;
}

/* ---- QR Code section ---- */
.mm-share-qr {
    text-align: center;
    margin-bottom: 0.75rem;
}
.mm-share-qr img {
    width: 180px;
    height: 180px;
    border: 1px solid #e8e4df;
    border-radius: 12px;
    padding: 10px;
    background: #fff;
}

/* ---- QR action buttons ---- */
.mm-share-qr-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.mm-share-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid #d5d0c8;
    border-radius: 8px;
    background: #fff;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.mm-share-btn-sm:hover {
    border-color: #d4a853;
    color: #d4a853;
    background: #faf5eb;
}

/* ---- Copy link row ---- */
.mm-share-copy {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border: 1.5px solid #e8e4df;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.mm-share-copy:focus-within {
    border-color: #d4a853;
}
.mm-share-link-input {
    flex: 1;
    border: none;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    color: #333333;
    background: #faf8f5;
    outline: none;
    min-width: 0;
    font-family: inherit;
}
.mm-share-copy-btn {
    background: #234737;
    color: #fff;
    border: none;
    padding: 0 0.85rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}
.mm-share-copy-btn:hover { background: #142a20; }
.mm-share-copy-btn.copied { background: #5a8a5a; }

/* ---- Social buttons row ---- */
.mm-share-social {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.mm-social-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mm-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.mm-social-facebook { background: #3b5998; }
.mm-social-twitter { background: #000; }
.mm-social-whatsapp { background: #25d366; }
.mm-social-email { background: #777777; }
.mm-social-native { background: #234737; }

/* ---- Tip box ---- */
.mm-share-tip {
    background: #faf8f5;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    color: #2a2a2a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}
.mm-share-tip i { color: #d4a853; flex-shrink: 0; }

/* ---- Desktop share button (inline in pages) ---- */
.mm-share-btn-desktop {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    background: #234737;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.mm-share-btn-desktop:hover {
    background: #142a20;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 71, 55, 0.3);
}

/* ---- Floating Action Button (mobile) ---- */
.share-fab {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #142a20 0%, #234737 100%);
    color: #fff;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(35, 71, 55, 0.4);
    z-index: 900;
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
    justify-content: center;
}
.share-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(35, 71, 55, 0.5);
}
.share-fab:active {
    transform: scale(0.95);
}

/* ---- Share icon on cards ---- */
.card-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #faf5eb;
    color: #2a2a2a;
    border: 1.5px solid #f5edd8;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.card-share-btn:hover {
    background: #234737;
    color: #fff;
    border-color: #2a2a2a;
}

/* ---- Animations ---- */
@keyframes mmShareFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes mmShareFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes mmShareSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes mmShareSlideDown {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(24px); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .share-fab { display: flex; }
    .mm-share-btn-desktop { display: none; }
}

@media (max-width: 480px) {
    .mm-share-modal { padding: 1.25rem; }
    .mm-share-qr img { width: 150px; height: 150px; }
    .mm-social-btn { width: 40px; height: 40px; font-size: 1rem; }
    .mm-share-btn-sm { font-size: 0.75rem; padding: 0.35rem 0.7rem; }
}
