/*
 * Himer Tamil Input – tamil-input.css  v1.2.0
 */

/* ── Field wrapper ── */
.hti-field-wrap {
    position: relative;
    display: block;
    width: 100%;
}

/* ── Toggle button (on plain textareas/inputs) ── */
.hti-toggle {
    position: absolute;
    top: 6px;
    right: 10px;
    z-index: 200;
    padding: 2px 8px;
    font-family: 'Latha', 'Vijaya', 'Tamil Sangam MN', 'Noto Sans Tamil', serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    color: #444;
    background: #f0f0f0;
    border: 1px solid #bbb;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    user-select: none;
}
.hti-toggle:hover {
    background: #e0e0e0;
    border-color: #999;
}
.hti-toggle--active {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}
.hti-toggle--active:hover {
    background: #1d4ed8;
}

/* ── TinyMCE Visual tab toggle button ── */
/* Sits inside .wp-editor-tabs alongside Visual/Text buttons */
.hti-toggle--tinymce {
    position: static !important;
    display: inline-block;
    vertical-align: middle;
    margin: 0 0 0 4px;
    padding: 1px 7px;
    font-size: 13px;
    border-radius: 3px;
    /* Match WordPress editor tab button style */
    height: 26px;
    line-height: 24px;
    border-top: 1px solid #999;
    border-bottom: 1px solid #999;
    border-left: 1px solid #999;
    border-right: 1px solid #999;
}

/* ── Suggestion popup ── */
#hti-popup {
    display: none;
    position: absolute;
    z-index: 99999;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 18px rgba(0,0,0,.14);
    padding: 4px 0;
    min-width: 130px;
    max-width: 320px;
    font-family: 'Latha', 'Vijaya', 'Tamil Sangam MN', 'Noto Sans Tamil', sans-serif;
    font-size: 16px;
    line-height: 1.5;
}
.hti-suggestion {
    padding: 6px 16px;
    cursor: pointer;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.1s;
}
.hti-suggestion:hover,
.hti-suggestion--active {
    background: #eff6ff;
    color: #2563eb;
}

/* ── Toast ── */
#hti-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    z-index: 999999;
    padding: 8px 22px;
    background: rgba(20,20,20,.88);
    color: #fff;
    font-size: 13px;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    font-family: 'Latha', 'Vijaya', 'Tamil Sangam MN', sans-serif;
    white-space: nowrap;
}
#hti-toast.hti-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    .hti-toggle { background:#2a2a2a; color:#ccc; border-color:#555; }
    .hti-toggle:hover { background:#3a3a3a; }
    .hti-toggle--active { background:#2563eb; color:#fff; border-color:#1d4ed8; }
    #hti-popup { background:#1e1e1e; border-color:#444; }
    .hti-suggestion { color:#ddd; }
    .hti-suggestion:hover, .hti-suggestion--active { background:#2d3748; color:#93c5fd; }
}

/* ── RTL ── */
[dir="rtl"] .hti-toggle { right:auto; left:10px; }
