/* Voice card modes: choose (Speak or Type), voice (mic), chat (typing). See voice_control.js and chat.js. */

/* Only the active mode is shown */
.voice-card .voice-choose,
.voice-card .voice-chat { display: none; }
.voice-card[data-mode="choose"] .voice-choose { display: flex; }
.voice-card[data-mode="chat"] .voice-chat { display: flex; }
.voice-card:not([data-mode="voice"]) .voice-card-body { display: none; }
.voice-card:not([data-mode="voice"]) .voice-only { display: none !important; }

.voice-mode-toggle {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}
.voice-mode-toggle[hidden] { display: none; }
.voice-mode-toggle:hover,
.voice-mode-toggle:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.28); border-color: rgba(255, 255, 255, 0.55); }

/* ---- chooser ---- */
.voice-choose {
    flex: 1;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.5rem;
    color: #fff;
    text-align: center;
}
.voice-choose-title { margin: 0; font-size: 1.05rem; font-weight: 600; }
.voice-choose-options { display: flex; gap: 1rem; width: 100%; justify-content: center; flex-wrap: wrap; }
.voice-choose-btn {
    position: relative;
    flex: 1 1 140px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.25rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.voice-choose-btn i { font-size: 2rem; color: #7fb4ff; }
.voice-choose-btn strong { font-size: 1.1rem; }
.voice-choose-btn .voice-choose-note { font-size: 0.8rem; line-height: 1.3; opacity: 0.85; }

/* Type is the suggested way (instant, no microphone): filled blue and labelled. Speak stays one tap away at full size. */
.voice-choose-btn.is-recommended {
    background: #1d5fc4;
    border: 2px solid #7fb4ff;
}
.voice-choose-btn.is-recommended .voice-choose-note { opacity: 1; }
.voice-choose-btn.is-recommended i { color: #ffffff; }
.voice-choose-badge {
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    background: #ffffff;
    color: #0b2a5b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.voice-choose-btn:hover,
.voice-choose-btn:focus-visible { transform: translateY(-2px); background: rgba(255, 255, 255, 0.16); border-color: #7fb4ff; outline: none; }
.voice-choose-btn.is-recommended:hover,
.voice-choose-btn.is-recommended:focus-visible { background: #2a70d8; }

/* ---- chat ---- */
.voice-chat {
    flex: 1;
    min-height: 0;
    flex-direction: column;
    color: #fff;
}
.dc-log {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.dc-msg { display: flex; max-width: 100%; }
.dc-user { justify-content: flex-end; }
.dc-bubble {
    max-width: 90%;
    padding: 0.5rem 0.75rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.38;
    overflow-wrap: anywhere;
    text-align: left;
}
.dc-bot .dc-bubble {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom-left-radius: 4px;
}
.dc-user .dc-bubble { background: #1a73e8; color: #fff; border-bottom-right-radius: 4px; }
.dc-error .dc-bubble { border-color: rgba(255, 120, 130, 0.7); background: rgba(220, 53, 69, 0.2); }
.dc-text { white-space: pre-wrap; }
.dc-title { font-weight: 700; font-size: 0.78rem; color: #8fc0ff; margin-bottom: 0.25rem; }

.dc-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.dc-btn {
    border: 1px solid #8fc0ff;
    background: transparent;
    color: #8fc0ff;
    border-radius: 999px;
    padding: 0.28rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.dc-btn:hover { background: rgba(143, 192, 255, 0.16); }
.dc-btn.dc-ok { background: #198754; border-color: #198754; color: #fff; }
.dc-btn.dc-ok:hover { background: #146c43; }
.dc-btn.dc-no { border-color: #ff8a94; color: #ff8a94; }
.dc-btn.dc-no:hover { background: rgba(255, 138, 148, 0.14); }
.dc-link { display: inline-block; margin-top: 0.4rem; font-size: 0.84rem; font-weight: 600; color: #8fc0ff; }

.dc-typing { display: flex; gap: 4px; padding: 0.65rem 0.8rem; }
.dc-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9db6d3;
    animation: dc-bounce 1s infinite ease-in-out;
}
.dc-typing span:nth-child(2) { animation-delay: 0.15s; }
.dc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dc-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-5px); opacity: 1; } }

.dc-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.4rem 0.8rem 0; }
.dc-chips[hidden] { display: none; }
.dc-chip {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    font-size: 0.78rem;
    cursor: pointer;
}
.dc-chip:hover { border-color: #8fc0ff; color: #8fc0ff; }
.dc-chip-recent i { margin-right: 0.4rem; font-size: 0.75em; opacity: 0.8; }

.dc-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.8rem 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.dc-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    font-size: 0.92rem;
    background: rgba(255, 255, 255, 0.96);
    color: #1b2430;
}
.dc-input:focus { outline: 2px solid rgba(143, 192, 255, 0.7); border-color: #8fc0ff; }
.dc-send {
    flex: 0 0 40px;
    border: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: #fff;
    background: #1a73e8;
    cursor: pointer;
}
.dc-send:disabled { opacity: 0.5; cursor: default; }
.dc-icon-btn {
    flex: 0 0 34px;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
}
.dc-icon-btn:hover { background: rgba(255, 255, 255, 0.24); }

@media (prefers-reduced-motion: reduce) {
    .voice-choose-btn, .dc-typing span { transition: none; animation: none; }
}

/* small touches */
.dc-note { margin-top: 0.3rem; font-size: 0.75rem; opacity: 0.8; font-style: italic; }
.dc-msg { animation: dc-in 0.2s ease-out; }
@keyframes dc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.dc-log { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    .dc-msg { animation: none; }
    .dc-log { scroll-behavior: auto; }
}

.dc-typing .dc-slow { margin-left: 0.5rem; font-size: 0.78rem; opacity: 0.8; align-self: center; white-space: nowrap; }
