/**
 * TUH WhatsApp - Widget Label (shortcode/filter label)
 *
 * @package TUH_WhatsApp
 * @since 2.1.0
 */

/* ===== Base Label ===== */
.tuh-whatsapp-label {
    position: absolute;
    bottom: 50%;
    transform: translateY(50%);
    background: var(--tuh-whatsapp-label-bg, #fff);
    color: var(--tuh-whatsapp-label-text, #333);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: var(--tuh-whatsapp-label-width, 160px);
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    direction: inherit;
}

.tuh-whatsapp-wrapper:hover .tuh-whatsapp-label,
.tuh-whatsapp-label.visible {
    opacity: 1;
}

.tuh-whatsapp-label strong {
    font-weight: 700;
}

/* ===== Position: Right (default) ===== */
.tuh-whatsapp-label {
    right: 100%;
    margin-right: 15px;
}

.tuh-whatsapp-label::before {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--tuh-whatsapp-label-bg, #fff);
}

/* ===== Position: Left ===== */
.tuh-whatsapp-bottom-left .tuh-whatsapp-label {
    right: auto;
    left: 100%;
    margin-right: 0;
    margin-left: 15px;
}

.tuh-whatsapp-bottom-left .tuh-whatsapp-label::before {
    left: auto;
    right: 100%;
    border-left-color: transparent;
    border-right-color: var(--tuh-whatsapp-label-bg, #fff);
}

/* ===== Auto-show animation ===== */
@keyframes tuhLabelShow {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

.tuh-whatsapp-label.auto-show {
    animation: tuhLabelShow 5s ease forwards;
}

/* ===== RTL Support ===== */
[dir="rtl"] .tuh-whatsapp-label {
    right: auto;
    left: 100%;
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .tuh-whatsapp-label::before {
    left: auto;
    right: 100%;
    border-left-color: transparent;
    border-right-color: var(--tuh-whatsapp-label-bg, #fff);
}

[dir="rtl"] .tuh-whatsapp-bottom-left .tuh-whatsapp-label {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .tuh-whatsapp-bottom-left .tuh-whatsapp-label::before {
    right: auto;
    left: 100%;
    border-right-color: transparent;
    border-left-color: var(--tuh-whatsapp-label-bg, #fff);
}
