/* ===================================================
   AITD Search Widget Styles
   Shortcode: [ai_tools_search_widget]
=================================================== */

.aitd-search-widget {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    font-family: inherit;
}

/* ── Form layout ── */
.aitd-sw-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Stacked mode: sab kuch ek ke neeche ek */
.aitd-sw-stacked .aitd-sw-form {
    flex-direction: column;
    align-items: stretch;
}

/* ── Search input wrap ── */
.aitd-sw-input-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.aitd-sw-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.aitd-sw-input {
    width: 100%;
    height: 48px;
    padding: 0 42px 0 44px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #1e293b;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}

.aitd-sw-input:focus {
    border-color: #0093ff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}

.aitd-sw-input::placeholder { color: #94a3b8; }

/* Clear button */
.aitd-sw-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 14px;
    padding: 4px;
    line-height: 1;
    transition: color .15s;
}
.aitd-sw-clear:hover { color: #ef4444; }

/* ── Search button ── */
.aitd-sw-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 48px;
    padding: 0 22px;
    background: linear-gradient(135deg, #0093ff, #0077d9);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s, transform .1s;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}
.aitd-sw-btn:hover  { opacity: .88; }
.aitd-sw-btn:active { transform: scale(.97); }

.aitd-sw-stacked .aitd-sw-btn {
    width: 100%;
    justify-content: center;
}

/* ── Optional filters ── */
.aitd-sw-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 2px;
}

/* Pricing pills */
.aitd-sw-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.aitd-sw-pill {
    padding: 5px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.aitd-sw-pill:hover,
.aitd-sw-pill.active {
    background: #0093ff;
    border-color: #0093ff;
    color: #fff;
}

/* Category dropdown */
.aitd-sw-category {
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
}
.aitd-sw-category:focus { border-color: #0093ff; }

/* ── Status line ── */
.aitd-sw-status {
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    min-height: 20px;
}

/* ── Dark mode (plugin ke body[data-aitd-theme] ke saath sync) ── */
body[data-aitd-theme="dark"] .aitd-sw-input,
body[data-aitd-theme="dark"] .aitd-sw-category,
body[data-aitd-theme="dark"] .aitd-sw-pill {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
body[data-aitd-theme="dark"] .aitd-sw-input::placeholder { color: #64748b; }
body[data-aitd-theme="dark"] .aitd-sw-pill.active {
    background: #0093ff;
    border-color: #0093ff;
    color: #fff;
}

/* ── Responsive ── */
@media (max-width: 540px) {
    .aitd-sw-input-wrap { min-width: 100%; }
    .aitd-sw-btn        { width: 100%; justify-content: center; }
    .aitd-sw-form       { flex-direction: column; }
}
