/* ----------------------------------------------------------------
 * AH Sosyal Paylaşım: Share popover + Copy-link toast
 * ---------------------------------------------------------------- */

.ah-share {
    position: relative;
    display: flex;
    justify-content: var(--ah-share-justify, flex-start);
    width: 100%;
}

.ah-share__buttons {
    display: inline-flex;
    align-items: center;
    gap: var(--ah-share-gap, 8px);
}

.ah-share__btn {
    position: relative;
    width: var(--ah-share-size, 40px);
    height: var(--ah-share-size, 40px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    transition: transform .18s ease, background .18s ease, color .18s ease,
                border-color .18s ease, box-shadow .18s ease;
}

.ah-share__btn svg {
    width: calc(var(--ah-share-size, 40px) * 0.5);
    height: calc(var(--ah-share-size, 40px) * 0.5);
    display: block;
}

.ah-share[data-ah-share-variant="solid"] .ah-share__btn {
    background: #111827;
    color: #ffffff;
    border-color: rgba(17, 24, 39, 0.18);
}

.ah-share[data-ah-share-variant="outline"] .ah-share__btn {
    background: transparent;
}

.ah-share__btn:hover,
.ah-share__btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.40);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
    outline: none;
}

.ah-share__btn[aria-expanded="true"] {
    background: #2563eb;
    color: #fff;
    border-color: rgba(37, 99, 235, 0.55);
}

/* Copy button success state */
.ah-share__btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity .18s ease, transform .18s ease;
}

.ah-share__btn-icon--success {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0.6);
    color: #16a34a;
}

.ah-share__btn--copy.is-copied .ah-share__btn-icon--default {
    opacity: 0;
    transform: scale(0.6);
}

.ah-share__btn--copy.is-copied .ah-share__btn-icon--success {
    opacity: 1;
    transform: scale(1);
}

.ah-share__btn--copy.is-copied {
    border-color: rgba(22, 163, 74, 0.55);
}

/* ----------------------------- Popover ----------------------------- */

.ah-share__popover {
    position: absolute;
    top: calc(100% + 10px);
    z-index: 30;
    min-width: 220px;
    max-width: min(320px, calc(100vw - 24px));
    padding: 8px;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    transform-origin: top left;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

/* Anchor popover under the share trigger button. */
.ah-share[data-ah-share-justify] .ah-share__popover {
    left: 0;
}

.ah-share[style*="--ah-share-justify: center"] .ah-share__popover {
    left: 50%;
    transform: translate(-50%, -4px) scale(0.98);
    transform-origin: top center;
}

.ah-share[style*="--ah-share-justify: flex-end"] .ah-share__popover {
    right: 0;
    left: auto;
    transform-origin: top right;
}

.ah-share.is-open .ah-share__popover {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ah-share[style*="--ah-share-justify: center"].is-open .ah-share__popover {
    transform: translate(-50%, 0) scale(1);
}

.ah-share__popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    margin-bottom: 6px;
}

.ah-share__popover-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.65);
}

.ah-share__popover-close {
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: rgba(15, 23, 42, 0.55);
    cursor: pointer;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ah-share__popover-close svg {
    width: 16px;
    height: 16px;
}

.ah-share__popover-close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.ah-share__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
}

.ah-share__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    font-size: 14px;
    transition: background .14s ease, color .14s ease;
}

.ah-share__option:hover,
.ah-share__option:focus-visible {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    outline: none;
}

.ah-share__option-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.ah-share__option-icon svg {
    width: 16px;
    height: 16px;
}

.ah-share__option--facebook:hover .ah-share__option-icon { background: #1877f2; color: #fff; }
.ah-share__option--twitter:hover .ah-share__option-icon  { background: #0f172a; color: #fff; }
.ah-share__option--whatsapp:hover .ah-share__option-icon { background: #25d366; color: #fff; }
.ah-share__option--telegram:hover .ah-share__option-icon { background: #229ed9; color: #fff; }
.ah-share__option--linkedin:hover .ah-share__option-icon { background: #0a66c2; color: #fff; }
.ah-share__option--email:hover .ah-share__option-icon    { background: #f59e0b; color: #fff; }

/* ----------------------------- Toast ----------------------------- */

.ah-share-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(17, 24, 39, 0.96);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.30);
    opacity: 0;
    transform: translate(-50%, 18px);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}

.ah-share-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.ah-share-toast.is-error {
    background: rgba(220, 38, 38, 0.96);
}

.ah-share-toast__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4ade80;
}

.ah-share-toast.is-error .ah-share-toast__icon {
    color: #fee2e2;
}

.ah-share-toast__icon svg {
    width: 18px;
    height: 18px;
}

/* ----------------------------- Dark theme ----------------------------- */

html[data-theme="dark"] .ah-share__btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.30);
}

html[data-theme="dark"] .ah-share[data-ah-share-variant="solid"] .ah-share__btn {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .ah-share__btn:hover,
html[data-theme="dark"] .ah-share__btn:focus-visible {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.40);
}

html[data-theme="dark"] .ah-share__popover {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .ah-share__popover-header {
    border-bottom-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .ah-share__popover-title {
    color: rgba(226, 232, 240, 0.65);
}

html[data-theme="dark"] .ah-share__popover-close {
    color: rgba(226, 232, 240, 0.65);
}

html[data-theme="dark"] .ah-share__popover-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

html[data-theme="dark"] .ah-share__option {
    color: #e2e8f0;
}

html[data-theme="dark"] .ah-share__option:hover,
html[data-theme="dark"] .ah-share__option:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

html[data-theme="dark"] .ah-share__option-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

/* ----------------------------- Mobile ----------------------------- */

@media (max-width: 540px) {
    .ah-share__popover {
        position: fixed;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        bottom: 16px;
        transform: translate(-50%, 20px) scale(1) !important;
        width: calc(100vw - 28px);
        max-width: 420px;
        padding: 12px;
        border-radius: 18px;
    }

    .ah-share.is-open .ah-share__popover {
        transform: translate(-50%, 0) scale(1) !important;
    }

    .ah-share__list {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .ah-share__option {
        padding: 12px 10px;
        font-size: 13px;
        gap: 10px;
    }
}
