/**
 * Share Button Styles
 *
 * @package BakeMyWP
 */

.bmwp-share-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.bmwp-share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: var(--dian-spacing-16) var(--dian-spacing-24);
    background: var(--surface-0);
    border: 1px solid var(--contrast);
    color: var(--contrast);
    cursor: pointer;
    box-shadow: var(--dian-box-shadow);
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.bmwp-share-button:hover {
    background: var(--dian-hover-btn-bg);
    border-color: var(--primary);
    transition: all 0.2s ease;
}

.bmwp-share-button:focus {
    background: var(--dian-hover-btn-bg);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.bmwp-share-button svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.share-title {
    font-family: var(--dian-bague-medium);
    font-size: var(--dian-body-18);
    color: var(--surface-100);
    line-height: var(--dian-line-height-body-sm);
    font-weight: 500;
}

.bmwp-share-button:hover .share-title,
.bmwp-share-button:focus .share-title {
    color: var(--surface-0);
}

.bmwp-share-dropdown {
    position: absolute;
    top: calc(100% + var(--dian-spacing-8));
    left: 0;
    min-width: 100%;
    background-color: var(--surface-0);
    border: 1px solid #d1d1d1;
    box-shadow: var(--dian-box-shadow-subtle);
    padding: 0;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    pointer-events: none;
}

.bmwp-share-dropdown:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.bmwp-share-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: #374151;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.bmwp-share-option span {
    font-family: var(--dian-bague-medium);
}

.bmwp-share-option:hover {
    background: rgba(178, 170, 159, 0.1);
    color: var(--primary);
}

.bmwp-share-option:focus {
    outline: none;
    background-color: var(surface-20);
    color: var(--surface-100);
}

.bmwp-share-option:active {
    background-color: var(surface-20);
    color: var(--surface-100);
}

/* Toast notification for copy feedback */
.bmwp-share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1f2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    pointer-events: none;
}

.bmwp-share-toast.bmwp-share-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media screen and (min-width: 1025px) {
    .bmwp-share-container {
        width: auto;
    }

    .bmwp-share-button {
        width: auto;
        justify-content: flex-start;
    }
}
