/* Voice Control Container */
.voice-control-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

/* Mikrofon Button */
.voice-mic-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.voice-mic-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #2196F3;
}

.voice-mic-button.listening {
    background: #ef5350;
    border-color: #ef5350;
    animation: pulse 1.5s infinite;
}

.voice-mic-button.listening i {
    color: white;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 83, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0);
    }
}

/* Voice Input Panel */
.voice-input-panel {
    position: absolute;
    top: 60px;
    right: 0;
    width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s ease;
    pointer-events: none;
    display: none;
}

.voice-input-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Voice Input Header */
.voice-input-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.voice-status-icon {
    color: #2196F3;
    margin-right: 10px;
    animation: fadeInOut 1.5s infinite;
}

.voice-status-icon.recording {
    color: #ef5350;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.voice-close-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.voice-close-btn:hover {
    color: #333;
}

/* Voice Input Body */
.voice-input-body {
    padding: 20px;
}

.voice-command-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    line-height: 1.5;
}

.voice-command-input:focus {
    outline: none;
    border-color: #2196F3;
}

/* Voice Suggestions */
.voice-suggestions {
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.voice-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.voice-suggestion-item:hover {
    background: #f5f5f5;
    color: #333;
}

.voice-suggestion-item i {
    margin-right: 8px;
    color: #2196F3;
}

.voice-suggestion-item small {
    color: #999;
    margin-left: 5px;
}

/* Voice Input Footer */
.voice-input-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .voice-control-container {
        top: 40px; /* 40px von oben */
        right: 20px;
    }
    
    .voice-mic-button {
        width: 40px;
        height: 40px;
    }
    
    .voice-input-panel {
        width: calc(100vw - 40px);
        max-width: 400px;
        right: -10px;
    }
}

/* Adjust position when sidebar is collapsed */
.sidebar-collapsed .voice-control-container {
    right: 20px;
}

/* Dark Mode Support */
/* darkmode-v1: nur bei Nutzerwahl Dunkel (vorher automatisch per Geraet) */
    :where(html[data-bs-theme="dark"]) .voice-mic-button {
        background: #ffffff;
        border-color: #e0e0e0;
    }
    
    :where(html[data-bs-theme="dark"]) .voice-mic-button i {
        color: #757575;
    }
    
    :where(html[data-bs-theme="dark"]) .voice-mic-button:hover {
        border-color: #2196F3;
    }
    
    :where(html[data-bs-theme="dark"]) .voice-input-panel {
        background: #1e1e1e;
        color: #fff;
        border: 1px solid #444;
    }
    
    :where(html[data-bs-theme="dark"]) .voice-input-header,
    :where(html[data-bs-theme="dark"]) .voice-input-footer {
        border-color: #444;
    }
    
    :where(html[data-bs-theme="dark"]) .voice-command-input {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
    
    :where(html[data-bs-theme="dark"]) .voice-command-input:focus {
        border-color: #2196F3;
    }
    
    :where(html[data-bs-theme="dark"]) .voice-suggestion-item:hover {
        background: #2a2a2a;
    }
    
    :where(html[data-bs-theme="dark"]) .voice-close-btn {
        color: #999;
    }
    
    :where(html[data-bs-theme="dark"]) .voice-close-btn:hover {
        color: #fff;
    }


/* Loading state */
.voice-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.voice-loading .spinner-border {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* Error state */
.voice-error {
    color: #dc3545;
    padding: 10px;
    text-align: center;
    font-size: 14px;
}

/* mikro-seitenleiste-v1 (04.11.2026): Knopf sitzt in der Seitenleiste neben "Neuer Chat"
   (#vcPlatz in index_v2.html) statt fest oben rechts ueber dem Seiteninhalt. */
.vc-chat-zeile { display: flex; align-items: center; gap: 8px; }
.v2-layout .vc-chat-zeile .v2-new-chat-btn { flex: 1 1 0% !important; width: auto !important; min-width: 0; }
.vc-platz { flex: 0 0 auto; display: flex; }
.vc-platz:empty { display: none; }
.vc-platz .voice-control-container { position: static; top: auto; right: auto; z-index: auto; }
.vc-platz .voice-mic-button { width: 40px; height: 40px; }
.vc-platz .voice-mic-button:hover { transform: none; }
.vc-platz .voice-input-panel {
    position: fixed;
    top: 180px; /* wird beim Oeffnen auf Hoehe des Knopfs gesetzt (index_v2 #vcPlatz) */
    left: 262px;
    right: auto;
    width: 400px;
    max-width: calc(100vw - 278px);
}

/* mikro-seitenleiste-v2 (04.11.2026): beschrifteter Knopf "Sofort anrufen" in eigener Zeile
   unter "Neuer Chat" - der unbeschriftete Kreis daneben wurde nicht gefunden. */
.vc-chat-zeile { flex-direction: column; align-items: stretch; }
.vc-platz, .vc-platz .voice-control-container { display: block; width: 100%; }
.vc-platz:empty { display: none; }
.vc-platz .voice-mic-button {
    width: 100%; height: 38px; border-radius: 9999px; gap: 8px;
    background: #ffffff; border: 1.5px solid var(--v2-primary, #2E6B94); box-shadow: none;
    color: var(--v2-primary, #2E6B94); font-size: 13.5px; font-weight: 600;
}
.vc-platz .voice-mic-button i { color: #ef5350; }
.vc-platz .voice-mic-button:hover { background: rgba(46,107,148,0.06); border-color: var(--v2-primary, #2E6B94); box-shadow: none; }
.vc-platz .voice-mic-button.listening { background: #ef5350; border-color: #ef5350; color: #ffffff; }
.vc-platz .voice-mic-button.listening i { color: #ffffff; }
html[data-bs-theme="dark"] .vc-platz .voice-mic-button:not(.listening) { background: transparent; color: #cfe3f3; border-color: #5b8db5; }

/* vc-kontakt-v1: Kontaktvorschlaege mit Firma und Nummer */
.voice-suggestions { max-height: 280px; }
.voice-suggestion-item.vc-kontakt { display: flex; align-items: flex-start; gap: 8px; }
.voice-suggestion-item.vc-kontakt i { margin: 3px 0 0 0; flex: 0 0 auto; }
.vc-kontakt-text { min-width: 0; flex: 1 1 auto; }
.vc-kontakt-name { color: #222; font-weight: 600; line-height: 1.25; }
.vc-kontakt-details { color: #777; font-size: 12.5px; line-height: 1.3; margin-top: 2px; overflow-wrap: anywhere; }
.voice-suggestion-item.vc-gewaehlt { background: rgba(33, 150, 243, .10); box-shadow: inset 3px 0 0 #2196F3; }
.vc-auswahl-hinweis { font-size: 13px; color: #555; padding: 4px 12px 8px; font-weight: 500; }
:where(html[data-bs-theme="dark"]) .vc-kontakt-name { color: #eee; }
:where(html[data-bs-theme="dark"]) .vc-kontakt-details { color: #aaa; }
:where(html[data-bs-theme="dark"]) .vc-auswahl-hinweis { color: #bbb; }
:where(html[data-bs-theme="dark"]) .voice-suggestion-item.vc-gewaehlt { background: rgba(33, 150, 243, .22); }
