/**
 * KAP Share Widget Styles
 */

.kap-share {
    display: inline-block;
    direction: rtl;
}

.kap-share__wrapper {
    position: relative;
    display: inline-block;
}

/* ─── Toggle Button ──────────────────────── */
.kap-share__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: #f1f1f1;
    color: #333;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: filter 0.2s, transform 0.15s;
    white-space: nowrap;
    direction: rtl;
}


.kap-share__toggle:active {
    transform: scale(0.97);
}

.kap-share__toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.kap-share__toggle-icon img {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
}

/* ─── Dropdown ───────────────────────────── */
.kap-share__dropdown {
    position: absolute;
    right: 0;
    z-index: 999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    min-width: 160px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    direction: rtl;
}

/* باز شدن به بالا */
.kap-share__dropdown--top .kap-share__dropdown {
    bottom: calc(100% + 8px);
    top: auto;
}

/* باز شدن به پایین */
.kap-share__dropdown--bottom .kap-share__dropdown {
    top: calc(100% + 8px);
    bottom: auto;
}

.kap-share__dropdown.kap-share__dropdown--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ─── Items ──────────────────────────────── */
.kap-share__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    background: #fff;
    border: none;
    width: 100%;
    text-align: right;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s;
    white-space: nowrap;
    box-sizing: border-box;
}

.kap-share__item:hover {
    background-color: #f5f5f5;
}

.kap-share__item + .kap-share__item {
    border-top: 1px solid #f0f0f0;
}

.kap-share__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.kap-share__item-icon img {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
}

.kap-share__item-label {
    flex: 1;
}

/* ─── Copy success state ─────────────────── */
.kap-share__item--copy-success .kap-share__item-label {
    color: #22c55e;
    font-weight: 700;
}
