/**
 * voiceNav.css - Voice Navigation Overlay Styles
 */

/* ==============================
   OVERLAY BACKDROP
   ============================== */
.voice-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1060;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.voice-nav-backdrop.show {
    opacity: 1;
}

/* ==============================
   OVERLAY CARD
   ============================== */
.voice-nav-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 1061;
    background: var(--mv-bg-card, #fff);
    border: 1px solid var(--mv-border-color, var(--mv-border-color));
    border-radius: 1rem;
    padding: 2rem 2.5rem;
    min-width: 320px;
    max-width: 440px;
    width: 90vw;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.voice-nav-card.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ==============================
   STATES
   ============================== */
.voice-nav-state {
    display: none;
}

.voice-nav-state.active {
    display: block;
}

/* --- Listening --- */
.voice-nav-listening .voice-nav-mic-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: voice-nav-pulse 1.5s ease-in-out infinite;
    cursor: pointer;
}

.voice-nav-listening .voice-nav-mic-circle i {
    font-size: 2rem;
    color: #fff;
}

.voice-nav-listening .voice-nav-hint {
    color: var(--mv-text-secondary, #6c757d);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

@keyframes voice-nav-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(220, 53, 69, 0); }
}

/* --- Processing --- */
.voice-nav-processing .voice-nav-spinner {
    margin: 0 auto 1rem;
}

.voice-nav-processing p {
    color: var(--mv-text-secondary, #6c757d);
    margin: 0;
}

/* --- Navigating --- */
.voice-nav-navigating .voice-nav-check {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #198754;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.voice-nav-navigating .voice-nav-check i {
    font-size: 1.5rem;
    color: #fff;
}

.voice-nav-navigating .voice-nav-dest {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--mv-text-primary, #212529);
    margin: 0;
}

/* --- Results (disambiguation) --- */
.voice-nav-results .voice-nav-query-label {
    font-size: 0.85rem;
    color: var(--mv-text-secondary, #6c757d);
    margin-bottom: 0.75rem;
}

.voice-nav-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    max-height: 320px;
    overflow-y: auto;
}

.voice-nav-results-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
}

.voice-nav-results-list li:hover {
    background: var(--mv-bg-surface, #f8f9fa);
}

.voice-nav-result-img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--mv-bg-surface, #e9ecef);
    flex-shrink: 0;
}

.voice-nav-result-img.person-img,
.voice-nav-result-img.place-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.voice-nav-result-info {
    flex: 1;
    min-width: 0;
}

.voice-nav-result-name {
    font-weight: 500;
    color: var(--mv-text-primary, #212529);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-nav-result-sub {
    font-size: 0.8rem;
    color: var(--mv-text-secondary, #6c757d);
}

.voice-nav-result-type {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--mv-bg-surface, #e9ecef);
    color: var(--mv-text-secondary, #6c757d);
    flex-shrink: 0;
}

/* --- Error state --- */
.voice-nav-error .voice-nav-error-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.voice-nav-error .voice-nav-error-icon i {
    font-size: 1.5rem;
    color: #fff;
}

.voice-nav-error p {
    color: var(--mv-text-secondary, #6c757d);
    margin: 0 0 1rem;
}

/* ==============================
   CLOSE BUTTON
   ============================== */
.voice-nav-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--mv-text-secondary, #6c757d);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 4px;
}

.voice-nav-close:hover {
    color: var(--mv-text-primary, #212529);
    background: var(--mv-bg-surface, #f8f9fa);
}

/* ==============================
   DIARY FALLBACK PROMPT
   ============================== */
.voice-nav-diary-prompt {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--mv-border-color, var(--mv-border-color));
}

.voice-nav-diary-prompt p {
    font-size: 0.85rem;
    color: var(--mv-text-secondary, #6c757d);
    margin-bottom: 0.5rem;
}

/* ==============================
   DARK MODE
   ============================== */
[data-bs-theme="dark"] .voice-nav-card {
    background: var(--mv-bg-card);
    border-color: var(--mv-border-color);
}

[data-bs-theme="dark"] .voice-nav-results-list li:hover {
    background: var(--mv-bg-surface);
}

[data-bs-theme="dark"] .voice-nav-close:hover {
    color: var(--mv-text-primary);
    background: var(--mv-bg-surface);
}

[data-bs-theme="dark"] .voice-nav-result-type {
    background: var(--mv-bg-surface);
    color: var(--mv-text-secondary);
}

[data-bs-theme="dark"] .voice-nav-diary-prompt {
    border-top-color: var(--mv-border-color);
}

/* ==============================
   MOBILE
   ============================== */
@media (max-width: 575.98px) {
    .voice-nav-card {
        min-width: unset;
        padding: 1.5rem 1.25rem;
        border-radius: 0.75rem;
    }

    .voice-nav-listening .voice-nav-mic-circle {
        width: 64px;
        height: 64px;
    }

    .voice-nav-listening .voice-nav-mic-circle i {
        font-size: 1.5rem;
    }
}
