/* Voice Translation Interface - ChatGPT Voice Style */

.voice-translation-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.voice-translation-interface.hidden {
    display: none;
}

/* Header */
.translation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.language-indicators {
    display: flex;
    align-items: center;
    gap: 16px;
}

.language-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.lang-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.language-indicator select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    min-width: 120px;
    outline: none;
    transition: all 0.2s ease;
}

.language-indicator select:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.language-indicator select option {
    background: #333;
    color: white;
}

.translation-arrow {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 8px;
}

.close-translation-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-translation-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Main Voice Controls */
.translation-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    max-height: 50vh;
}

.voice-orb-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
}

.voice-orb {
    position: relative;
    width: 120px;
    height: 120px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.voice-orb:hover {
    transform: scale(1.05);
}

.orb-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-orb.active .orb-inner {
    background: linear-gradient(135deg, #09f755 0%, #1fb6ff 100%);
    box-shadow: 0 8px 32px rgba(9, 247, 85, 0.4);
}

.voice-orb.listening .orb-inner {
    animation: pulse 2s infinite;
}

.pulse-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid rgba(9, 247, 85, 0.3);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
}

.voice-orb.listening .pulse-ring {
    animation: pulse-ring 2s infinite;
}

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

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

.listening-status {
    text-align: center;
}

.listening-status span {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Speaker Toggle */
.speaker-toggle {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.speaker-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.speaker-toggle input[type="radio"] {
    display: none;
}

.speaker-toggle input[type="radio"]:checked + span {
    color: #09f755;
}

.speaker-toggle label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.speaker-toggle input[type="radio"]:checked + span::before {
    content: "●";
    margin-right: 6px;
    color: #09f755;
}

/* Conversation Display */
.conversation-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 24px;
    max-height: 40vh;
    overflow: hidden;
}

.interim-transcript {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.conversation-history {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.conversation-history::-webkit-scrollbar {
    width: 4px;
}

.conversation-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.conversation-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.conversation-entry {
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.conversation-entry.patient {
    padding-left: 0;
}

.conversation-entry.provider {
    padding-left: 20px;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.speaker-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.conversation-entry.patient .speaker-label {
    color: #09f755;
}

.conversation-entry.provider .speaker-label {
    color: #1fb6ff;
}

.entry-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.original-text {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 8px;
    border-left: 3px solid transparent;
}

.conversation-entry.patient .original-text {
    border-left-color: #09f755;
}

.conversation-entry.provider .original-text {
    border-left-color: #1fb6ff;
}

.translated-text {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.translated-text i {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

/* Translation Actions */
.translation-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.translation-actions .btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.translation-actions .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.translation-actions .btn i {
    width: 16px;
    height: 16px;
}

/* Notification */
.translation-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(9, 247, 85, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    transform: translateX(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2100;
    backdrop-filter: blur(10px);
}

.translation-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .translation-header {
        padding: 16px 20px;
    }
    
    .language-indicators {
        gap: 12px;
    }
    
    .language-indicator select {
        min-width: 100px;
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .voice-orb {
        width: 100px;
        height: 100px;
    }
    
    .translation-controls {
        padding: 30px 20px;
    }
    
    .conversation-display {
        padding: 0 20px;
    }
    
    .speaker-toggle {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        max-width: 280px;
    }
    
    .speaker-toggle label {
        justify-content: center;
        width: 100%;
    }
    
    .translation-actions {
        padding: 16px 20px;
        flex-wrap: wrap;
    }
    
    .translation-actions .btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .language-indicators {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .translation-arrow {
        transform: rotate(90deg);
        margin: 4px 0;
    }
    
    .voice-orb {
        width: 80px;
        height: 80px;
    }
    
    .listening-status span {
        font-size: 14px;
    }
    
    .conversation-entry.provider {
        padding-left: 10px;
    }
}

/* Dark mode body class when translation is active */
body.translation-active {
    overflow: hidden;
}

body.translation-active .app-container {
    filter: blur(2px);
    pointer-events: none;
}