/* =========================================================
   SHARE CENTER
   Scoped styles only
   ========================================================= */

.share-center-overlay {
    position: fixed;
    inset: 0;

    z-index: 99999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(15, 23, 42, 0.58);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    overflow-y: auto;
}

.share-center-overlay.active {
    display: flex;
}


/* =========================================================
   MODAL
   ========================================================= */

.share-center-modal {
    width: min(520px, 100%);

    max-height: calc(100vh - 40px);

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 25px;

    border: 1px solid #e2e8f0;
    border-radius: 18px;

    background: #fff;

    box-shadow:
        0 30px 70px rgba(15, 23, 42, 0.22);

    scrollbar-width: thin;
}


/* =========================================================
   HEADER
   ========================================================= */

.share-center-header {
    position: relative;

    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding-right: 38px;
    margin-bottom: 20px;
}

.share-center-header-icon {
    width: 42px;
    height: 42px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: #eef2ff;

    font-size: 18px;
}

.share-center-header-copy {
    min-width: 0;
}

.share-center-title {
    margin: 0;

    color: #111827;

    font-size: 20px;
    line-height: 1.3;
    font-weight: 820;

    letter-spacing: -0.025em;
}

.share-center-subtitle {
    margin: 5px 0 0;

    color: #64748b;

    font-size: 11px;
    line-height: 1.55;
}

.share-center-close-icon {
    position: absolute;

    top: -3px;
    right: 0;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #e2e8f0;
    border-radius: 50%;

    background: #fff;
    color: #64748b;

    font-size: 14px;

    cursor: pointer;
}

.share-center-close-icon:hover {
    background: #f8fafc;
    color: #111827;
}


/* =========================================================
   META INFORMATION
   ========================================================= */

.share-center-info {
    margin-bottom: 18px;
    padding: 5px 14px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #f8fafc;
}

.share-center-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    min-height: 42px;

    padding: 9px 0;
}

.share-center-meta-row:not(:last-child) {
    border-bottom: 1px solid #e2e8f0;
}

.share-center-meta-label {
    flex: 0 0 auto;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;
}

.share-center-meta-value {
    min-width: 0;

    color: #111827;

    font-size: 11px;
    font-weight: 800;

    text-align: right;

    overflow-wrap: anywhere;
}


/* =========================================================
   SHARE LINK
   ========================================================= */

.share-center-link-section {
    margin-bottom: 19px;
}

.share-center-label {
    display: block;

    margin-bottom: 7px;

    color: #334155;

    font-size: 11px;
    font-weight: 750;
}

.share-center-link-box {
    display: flex;

    gap: 7px;
}

.share-center-link-input {
    min-width: 0;
    flex: 1;

    height: 44px;

    padding: 0 12px;

    border: 1px solid #dbe1ea;
    border-radius: 9px;

    background: #f8fafc;
    color: #334155;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    font-size: 10px;

    outline: none;
}

.share-center-link-input:focus {
    border-color: #6366f1;

    box-shadow:
        0 0 0 3px rgba(99,102,241,.11);
}

.share-center-inline-copy {
    width: 44px;
    height: 44px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #dbe1ea;
    border-radius: 9px;

    background: #fff;

    cursor: pointer;
}

.share-center-inline-copy:hover {
    background: #f8fafc;
}


/* =========================================================
   QR
   ========================================================= */

.share-center-qr-section {
    margin-bottom: 20px;

    text-align: center;
}

.share-center-qr-label {
    margin-bottom: 9px;

    color: #334155;

    font-size: 11px;
    font-weight: 750;
}

.share-center-qr-frame {
    width: fit-content;

    max-width: 100%;

    margin: 0 auto;
    padding: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 13px;

    background: #fff;

    box-shadow:
        0 5px 14px rgba(15, 23, 42, .05);
}

#shareQR {
    display: flex;
    align-items: center;
    justify-content: center;

    max-width: 100%;
}

