/* ===== Bilashi Bazar Voice Search (voice-search.css) ===== */

/* ---------- Mic button (desktop + mobile) ---------- */
.vs-btn {
    position: relative;
    display: inline-flex !important;       /* সব স্ক্রিনে সবসময় দেখাবে */
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    min-height: 42px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: linear-gradient(135deg, #ff8a2b 0%, #ff6b00 55%, #e85d00 100%);
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: filter .2s ease, transform .15s ease;
}
.vs-btn:hover { filter: brightness(1.07); }
.vs-btn:active { transform: scale(.94); }
.vs-btn:focus-visible { outline: 2px solid #0b1f4b; outline-offset: 2px; }
.vs-btn svg { position: relative; z-index: 2; width: 22px; height: 22px; }

/* হালকা পালস (idle) */
.vs-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .3);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    animation: vsIdle 3s ease-out infinite;
}
.vs-btn.is-listening::before { animation-duration: 1.1s; }
@keyframes vsIdle {
    0%   { transform: scale(.2); opacity: .55; }
    70%, 100% { transform: scale(1.7); opacity: 0; }
}

/* মোবাইল সার্চ বার: ইনপুট | মাইক | সার্চ সবসময় এক সারিতে (খাড়া বা আড়া দুই অবস্থায়) */
.mobile-search form {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}
.vs-mbar {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}
.vs-mbar .msearch_keyword {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: 42px;
    margin: 0 !important;
    position: static !important;
    box-sizing: border-box;
}
.vs-mbar button {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 42px !important;
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px !important;
    cursor: pointer;
}
.vs-mbar button[type="submit"] { background: #ff6b00; color: #fff; }
.vs-mbar button svg { width: 20px; height: 20px; }

/* ডেস্কটপ: ইনপুট ও সার্চ বাটনের মাঝখানে */
.search-input-group .vs-btn { border-radius: 0; }

/* ---------- Listening sheet ---------- */
.vs-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(11, 31, 75, .55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.vs-overlay.show { display: flex; animation: vsFade .2s ease; }
@keyframes vsFade { from { opacity: 0; } to { opacity: 1; } }

.vs-sheet {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 26px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-radius: 22px 22px 0 0;
    text-align: center;
    font-family: inherit;
    animation: vsUp .3s cubic-bezier(.2, .8, .2, 1);
}
@keyframes vsUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) {
    .vs-overlay { align-items: center; }
    .vs-sheet { border-radius: 22px; }
}

.vs-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #f6f7fb;
    color: #3b3f4a;
    font-size: 20px;
    line-height: 34px;
    cursor: pointer;
}

.vs-orb { position: relative; width: 96px; height: 96px; margin: 6px auto 10px; }
.vs-orb .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 107, 0, .25);
    opacity: 0;
}
.vs-sheet.listening .ring { animation: vsRing 1.9s ease-out infinite; }
.vs-sheet.listening .ring:nth-child(2) { animation-delay: .6s; }
.vs-sheet.listening .ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes vsRing { 0% { transform: scale(.9); opacity: .75; } 100% { transform: scale(2.2); opacity: 0; } }

.vs-core {
    position: absolute;
    inset: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #ff8a2b, #e85d00);
    box-shadow: 0 8px 22px rgba(255, 107, 0, .4);
}
.vs-core svg { width: 32px; height: 32px; }
.vs-sheet.searching .vs-core { animation: vsThink .9s ease-in-out infinite; }
@keyframes vsThink { 0%, 100% { transform: scale(1); } 50% { transform: scale(.9); } }
.vs-sheet.error .vs-core { background: linear-gradient(135deg, #8a8f9c, #5c616e); box-shadow: none; }

/* সাউন্ড বার */
.vs-bars { display: flex; gap: 4px; align-items: center; justify-content: center; height: 24px; margin-bottom: 8px; }
.vs-bars i { width: 4px; height: 6px; border-radius: 3px; background: #ff6b00; opacity: .3; }
.vs-sheet.listening .vs-bars i { opacity: 1; animation: vsBar 1s ease-in-out infinite; }
.vs-bars i:nth-child(2) { animation-delay: .12s !important; }
.vs-bars i:nth-child(3) { animation-delay: .24s !important; }
.vs-bars i:nth-child(4) { animation-delay: .36s !important; }
.vs-bars i:nth-child(5) { animation-delay: .48s !important; }
@keyframes vsBar { 0%, 100% { height: 6px; } 50% { height: 24px; } }

.vs-status { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: #0b1f4b; }
.vs-text {
    min-height: 26px;
    margin: 0 0 14px;
    padding: 0 6px;
    font-size: 16px;
    color: #3b3f4a;
    word-break: break-word;
}
.vs-text.interim { color: #8a8f9c; }

.vs-langs { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; background: #f6f7fb; }
.vs-langs button {
    border: 0;
    padding: 6px 16px;
    border-radius: 999px;
    background: transparent;
    color: #3b3f4a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.vs-langs button.active { background: #ff6b00; color: #fff; }
.vs-hint { margin: 10px 0 0; font-size: 12px; color: #8a8f9c; }

.vs-retry {
    display: none;
    margin: 14px auto 0;
    padding: 10px 26px;
    border: 0;
    border-radius: 999px;
    background: #ff6b00;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.vs-sheet.error .vs-retry { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
    .vs-btn::before, .vs-ring, .vs-sheet *, .vs-sheet { animation: none !important; }
}
