/* ================================================
   Forminator Field Tooltips — Frontend Styles
   ================================================ */

/* Wrapper around label text + icon */
.forminator-label,
.forminator-field-label,
label.forminator-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── The ℹ icon ── */
.ft-tooltip-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background-color: #6b7280;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
    transition: background-color 0.2s ease;
    outline: none;
}

.ft-tooltip-icon svg {
    width: 13px;
    height: 13px;
    display: block;
}

.ft-tooltip-icon:hover,
.ft-tooltip-icon:focus {
    background-color: #3b82f6;
}

/* ── The bubble ── */
.ft-tooltip-bubble {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;

    background: #1e293b;
    color: #f8fafc;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.5;
    padding: 7px 11px;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    text-align: left;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);

    transition: opacity 0.18s ease, transform 0.18s ease;
    transform: translateX(-50%) translateY(4px);
}

/* Arrow */
.ft-tooltip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

/* Show state */
.ft-tooltip-icon:hover .ft-tooltip-bubble,
.ft-tooltip-icon:focus .ft-tooltip-bubble,
.ft-tooltip-icon.ft-active .ft-tooltip-bubble {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* RTL support */
[dir="rtl"] .ft-tooltip-bubble {
    text-align: right;
}

/* Mobile: always show below for narrow screens */
@media (max-width: 480px) {
    .ft-tooltip-bubble {
        bottom: auto;
        top: calc(100% + 8px);
        transform: translateX(-50%) translateY(-4px);
    }
    .ft-tooltip-bubble::after {
        top: auto;
        bottom: 100%;
        border-top-color: transparent;
        border-bottom-color: #1e293b;
    }
    .ft-tooltip-icon:hover .ft-tooltip-bubble,
    .ft-tooltip-icon:focus .ft-tooltip-bubble {
        transform: translateX(-50%) translateY(0);
    }
}
