/* Voice Interface Styles for Bawana AI */

.voice-interface-container {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.voice-interface-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Voice Status Indicator */
.voice-status-indicator {
    position: relative;
    display: inline-block;
}

.voice-status-indicator .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #6c757d;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 transparent;
}

.voice-status-indicator.quality-excellent .status-dot {
    background-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);
}

.voice-status-indicator.quality-good .status-dot {
    background-color: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
}

.voice-status-indicator.quality-poor .status-dot {
    background-color: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.6);
}

.voice-status-indicator.connecting .status-dot {
    background-color: #17a2b8;
    animation: pulse-connecting 1.5s infinite;
}

/* Voice Control Panel */
.voice-controls {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.75rem;
}

/* Enhanced Voice Buttons */
.voice-buttons .btn {
    min-width: 120px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.voice-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.voice-buttons .btn i {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.voice-buttons .btn:hover i {
    transform: scale(1.1);
}

/* Voice Status Text */
.voice-status {
    font-weight: 500;
    transition: color 0.3s ease;
}

.voice-status.status-initializing {
    color: #ffc107;
}

.voice-status.status-connected {
    color: #28a745;
}

.voice-status.status-disconnected {
    color: #6c757d;
}

.voice-status.status-error {
    color: #dc3545;
}

.voice-status.status-connecting {
    color: #17a2b8;
}

/* Transcription Panel */
.voice-transcription-panel {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.voice-transcription-panel .card-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-bottom: none;
    padding: 0.75rem 1rem;
}

.voice-transcription-panel .card-header .btn {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.voice-transcription-panel .card-header .btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.voice-transcription-content {
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #007bff transparent;
}

.voice-transcription-content::-webkit-scrollbar {
    width: 6px;
}

.voice-transcription-content::-webkit-scrollbar-track {
    background: transparent;
}

.voice-transcription-content::-webkit-scrollbar-thumb {
    background-color: #007bff;
    border-radius: 3px;
}

/* Transcription Items */
.transcription-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    animation: fadeInMessage 0.3s ease;
    position: relative;
    max-width: 85%;
}

.transcription-item.user {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 4px;
}

.transcription-item.agent {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.transcription-item .speaker {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    display: block;
    margin-bottom: 0.25rem;
}

.transcription-item.user .speaker {
    color: #1976d2;
}

.transcription-item.agent .speaker {
    color: #7b1fa2;
}

.transcription-item .text {
    display: block;
    line-height: 1.4;
}

/* Voice Session Info */
.voice-session-info {
    font-size: 0.75rem;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(0, 123, 255, 0.05) 100%);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 6px;
    padding: 0.75rem;
    color: #495057;
}

.voice-session-info span:last-child {
    font-weight: 500;
    color: #007bff;
}

/* Voice Settings Dropdown */
.dropdown-menu {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    min-width: 200px;
}

.dropdown-item-text {
    padding: 0.5rem;
}

.dropdown-item-text .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
}

.dropdown-item-text .form-select {
    border-radius: 6px;
}

.dropdown-item-text .form-check-label {
    font-size: 0.875rem;
    color: #495057;
}

/* Animations */
@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-connecting {
    0% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(23, 162, 184, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
    }
}

@keyframes speaking-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.voice-status-indicator.speaking .status-dot {
    animation: speaking-pulse 1s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .voice-interface-container {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .voice-controls {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    
    .voice-status-wrapper {
        justify-content: center;
        order: 1;
    }
    
    .voice-buttons {
        width: 100%;
        justify-content: center;
        order: 2;
    }
    
    .voice-buttons .btn {
        flex: 1;
        min-width: unset;
    }
    
    .dropdown {
        order: 3;
        align-self: center;
    }
    
    .transcription-item {
        max-width: 95%;
    }
    
    .voice-transcription-content {
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    .voice-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .voice-buttons .btn {
        width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .voice-interface-container {
        background: linear-gradient(135deg, #343a40 0%, #495057 100%);
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .voice-transcription-content {
        background-color: #495057;
        border-color: #6c757d;
        color: #f8f9fa;
    }
    
    .transcription-item.user {
        background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
        color: #f8f9fa;
    }
    
    .transcription-item.agent {
        background: linear-gradient(135deg, #581c87 0%, #7c2d12 100%);
        color: #f8f9fa;
    }
    
    .voice-session-info {
        background: linear-gradient(135deg, rgba(0, 123, 255, 0.2) 0%, rgba(0, 123, 255, 0.1) 100%);
        border-color: rgba(0, 123, 255, 0.3);
    }
}

/* Focus states for accessibility */
.voice-buttons .btn:focus,
.dropdown-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.voice-transcription-content:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .voice-interface-container {
        border: 2px solid #000;
    }
    
    .voice-status-indicator .status-dot {
        border: 2px solid #000;
    }
    
    .transcription-item {
        border: 1px solid #000;
    }
}