/* ============================================
   VOICE CONTROL UI STYLES
   ============================================ */

#voice-control-container {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
}

#voice-control-container * {
    pointer-events: auto;
}

/* ============================================
   FLOATING MICROPHONE BUTTON
   ============================================ */

.voice-mic-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6c2c 0%, #ff8c52 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(255, 108, 44, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    overflow: hidden;
}

.voice-mic-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 108, 44, 0.6);
}

.voice-mic-button:active {
    transform: scale(0.95);
}

.voice-mic-button .mic-icon {
    width: 32px;
    height: 32px;
    color: white;
    z-index: 2;
    position: relative;
}

/* Listening pulse animation */
.listening-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    opacity: 0;
    animation: pulse 2s ease-out infinite;
}

.voice-mic-button.listening .listening-pulse {
    opacity: 1;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Button states */
.voice-mic-button.listening {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: listening-glow 1.5s ease-in-out infinite;
}

@keyframes listening-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(240, 147, 251, 0.6);
    }
    50% {
        box-shadow: 0 4px 40px rgba(245, 87, 108, 0.8);
    }
}

.voice-mic-button.processing,
.voice-mic-button.thinking {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.voice-mic-button.processing .mic-icon,
.voice-mic-button.thinking .mic-icon {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.voice-mic-button.executing {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.voice-mic-button.speaking {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.voice-mic-button.speaking .mic-icon {
    animation: bounce 0.6s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.voice-mic-button.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================
   STATUS INDICATOR
   ============================================ */

.voice-status-indicator {
    position: fixed;
    bottom: 120px;
    right: 30px;
    background: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 250px;
}

.voice-status-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
}

.voice-status-indicator.status-listening .status-icon {
    background: #f5576c;
    animation: blink 1s infinite;
}

.voice-status-indicator.status-processing .status-icon,
.voice-status-indicator.status-thinking .status-icon {
    background: #4facfe;
    animation: blink 1s infinite;
}

.voice-status-indicator.status-executing .status-icon {
    background: #43e97b;
    animation: blink 1s infinite;
}

.voice-status-indicator.status-speaking .status-icon {
    background: #fa709a;
    animation: blink 1s infinite;
}

.voice-status-indicator.status-error .status-icon {
    background: #ff6b6b;
}

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

.status-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================
   TRANSCRIPT DISPLAY
   ============================================ */

.voice-transcript,
.voice-response {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: white;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 9999;
}

.voice-transcript {
    bottom: 120px;
}

.voice-response {
    bottom: 200px;
}

.voice-transcript.show,
.voice-response.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.transcript-label,
.response-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.transcript-label {
    color: #ff6c2c;
}

.response-label {
    color: #43e97b;
}

.transcript-text,
.response-text {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .voice-mic-button {
        width: 60px;
        height: 60px;
        bottom: 80px;
        right: 20px;
    }

    .voice-mic-button .mic-icon {
        width: 28px;
        height: 28px;
    }

    .voice-status-indicator {
        bottom: 150px;
        right: 20px;
        padding: 10px 16px;
        max-width: 200px;
    }

    .status-text {
        font-size: 12px;
    }

    .voice-transcript,
    .voice-response {
        max-width: calc(100% - 40px);
        padding: 12px 20px;
    }

    .voice-transcript {
        bottom: 150px;
    }

    .voice-response {
        bottom: 220px;
    }

    .transcript-text,
    .response-text {
        font-size: 14px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.voice-mic-button:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3);
}

.voice-mic-button:focus:not(:focus-visible) {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    .voice-status-indicator,
    .voice-transcript,
    .voice-response {
        background: #2c2c2c;
    }

    .status-text,
    .transcript-text,
    .response-text {
        color: #e0e0e0;
    }
}

/* ============================================
   PRINT - HIDE VOICE CONTROLS
   ============================================ */

@media print {
    #voice-control-container {
        display: none !important;
    }
}