#shareQR img,
#shareQR canvas {
    display: block;

    width: min(190px, 60vw) !important;
    height: auto !important;

    max-width: 100%;
}

.share-center-qr-help {
    margin: 8px 0 0;

    color: #94a3b8;

    font-size: 9px;
    line-height: 1.5;
}


/* =========================================================
   ACTIONS
   ========================================================= */

.share-center-actions {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.share-center-action {
    min-height: 43px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 9px 10px;

    border: 1px solid #dbe1ea;
    border-radius: 9px;

    background: #fff;
    color: #334155;

    font: inherit;

    font-size: 10px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.share-center-action:hover {
    transform: translateY(-1px);
}

.share-center-action.copy {
    background: #111827;
    color: #fff;

    border-color: #111827;
}

.share-center-action.copy:hover {
    background: #000;
}

.share-center-action.whatsapp {
    border-color: #bbf7d0;

    background: #f0fdf4;
    color: #15803d;
}

.share-center-action.whatsapp:hover {
    background: #dcfce7;
}

.share-center-action.native {
    border-color: #c7d2fe;

    background: #eef2ff;
    color: #4338ca;
}

.share-center-action.native:hover {
    background: #e0e7ff;
}

.share-center-action.download {
    background: #f8fafc;
}

.share-center-action.open {
    grid-column: 1 / -1;

    background: #fff;
    color: #111827;
}


/* =========================================================
   FOOTER
   ========================================================= */

.share-center-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    margin-top: 18px;
    padding-top: 15px;

    border-top: 1px solid #e2e8f0;

    color: #94a3b8;

    font-size: 9px;
    line-height: 1.5;
}

.share-center-dismiss {
    flex: 0 0 auto;

    padding: 7px 11px;

    border: 1px solid #dbe1ea;
    border-radius: 8px;

    background: #fff;
    color: #475569;

    font-size: 10px;
    font-weight: 750;

    cursor: pointer;
}

.share-center-dismiss:hover {
    background: #f8fafc;
}


/* =========================================================
   TOAST
   ========================================================= */

.share-center-toast,
#toast {
    position: fixed;

    left: 50%;
    bottom: 24px;

    z-index: 100000;

    max-width: min(420px, calc(100vw - 28px));

    padding: 11px 15px;

    border-radius: 10px;

    background: #111827;
    color: #fff;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;

    text-align: center;

    transform:
        translate(-50%, 20px);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    box-shadow:
        0 12px 30px rgba(15, 23, 42, .24);

    transition:
        opacity .2s ease,
        transform .2s ease,
        visibility .2s ease;
}

.share-center-toast.show,
#toast.show {
    opacity: 1;
    visibility: visible;

    transform:
        translate(-50%, 0);
}


/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (max-width: 560px) {

    .share-center-overlay {
        align-items: flex-end;

        padding: 10px;
    }

    .share-center-modal {
        width: 100%;

        max-height: calc(100vh - 20px);

        padding: 20px 16px;

        border-radius:
            17px
            17px
            12px
            12px;
    }

    .share-center-title {
        font-size: 18px;
    }

    .share-center-meta-row {
        align-items: flex-start;
        flex-direction: column;

        gap: 3px;
    }

    .share-center-meta-value {
        text-align: left;
    }

    .share-center-actions {
        grid-template-columns: 1fr 1fr;
    }

    .share-center-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .share-center-dismiss {
        width: 100%;
        min-height: 40px;
    }
}

@media (max-width: 360px) {

    .share-center-actions {
        grid-template-columns: 1fr;
    }

    .share-center-action.open {
        grid-column: auto;
    }
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.share-center-action:focus-visible,
.share-center-inline-copy:focus-visible,
.share-center-close-icon:focus-visible,
.share-center-dismiss:focus-visible {
    outline: 3px solid rgba(99, 102, 241, .27);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    .share-center-action,
    .share-center-toast,
    #toast {
        transition: none;
    }
}