/* =============================================================
   sharegrids.css — Share Menu: Neon 3D Glassmorphism Edition
   Fixes: icon spacing · menu above grid · neon animation
   ============================================================= */

/* ── Card base ─────────────────────────────────────────── */
.amk-card {
    position: relative;
    cursor: pointer;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.4),
        inset 0 0 0 1px rgba(255,255,255,0.05);
    transition:
        transform 0.35s cubic-bezier(.25,.8,.25,1),
        box-shadow 0.35s ease;
    overflow: hidden;
}

.amk-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 24px 64px rgba(0,0,0,0.55),
        inset 0 0 0 1px rgba(255,255,255,0.1);
}

/* Allow card to reveal the share menu above it */
.amk-card:has(.amk-share-menu:not([hidden])) {
    overflow: visible;
    z-index: 50;
}

.amk-card__inner {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.amk-card__media { position: relative; }

.amk-card__content {
    background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.08));
    padding: 12px 14px;
    top: auto !important;
    bottom: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Invisible full-card link layer */
.amk-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ── Action buttons area ────────────────────────────────── */
.amk-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 20;
    pointer-events: auto;
}

.amk-fav-btn,
.amk-share-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(10,8,20,0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 4px 14px rgba(0,0,0,0.45);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.amk-fav-btn:hover,
.amk-share-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 20px rgba(0,0,0,0.55);
}

.amk-fav-btn svg,
.amk-share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ── Share wrap — anchor for the floating menu ──────────── */
.amk-share-wrap {
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

/* ── Share menu — ABOVE the card ───────────────────────── */
.amk-share-menu {
    position: absolute;
    /* Push menu above the card: sits above the action buttons */
    bottom: calc(100% + 10px);
    right: 0;

    display: flex;
    flex-direction: row;
    gap: 6px;                 /* ← tighter, even spacing between icons */
    padding: 8px 10px;
    border-radius: 14px;

    /* ── Neon 3D Glassmorphism ── */
    background: rgba(8, 4, 22, 0.72);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);

    border: 1px solid rgba(140,80,255,0.35);

    box-shadow:
        0 0 0 1px rgba(100,40,255,0.2),
        0 8px 32px rgba(0,0,0,0.6),
        0 0 24px rgba(120,60,255,0.25),  /* soft neon purple outer glow */
        inset 0 1px 0 rgba(255,255,255,0.12),
        inset 0 -1px 0 rgba(100,40,255,0.15);

    /* Hidden state */
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px) scale(0.94);
    transform-origin: bottom right;
    transition:
        opacity 0.22s ease,
        transform 0.26s cubic-bezier(.34,1.56,.64,1);

    /* Stay above the grid */
    z-index: 9999;
    white-space: nowrap;
}

/* Neon ambient pulse animation on the menu border */
@keyframes amk-neon-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(100,40,255,0.2),
            0 8px 32px rgba(0,0,0,0.6),
            0 0 24px rgba(120,60,255,0.25),
            inset 0 1px 0 rgba(255,255,255,0.12),
            inset 0 -1px 0 rgba(100,40,255,0.15);
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(160,80,255,0.45),
            0 8px 32px rgba(0,0,0,0.6),
            0 0 38px rgba(160,80,255,0.45),
            inset 0 1px 0 rgba(255,255,255,0.18),
            inset 0 -1px 0 rgba(140,60,255,0.25);
    }
}

/* Visible / open state */
.amk-share-menu:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    animation: amk-neon-pulse 2.4s ease-in-out infinite;
}

/* ── Share icon links ───────────────────────────────────── */
.amk-share-menu a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    transition:
        background 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
    flex-shrink: 0;
    text-decoration: none;
}

.amk-share-menu svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Brand colors with neon glow on hover */
.amk-share-menu a:nth-child(1) { color: #4b9eff; }  /* Facebook  */
.amk-share-menu a:nth-child(2) { color: #e8e8e8; }  /* X/Twitter */
.amk-share-menu a:nth-child(3) { color: #ff6bae; }  /* Instagram */
.amk-share-menu a:nth-child(4) { color: #25d366; }  /* WhatsApp  */
.amk-share-menu a:nth-child(5) { color: #5ba4f5; }  /* LinkedIn  */
.amk-share-menu a:nth-child(6) { color: #aaa; }     /* Copy link */

.amk-share-menu a:nth-child(1):hover { background: rgba(75,158,255,0.18); box-shadow: 0 0 10px rgba(75,158,255,0.45); transform: translateY(-2px); }
.amk-share-menu a:nth-child(2):hover { background: rgba(232,232,232,0.14); box-shadow: 0 0 10px rgba(232,232,232,0.3); transform: translateY(-2px); }
.amk-share-menu a:nth-child(3):hover { background: rgba(255,107,174,0.18); box-shadow: 0 0 10px rgba(255,107,174,0.5); transform: translateY(-2px); }
.amk-share-menu a:nth-child(4):hover { background: rgba(37,211,102,0.18); box-shadow: 0 0 10px rgba(37,211,102,0.45); transform: translateY(-2px); }
.amk-share-menu a:nth-child(5):hover { background: rgba(91,164,245,0.18); box-shadow: 0 0 10px rgba(91,164,245,0.45); transform: translateY(-2px); }
.amk-share-menu a:nth-child(6):hover { background: rgba(180,180,180,0.14); box-shadow: 0 0 8px rgba(180,180,180,0.3);  transform: translateY(-2px); }

/* ── Grid / section overflow — let the menu escape ─────── */
.amk-grid,
#latestListings,
.amk-section {
    overflow: visible !important;
}

/* ── Card cursor rules ──────────────────────────────────── */
.amk-card-actions,
.amk-card-actions * { cursor: default; }
.amk-share-menu,
.amk-share-menu a,
.amk-share-menu svg { cursor: pointer; }

/* ── Sold badge ─────────────────────────────────────────── */
.amk-sold-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 11 !important;
}


/* ── Compact sizing ────────────────────────────────────── */
.amk-share-menu {
    padding: 6px 8px;
    gap: 5px;
    border-radius: 12px;
    /* CRITICAL: use flex (not inline-flex) so width = content only */
    display: flex;
    width: max-content;
}

.amk-share-menu a {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.amk-share-menu svg {
    width: 13px;
    height: 13px;
}

/* Kill any pseudo-element artifacts */
.amk-share-menu::before,
.amk-share-menu::after {
    content: none !important;
    display: none !important;
}