/* Voice Assistant Styles */

.voice-interface {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.voice-modal {
    background: #1e2139;
    border: 2px solid #00ff88;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 255, 136, 0.3);
    animation: voiceModalSlideIn 0.3s ease-out;
    color: #ffffff;
}

@keyframes voiceModalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.voice-header {
    padding: 20px 30px;
    border-bottom: 1px solid #2a2d3e;
    display: flex;
    justify-content: between;
    align-items: center;
    background: linear-gradient(135deg, #00ff88 0%, #00ffff 100%);
    color: #000;
    border-radius: 20px 20px 0 0;
    position: relative;
    font-weight: 600;
}

.voice-header h4 {
    margin: 0;
    font-weight: 600;
}

.btn-close-voice {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-close-voice:hover {
    background: rgba(255, 255, 255, 0.2);
}

.voice-body {
    padding: 30px;
    background: #1e2139;
    color: #ffffff;
}

.voice-status {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-weight: 500;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    background: #6c757d;
    transition: all 0.3s ease;
}

.status-indicator.listening {
    background: #28a745;
    animation: pulse 1.5s infinite;
}

.status-indicator.processing {
    background: #ffc107;
    animation: spin 1s linear infinite;
}

.status-indicator.speaking {
    background: #007bff;
    animation: pulse 1s infinite;
}

.status-indicator.ready {
    background: #6c757d;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

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

.voice-visual {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

.sound-waves {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.wave {
    width: 4px;
    height: 20px;
    background: #e9ecef;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.voice-visual.listening .wave {
    background: #28a745;
    animation: waveAnimation 0.8s ease-in-out infinite;
}

.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }
.wave:nth-child(4) { animation-delay: 0.1s; }
.wave:nth-child(5) { animation-delay: 0s; }

@keyframes waveAnimation {
    0%, 100% { height: 20px; }
    50% { height: 60px; }
}

.conversation-display {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #2a2d3e;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    background: #16192b;
    color: #ffffff;
}

.conversation-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
}

.message.user .message-content {
    background: linear-gradient(135deg, #00ff88 0%, #00ffff 100%);
    color: #000;
    padding: 10px 15px;
    border-radius: 18px 18px 5px 18px;
    font-weight: 500;
}

.message.assistant {
    align-self: flex-start;
}

.message.assistant .message-content {
    background: #2a2d3e;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 18px 18px 18px 5px;
    border: 1px solid #00ff88;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
    text-align: center;
}

.interim-text {
    min-height: 30px;
    padding: 10px;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
    font-style: italic;
    color: #007bff;
}

.extracted-data {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.extracted-data h6 {
    margin-bottom: 10px;
    color: #28a745;
    font-weight: 600;
}

.data-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.field-label {
    font-weight: 500;
    color: #495057;
}

.field-value {
    font-weight: 600;
    color: #28a745;
}

.voice-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.voice-controls .btn {
    border-radius: 25px;
    padding: 10px 20px;
    font-weight: 500;
    min-width: 120px;
}

.voice-tips {
    text-align: center;
    padding: 15px;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
}

/* Voice-filled animation for form fields */
.voice-filled {
    background: rgba(40, 167, 69, 0.1) !important;
    border-color: #28a745 !important;
    animation: voiceFillPulse 2s ease-out;
}

@keyframes voiceFillPulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* Voice activation buttons */
.voice-activation-btn {
    position: relative;
    overflow: hidden;
}

.voice-activation-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
}

.voice-activation-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Floating voice button */
.voice-fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    animation: voiceFabFloat 3s ease-in-out infinite;
}

.voice-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.voice-fab.listening {
    animation: voiceFabPulse 1s ease-in-out infinite;
}

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

@keyframes voiceFabPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Voice instruction tooltips */
.voice-tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s;
}

.voice-tooltip.show {
    opacity: 1;
}

.voice-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Responsive design */
@media (max-width: 768px) {
    .voice-modal {
        width: 95%;
        margin: 10px;
    }
    
    .voice-header, .voice-body {
        padding: 20px;
    }
    
    .voice-controls {
        flex-direction: column;
    }
    
    .voice-controls .btn {
        min-width: auto;
        width: 100%;
    }
    
    .voice-fab {
        bottom: 20px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .voice-interface,
    .sound-waves .wave,
    .status-indicator,
    .voice-fab {
        animation: none !important;
    }
    
    .voice-modal {
        animation: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .voice-modal {
        border: 2px solid #000;
    }
    
    .voice-header {
        background: #000;
        color: #fff;
    }
    
    .status-indicator.listening {
        background: #00ff00;
    }
    
    .status-indicator.processing {
        background: #ffff00;
    }
    
    .status-indicator.speaking {
        background: #0000ff;
    }
}