/* FourDubs Search — [fourdubs_search] and [fourdubs_result] */

/* =========================================================
   Search widget
   ========================================================= */

/* Targeted button reset — neutralise common theme overrides without
   wiping display/flex which `all: unset` would destroy */
#fourdubs-search-wrap button,
#fourdubs-result-wrap button {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    line-height: normal;
    margin: 0;
    padding: 0;
    text-transform: none;
    box-sizing: border-box;
}

.fds-search-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    background: #fff;
}

/* Chat window */

.fds-chat-window {
    padding: 16px;
    min-height: 180px;
    max-height: 380px;
    overflow-y: auto;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fds-bubble {
    display: flex;
    max-width: 85%;
}

.fds-bubble.fds-agent { align-self: flex-start; }
.fds-bubble.fds-user  { align-self: flex-end; }

.fds-bubble-text {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
}

.fds-agent .fds-bubble-text {
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
}

.fds-user .fds-bubble-text {
    background: #0d9488;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Input row */

.fds-chat-form {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 10px 12px;
}

.fds-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fds-message-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}

.fds-message-input:focus    { border-color: #0d9488; }
.fds-message-input:disabled { background: #f3f4f6; cursor: not-allowed; }

.fds-mic-btn,
.fds-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}

.fds-send-btn { background: #0d9488; color: #fff; }
.fds-send-btn:hover    { background: #0f766e; }
.fds-send-btn:disabled { background: #9ca3af; cursor: not-allowed; }

.fds-mic-btn { background: #f3f4f6; color: #374151; }
.fds-mic-btn:hover { background: #e5e7eb; }
.fds-mic-btn.fds-mic-active {
    background: #fee2e2;
    color: #dc2626;
    animation: fds-pulse 1s ease-in-out infinite;
}
.fds-mic-btn:disabled { opacity: .4; cursor: not-allowed; }

@keyframes fds-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.1); }
}

/* Typing indicator */

.fds-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0 2px 4px;
}

.fds-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: fds-bounce 1.2s ease-in-out infinite;
}

.fds-typing-indicator span:nth-child(2) { animation-delay: .2s; }
.fds-typing-indicator span:nth-child(3) { animation-delay: .4s; }

@keyframes fds-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-6px); }
}

/* Done / ended state bars */

.fds-status-bar {
    padding: 12px 16px;
    border-top: 1px solid;
    text-align: center;
    font-size: 14px;
}

.fds-status-bar p { margin: 0 0 6px; }

.fds-done-state    { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.fds-session-ended { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.fds-reset-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #0d9488;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s;
    font-family: inherit;
}

.fds-reset-btn:hover { background: #0f766e; }

/* =========================================================
   Result widget
   ========================================================= */

.fds-result-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fds-result-placeholder {
    padding: 40px 32px;
    text-align: center;
    color: #6b7280;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
}

.fds-result-placeholder p { margin: 4px 0; }

.fds-map {
    width: 100%;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
}

/* Provider cards */

.fds-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
}

.fds-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    flex: 1 1 280px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    transition: box-shadow .2s;
}

.fds-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }

.fds-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.fds-card-num {
    width: 24px;
    height: 24px;
    background: #0d9488;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fds-card-icon { font-size: 18px; }

.fds-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.fds-badge-verified { background: #ccfbf1; color: #0f766e; }
.fds-badge-web      { background: #dbeafe; color: #1d4ed8; }

.fds-card-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #111827;
}

.fds-card-slogan {
    font-size: 12px;
    color: #0d9488;
    font-style: italic;
    margin: 2px 0 6px;
}

.fds-card-what,
.fds-card-address,
.fds-card-phone,
.fds-card-hours,
.fds-card-website {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0;
    line-height: 1.4;
}

.fds-card-phone a,
.fds-card-website a {
    color: #0d9488;
    text-decoration: none;
}

.fds-card-phone a:hover,
.fds-card-website a:hover { text-decoration: underline; }

/* Per-result speak buttons */

.fds-speak-btn {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}

.fds-speak-btn:hover { background: #dcfce7; }

.fds-info-speak-btn {
    margin-top: 6px;
    padding: 4px 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    color: #166534;
}

.fds-info-speak-btn:hover { background: #dcfce7; }

/* Google Maps info window */

.fds-info-window {
    font-family: -apple-system, sans-serif;
    max-width: 230px;
    line-height: 1.5;
}

.fds-info-window strong { font-size: 14px; color: #111827; display: block; margin-bottom: 4px; }
.fds-info-window p      { font-size: 12px; color: #6b7280; margin: 3px 0; }
.fds-info-window a      { color: #0d9488; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 480px) {
    .fds-search-wrap { border-radius: 0; border-left: none; border-right: none; }
    .fds-chat-window { max-height: 260px; }
    .fds-map         { height: 300px; }
    .fds-card        { flex: 1 1 100%; }
}
