/**
 * Web Share Button Styles
 * Sikkim Supreme / Bricks Builder Custom Element
 */

/* ==========================================================================
   1. BUTTON WRAPPER & CONTAINER
   ========================================================================== */
.bsec-share-btn-wrap {
    display: flex;
    align-items: center;
    width: 100%;
}

.bsec-share-btn-wrap--left {
    justify-content: flex-start;
}

.bsec-share-btn-wrap--center {
    justify-content: center;
}

.bsec-share-btn-wrap--right {
    justify-content: flex-end;
}

/* ==========================================================================
   2. BUTTON BASE STYLES
   ========================================================================== */
.bsec-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 9999px;
    padding: 10px 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;
    position: relative;
    background-color: #1b4d3e;
    color: #ffffff;
}

.bsec-share-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.bsec-share-btn:active {
    transform: translateY(0) scale(0.98);
}

.bsec-share-btn:focus-visible {
    outline: 2px solid #1b4d3e;
    outline-offset: 3px;
}

/* Full Width */
.bsec-share-btn--full {
    width: 100%;
}

/* Sizes */
.bsec-share-btn--sm {
    padding: 7px 14px;
    font-size: 12px;
    gap: 6px;
}

.bsec-share-btn--md {
    padding: 10px 20px;
    font-size: 14px;
    gap: 8px;
}

.bsec-share-btn--lg {
    padding: 13px 26px;
    font-size: 16px;
    gap: 10px;
}

/* Presets */
.bsec-share-btn--primary {
    background-color: #1b4d3e;
    color: #ffffff;
    border-color: transparent;
}
.bsec-share-btn--primary:hover {
    background-color: #153c30;
    color: #ffffff;
}

.bsec-share-btn--outline {
    background-color: transparent;
    color: #1b4d3e;
    border-color: #1b4d3e;
}
.bsec-share-btn--outline:hover {
    background-color: #1b4d3e;
    color: #ffffff;
}

.bsec-share-btn--soft {
    background-color: rgba(27, 77, 62, 0.08);
    color: #1b4d3e;
    border-color: transparent;
}
.bsec-share-btn--soft:hover {
    background-color: rgba(27, 77, 62, 0.16);
    color: #153c30;
}

.bsec-share-btn--ghost {
    background-color: transparent;
    color: #334155;
    border-color: transparent;
}
.bsec-share-btn--ghost:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #0f172a;
}

/* Icons */
.bsec-share-btn .bsec-share-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.bsec-share-btn .bsec-share-icon-wrap svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
    transition: transform 0.2s ease;
}

.bsec-share-btn:hover .bsec-share-icon-wrap svg {
    transform: scale(1.05);
}

.bsec-share-btn--icon-right {
    flex-direction: row-reverse;
}

/* Copied feedback state on button */
.bsec-share-btn.is-copied {
    background-color: #10b981 !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

/* ==========================================================================
   3. FLOATING TOAST NOTIFICATION
   ========================================================================== */
.bsec-share-toast {
    position: fixed;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #0f172a;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 9999px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.25s;
}

.bsec-share-toast svg {
    width: 16px;
    height: 16px;
    fill: #10b981;
    flex-shrink: 0;
}

/* Positions */
.bsec-share-toast--bottom-center {
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 16px) scale(0.96);
}
.bsec-share-toast--bottom-center.is-active {
    transform: translate(-50%, 0) scale(1);
}

.bsec-share-toast--top-center {
    top: 24px;
    left: 50%;
    transform: translate(-50%, -16px) scale(0.96);
}
.bsec-share-toast--top-center.is-active {
    transform: translate(-50%, 0) scale(1);
}

.bsec-share-toast--bottom-right {
    bottom: 24px;
    right: 24px;
    transform: translateY(16px) scale(0.96);
}
.bsec-share-toast--bottom-right.is-active {
    transform: translateY(0) scale(1);
}

.bsec-share-toast--top-right {
    top: 24px;
    right: 24px;
    transform: translateY(-16px) scale(0.96);
}
.bsec-share-toast--top-right.is-active {
    transform: translateY(0) scale(1);
}

.bsec-share-toast.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ==========================================================================
   4. SOCIAL SHARE MODAL / POPUP
   ========================================================================== */
.bsec-share-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.bsec-share-modal-card {
    background-color: #ffffff;
    color: #1e293b;
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.05);
    transform: scale(0.94) translateY(8px);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    box-sizing: border-box;
}

.bsec-share-modal-overlay.is-active .bsec-share-modal-card {
    transform: scale(1) translateY(0);
}

.bsec-share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.bsec-share-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.bsec-share-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #64748b;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.bsec-share-modal-close:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.bsec-share-modal-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Grid of Social Channels */
.bsec-share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 10px;
    margin-bottom: 22px;
}

.bsec-share-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #475569;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 4px;
    transition: transform 0.15s ease, color 0.15s ease;
}

.bsec-share-channel:hover {
    transform: translateY(-2px);
    color: #0f172a;
}

.bsec-share-channel-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.15s ease;
}

.bsec-share-channel:hover .bsec-share-channel-icon {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.bsec-share-channel-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Channel Brand Colors */
.bsec-share-channel--whatsapp .bsec-share-channel-icon { background: #25D366; }
.bsec-share-channel--twitter .bsec-share-channel-icon { background: #000000; }
.bsec-share-channel--facebook .bsec-share-channel-icon { background: #1877F2; }
.bsec-share-channel--linkedin .bsec-share-channel-icon { background: #0A66C2; }
.bsec-share-channel--telegram .bsec-share-channel-icon { background: #24A1DE; }
.bsec-share-channel--pinterest .bsec-share-channel-icon { background: #E60023; }
.bsec-share-channel--email .bsec-share-channel-icon { background: #64748B; }
.bsec-share-channel--copy .bsec-share-channel-icon { background: #1B4D3E; }

/* Copy Link Bar at Bottom of Modal */
.bsec-share-copy-bar {
    display: flex;
    align-items: center;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px 4px 4px 12px;
    gap: 8px;
}

.bsec-share-copy-input {
    flex: 1;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 13px;
    outline: none;
    min-width: 0;
    text-overflow: ellipsis;
    font-family: inherit;
}

.bsec-share-copy-btn {
    background-color: #1b4d3e;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.bsec-share-copy-btn:hover {
    background-color: #153c30;
}

.bsec-share-copy-btn.is-copied {
    background-color: #10b981;
}

@media (max-width: 480px) {
    .bsec-share-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px 6px;
    }
    .bsec-share-channel-icon {
        width: 40px;
        height: 40px;
    }
    .bsec-share-channel-icon svg {
        width: 20px;
        height: 20px;
    }
    .bsec-share-modal-card {
        padding: 20px 16px;
    }
}
