/* ═══════════════════════════════════════════════════════════════════════════
   TWS NLP Search Bar — natural language + speech-to-text search
   ═══════════════════════════════════════════════════════════════════════════ */

.tws-nlp-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #f8f9fb;
    border: 1px solid #dde1e6;
    border-radius: 10px;
    position: relative;
}

/* ── Input ─────────────────────────────────────────────────────────────── */

.tws-nlp-input-wrap {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tws-nlp-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.4;
    border: 1px solid #c4c9d0;
    border-radius: 8px;
    background: #fff;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tws-nlp-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}
.tws-nlp-input::placeholder {
    color: #8c919a;
    font-style: italic;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.tws-nlp-submit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #0073aa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}
.tws-nlp-submit:hover {
    background: #005a87;
}
.tws-nlp-submit:active {
    transform: scale( 0.97 );
}
.tws-nlp-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.tws-nlp-submit svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ── Microphone Button ─────────────────────────────────────────────────── */

.tws-nlp-mic {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #c4c9d0;
    border-radius: 50%;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}
.tws-nlp-mic:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #f0f7fc;
}
.tws-nlp-mic svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Active / listening state */
.tws-nlp-mic--active {
    color: #fff;
    background: #e74c3c;
    border-color: #e74c3c;
    animation: tws-mic-pulse 1.2s ease-in-out infinite;
}
.tws-nlp-mic--active:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

@keyframes tws-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

/* ── Spinner ───────────────────────────────────────────────────────────── */

.tws-nlp-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #dde1e6;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: tws-nlp-spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes tws-nlp-spin {
    to { transform: rotate( 360deg ); }
}

/* ── Status Message ────────────────────────────────────────────────────── */

.tws-nlp-status {
    display: none;
    flex-basis: 100%;
    margin-top: 4px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.4;
    border-radius: 6px;
}
.tws-nlp-status--info {
    color: #31708f;
    background: #d9edf7;
}
.tws-nlp-status--success {
    color: #3c763d;
    background: #dff0d8;
}
.tws-nlp-status--error {
    color: #a94442;
    background: #f2dede;
}

/* ── AI badge ──────────────────────────────────────────────────────────── */

.tws-nlp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #7c3aed;
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    border-radius: 4px;
    flex-shrink: 0;
    user-select: none;
}
.tws-nlp-badge svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media ( max-width: 600px ) {
    .tws-nlp-bar {
        padding: 10px 12px;
    }
    .tws-nlp-input {
        font-size: 14px;
        padding: 9px 12px;
    }
    .tws-nlp-submit {
        padding: 9px 14px;
        font-size: 13px;
    }
}

/* ── Mini search variant ───────────────────────────────────────────────── */

.reso-mini-search-widget .tws-nlp-bar {
    margin-bottom: 12px;
    background: transparent;
    border-color: rgba(255,255,255,0.2);
}
.reso-mini-search-widget .tws-nlp-input {
    background: rgba(255,255,255,0.95);
}

/* ── Divider between NLP bar and regular form ──────────────────────────── */

.tws-nlp-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 12px;
    font-size: 12px;
    color: #8c919a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tws-nlp-divider::before,
.tws-nlp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dde1e6;
}
