/* PlantsHub Voice Search — styles (production-style modal) */

/* ---- In-search-bar buttons ---- */
.phvs-mic-btn, .phvs-cam-btn {
    width: 32px !important; height: 32px !important;
    min-width: 32px !important; min-height: 32px !important;
    max-width: 32px !important; max-height: 32px !important;
    margin: 0 !important; padding: 0 !important;
    border: none !important; border-radius: 50% !important;
    color: #fff !important; cursor: pointer !important;
    z-index: 999999 !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.22) !important;
    line-height: 0 !important; outline: none !important;
    opacity: 1 !important; visibility: visible !important;
    box-sizing: border-box !important; text-decoration: none !important;
    font-size: 0 !important; overflow: visible !important;
}
.phvs-mic-btn { background: #8CBC67 !important; background-color: #8CBC67 !important; }
.phvs-mic-btn:hover { background: #80AB5E !important; background-color: #80AB5E !important; }
.phvs-cam-btn { background: #00796b !important; background-color: #00796b !important; }
.phvs-cam-btn:hover { background: #00695c !important; background-color: #00695c !important; }
.phvs-mic-btn:active, .phvs-cam-btn:active { transform: scale(.95) !important; }
.phvs-mic-btn svg, .phvs-cam-btn svg { width: 18px !important; height: 18px !important; fill: #fff !important; pointer-events: none !important; display: block !important; }
.phvs-mic-btn svg path, .phvs-cam-btn svg path { fill: #fff !important; }

/* ---- Modal / overlay ---- */
.phvs-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: none;
    align-items: flex-end; justify-content: center;
    z-index: 9999999; padding: 0;
}
.phvs-modal.is-open { display: flex; }
@media (min-width: 769px) {
    .phvs-modal { align-items: center; padding: 16px; }
}

.phvs-modal-inner {
    background: #fff;
    width: 100%; max-width: 500px;
    border-radius: 24px 24px 0 0;
    padding: 34px 22px 40px;
    text-align: center;
    position: relative;
    animation: phvsSlideUp .28s ease;
    box-shadow: 0 -8px 40px rgba(0,0,0,.18);
}
@media (min-width: 769px) {
    .phvs-modal-inner { border-radius: 18px; max-width: 460px; padding: 34px 26px; animation: phvsFadeIn .22s ease; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
}
@keyframes phvsSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes phvsFadeIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* !important throughout so the WoodMart theme's generic button styles can't
   move it to the centre or give it a grey box background. */
.phvs-close {
    position: absolute !important;
    top: 10px !important;
    right: 12px !important;
    left: auto !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 26px !important;
    color: #93959f !important;
    cursor: pointer;
    line-height: 1 !important;
    z-index: 6 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.phvs-close:hover { color: #3d4152 !important; background: transparent !important; }

/* ---- Text rows ---- */
.phvs-title { font-size: 20px; color: #3d4152; font-weight: 500; margin-bottom: 8px; line-height: 1.3; padding: 0 6px; }
.phvs-heard { font-size: 14px; color: #93959f; font-style: italic; min-height: 16px; margin-bottom: 4px; word-break: break-word; }
.phvs-result { font-size: 26px; color: #8CBC67; font-weight: 700; margin: 8px 0; word-break: break-word; }

/* ---- Big mic with Swiggy-style ripple ---- */
.phvs-mic-circle {
    width: 72px; height: 72px; border-radius: 50%;
    background: #8CBC67; color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin: 22px auto 8px; cursor: pointer;
}
.phvs-mic-circle svg { width: 32px; height: 32px; fill: #fff; }
.phvs-mic-circle.is-listening { animation: phvsPulse 1.3s infinite; }
@keyframes phvsPulse {
    0%   { box-shadow: 0 0 0 0   rgba(140,188,103,.55); }
    70%  { box-shadow: 0 0 0 24px rgba(140,188,103,0); }
    100% { box-shadow: 0 0 0 0   rgba(140,188,103,0); }
}

/* ---- Success check ---- */
.phvs-success {
    width: 60px; height: 60px; border-radius: 50%;
    background: #8CBC67; margin: 18px auto;
    display: flex; align-items: center; justify-content: center;
}
.phvs-success svg { width: 30px; height: 30px; fill: #fff; }

/* ---- Suggestion chips ---- */
.phvs-suggestions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0; }
/* !important so WoodMart's generic button reset can't turn the pills into grey boxes. */
.phvs-chip {
    border: 1px solid #d4d5d9 !important;
    background: #fff !important; background-color: #fff !important;
    color: #3d4152 !important;
    border-radius: 30px !important;
    padding: 8px 18px !important;
    font-size: 15px !important; font-weight: 400 !important;
    cursor: pointer !important;
    box-shadow: none !important; text-shadow: none !important;
    width: auto !important; min-width: 0 !important; height: auto !important;
    line-height: 1.3 !important; margin: 0 !important;
    text-transform: none !important; letter-spacing: normal !important;
}
.phvs-chip:hover { border-color: #8CBC67 !important; color: #8CBC67 !important; background: #fff !important; }
.phvs-chip:active { transform: scale(.97) !important; }

.phvs-bottom-text { color: #8CBC67; font-weight: 600; font-size: 15px; margin-top: 8px; }

/* ---- Action buttons (Retry / Search / Deny / Allow / Camera / Gallery) ----
   All !important so the WoodMart theme's button styling can't override them. */
.phvs-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.phvs-btn {
    border: none !important;
    border-radius: 8px !important;
    padding: 11px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: none !important; text-shadow: none !important;
    width: auto !important; min-width: 0 !important; height: auto !important;
    line-height: 1.3 !important; margin: 0 !important;
    text-transform: none !important; letter-spacing: normal !important;
}
.phvs-btn-retry  { background: #eaf5dd !important; background-color: #eaf5dd !important; color: #8CBC67 !important; }
.phvs-btn-retry:hover  { background: #ddeecb !important; }
.phvs-btn-search { background: #8CBC67 !important; background-color: #8CBC67 !important; color: #fff !important; }
.phvs-btn-search:hover { background: #80AB5E !important; }

/* ---- Image preview (lens) ---- */
.phvs-preview { display: none; max-width: 100%; max-height: 190px; border-radius: 14px; margin: 6px auto 14px; object-fit: cover; }

/* ===================================================================
   STATE VISIBILITY — show only what each step needs
   =================================================================== */

/* Hide everything by default; states opt elements back in. */
.phvs-title, .phvs-heard, .phvs-result, .phvs-suggestions, .phvs-mic-circle,
.phvs-success, .phvs-bottom-text, .phvs-actions, .phvs-preview,
.phvs-prime, .phvs-photo-choice { display: none; }

/* Listening / processing: title + big mic */
.phvs-modal.is-listening .phvs-title,
.phvs-modal.is-listening .phvs-mic-circle { display: block; }
.phvs-modal.is-listening .phvs-mic-circle { display: flex; }

/* Confirm (Did you mean / Search for): title + heard + result + actions */
.phvs-modal.is-confirm .phvs-title,
.phvs-modal.is-confirm .phvs-heard,
.phvs-modal.is-confirm .phvs-result { display: block; }
.phvs-modal.is-confirm .phvs-actions { display: flex; }

/* Suggesting (Sorry): title + chips + mic + bottom-text */
.phvs-modal.is-suggesting .phvs-title,
.phvs-modal.is-suggesting .phvs-bottom-text { display: block; }
.phvs-modal.is-suggesting .phvs-suggestions { display: flex; }
.phvs-modal.is-suggesting .phvs-mic-circle { display: flex; }

/* Success: title + result + check */
.phvs-modal.is-success .phvs-title,
.phvs-modal.is-success .phvs-result { display: block; }
.phvs-modal.is-success .phvs-success { display: flex; }

/* Visual / Lens: title + preview + result */
.phvs-modal.is-visual .phvs-title,
.phvs-modal.is-visual .phvs-result { display: block; }
.phvs-modal.is-visual .phvs-preview { display: block; }

/* ---- Permission priming (left-aligned, no icon — like production) ---- */
.phvs-modal.is-priming .phvs-prime { display: block; text-align: left; }
.phvs-prime-title { font-size: 22px; font-weight: 700; color: #1c1c1c; margin: 4px 0 12px; line-height: 1.25; text-align: left; }
.phvs-prime-text { font-size: 15px; color: #535665; margin-bottom: 24px; line-height: 1.5; text-align: left; }
.phvs-prime-actions { display: flex; gap: 12px; }
.phvs-prime-actions .phvs-btn { flex: 1 !important; padding: 14px !important; border-radius: 10px !important; font-size: 16px !important; }
.phvs-btn-deny { background: #eaf5dd !important; background-color: #eaf5dd !important; color: #8CBC67 !important; }
.phvs-btn-deny:hover { background: #ddeecb !important; }
.phvs-btn-allow { background: #8CBC67 !important; background-color: #8CBC67 !important; color: #fff !important; }
.phvs-btn-allow:hover { background: #80AB5E !important; }

/* ---- Photo source choice ---- */
.phvs-modal.is-photo-choice .phvs-photo-choice { display: block; }
.phvs-choice-title { font-size: 19px; font-weight: 700; color: #222; margin-bottom: 16px; }
.phvs-choice-actions { display: flex; flex-direction: column; gap: 10px; }
.phvs-choice-actions .phvs-btn { padding: 14px !important; border-radius: 10px !important; font-size: 16px !important; }
.phvs-btn-camera { background: #00796b !important; background-color: #00796b !important; color: #fff !important; }
.phvs-btn-camera:hover { background: #00695c !important; }
.phvs-btn-gallery { background: #8CBC67 !important; background-color: #8CBC67 !important; color: #fff !important; }
.phvs-btn-gallery:hover { background: #80AB5E !important; }
