/**
 * Enhanced Voice Search Styles
 * 
 * Styles for voice search interface with voice response functionality
 */

/* Voice Search Container */
.voice-search-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

.voice-search-widget.floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 10px;
}

/* Voice Search Button */
.voice-search-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    overflow: hidden;
}

.voice-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.voice-search-btn:active {
    transform: translateY(0);
}

/* Button States */
.voice-search-btn.listening {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse-listening 1.5s infinite;
}

.voice-search-btn.processing {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
}

.voice-search-btn.playing-response {
    background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
    animation: pulse-playing 2s infinite;
}

/* Voice Status Indicator */
.voice-status-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.voice-status-indicator.processing {
    background: #feca57;
    opacity: 1;
}

.voice-status-indicator.playing-response {
    background: #48dbfb;
    opacity: 1;
}

/* Voice Search Status */
.voice-search-status {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 15px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    text-align: center;
    z-index: 1001;
}

.voice-search-status .status-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.voice-search-status .status-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

/* Pulse Animation for Status */
.pulse-ring {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: pulse-ring 1.5s infinite;
}

.pulse-ring:nth-child(2) {
    animation-delay: 0.3s;
}

.pulse-ring:nth-child(3) {
    animation-delay: 0.6s;
}

/* Voice Transcript Display */
.voice-transcript {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    max-width: 400px;
    z-index: 1001;
}

.voice-transcript .transcript-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.voice-transcript .transcript-text {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    word-wrap: break-word;
}

.voice-transcript .transcript-text.interim {
    color: #999;
    font-style: italic;
}

.voice-transcript .transcript-text.final {
    color: #333;
    font-weight: 500;
}

.voice-transcript .transcript-confidence {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.voice-transcript .transcript-confidence.high {
    background: #d4edda;
    color: #155724;
}

.voice-transcript .transcript-confidence.medium {
    background: #fff3cd;
    color: #856404;
}

.voice-transcript .transcript-confidence.low {
    background: #f8d7da;
    color: #721c24;
}

/* Voice Response Controls */
.voice-response-controls {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    text-align: center;
    z-index: 1001;
}

.voice-response-controls .btn {
    margin: 0 5px;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-response-controls .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.voice-response-controls .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.voice-response-controls .btn-secondary {
    background: #6c757d;
    color: white;
}

.voice-response-controls .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.voice-response-controls .voice-response-info {
    margin-top: 10px;
}

/* Notifications */
.voice-search-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.voice-search-notification.show {
    transform: translateX(0);
}

.voice-search-notification.success {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.voice-search-notification.error {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
}

.voice-search-notification.info {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

/* Animations */
@keyframes pulse-listening {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.5);
    }
}

@keyframes pulse-playing {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(72, 219, 251, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 20px rgba(72, 219, 251, 0.5);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.8);
        opacity: 1;
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .voice-search-container {
        margin-left: 5px;
    }
    
    .voice-search-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    
    .voice-search-status,
    .voice-transcript,
    .voice-response-controls {
        min-width: 180px;
        max-width: 280px;
        padding: 12px;
        font-size: 13px;
    }
    
    .voice-search-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        text-align: center;
    }
    
    .voice-search-widget.floating {
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .voice-search-status,
    .voice-transcript,
    .voice-response-controls {
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .voice-search-status,
    .voice-transcript,
    .voice-response-controls {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .voice-search-status .status-text,
    .voice-transcript .transcript-text.final {
        color: #e2e8f0;
    }
    
    .voice-transcript .transcript-text.interim {
        color: #a0aec0;
    }
    
    .voice-transcript .transcript-label {
        color: #a0aec0;
    }
    
    .voice-search-widget.floating {
        background: #2d3748;
    }
}

/* Integration with existing search bars */
.search-container .voice-search-container,
.header-search .voice-search-container {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.search-container {
    position: relative;
}

/* Voice search in AI assistant sidebar */
.ai-assistant-sidebar .voice-search-container {
    margin: 10px 0;
    justify-content: center;
}

.ai-assistant-sidebar .voice-search-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

/* Voice search results page enhancements */
.ai-search-results .voice-response-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.ai-search-results .voice-response-section h4 {
    color: #667eea;
    margin-bottom: 15px;
}

.ai-search-results .voice-response-player {
    margin: 15px 0;
}

.ai-search-results .voice-response-transcript {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    font-style: italic;
    color: #666;
    border-left: 4px solid #667eea;
}