/* 실시간번역 전용 스타일 */

/* 하이브리드 번역 표시 영역 */
.hybrid-translation-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: 16px;
    margin: 20px 0;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: slideInDown 0.5s ease-out;
}

.hybrid-translation-display.active {
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.2);
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
}

.hybrid-translation-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
}

/* 음성인식된 언어 (원문) 영역 */
.hybrid-original {
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.hybrid-original-text {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    line-height: 1.4;
    transition: all 0.3s ease;
}

.hybrid-original-text i {
    margin-right: 8px;
    color: var(--primary-color, #007bff);
    font-size: 1rem;
}

.hybrid-original-text.speaking {
    color: var(--success-color, #28a745);
    animation: textPulse 1.5s infinite;
}

.hybrid-original-text.completed {
    color: var(--dark-color, #343a40);
}

/* 번역된 언어 영역 */
.hybrid-translated {
    width: 100%;
    padding: 15px 0;
}

.hybrid-translated-text {
    margin: 0;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-color, #212529);
    line-height: 2;
    transition: all 0.3s ease;
    min-height: 3rem;
    padding: 50px 30px;
}

.hybrid-translated-text i {
    margin-right: 12px;
    color: var(--primary-color, #007bff);
    font-size: 1.8rem;
}

.hybrid-translated-text.translating {
    color: var(--warning-color, #ffc107);
    animation: textPulse 1.5s infinite;
}

.hybrid-translated-text.completed {
    color: var(--success-color, #28a745);
    animation: slideInUp 0.5s ease-out;
}

/* 애니메이션 */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .hybrid-translation-display {
        margin: 10px 0;
        padding: 15px;
    }
    
    .hybrid-translated-text {
        font-size: 2rem;
    }
    
    .hybrid-original-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hybrid-translation-display {
        padding: 10px;
        margin: 8px 0;
    }
    
    .hybrid-translated-text {
        font-size: 1.7rem;
    }
    
    .hybrid-original-text {
        font-size: 0.9rem;
    }
}

/* 음성인식 설정 버튼 */
.settings-button-compact {
    background: var(--secondary-color, #6c757d);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
    font-size: 14px;
}

.settings-button-compact:hover {
    background: var(--primary-color, #007bff);
    transform: scale(1.05);
}

.settings-button-compact:active {
    transform: scale(0.95);
}

/* 음성인식 옵션 스타일 */
.recognition-option {
    transition: all 0.3s ease;
}

.recognition-option:hover {
    border-color: var(--primary-color, #007bff) !important;
    background-color: #f8f9ff;
}

.recognition-option input[type="radio"]:checked + div {
    color: var(--primary-color, #007bff);
}

.recognition-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color, #007bff) !important;
    background-color: #f8f9ff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 기능 태그 호버 효과 */
.feature-tag {
    transition: all 0.2s ease;
}

.feature-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 음성인식 설정 모달 스타일 */
.speech-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.speech-modal-container {
    background: var(--bg-color, white);
    color: var(--text-color, #333);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.speech-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color, #e9ecef);
}

.speech-modal-footer {
    border-top: 1px solid var(--border-color, #e9ecef);
}

/* 마이크 섹션 레이아웃 개선 */
.mic-section-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.realtime-translator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Poppins', sans-serif;
    min-height: 500px;
    background: white;
    display: block !important;
    visibility: visible !important;
}

/* 헤더 영역 */
.realtime-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.realtime-header h2 {
    color: var(--text-color);
    font-weight: 600;
}

.realtime-status {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-indicator.disconnected {
    background: #fee;
    color: #c53030;
    border: 1px solid #fed7d7;
}

.status-indicator.connecting {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-indicator.connected {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Google Translate 스타일 대화 메시지 */
.conversation-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

/* Google Translate 스타일 사용자 메시지 */
.conversation-message.user {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid var(--primary-color);
    margin-left: 0;
}

/* 활성 상태 (실시간 입력 중) */
.conversation-message.user.active {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid #ff9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    animation: activeGlow 2s infinite alternate;
}

/* 최종 완료 상태 */
.conversation-message.user.final {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-left: 4px solid #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

/* 활성 상태 애니메이션 */
@keyframes activeGlow {
    from {
        box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    }
    to {
        box-shadow: 0 6px 16px rgba(255, 152, 0, 0.5);
    }
}

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

.conversation-message.original-message {
    background: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    margin-left: 0;
}

.conversation-message.translated-message {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    margin-left: auto;
    margin-right: 0;
}

.conversation-message.partial-text {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    margin-left: 0;
}

.message-content {
    width: 100%;
}

.message-text {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.message-time {
    font-family: monospace;
}

.message-status {
    font-weight: 500;
}

/* Google Translate 스타일 타이핑 커서 */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #ff9800;
    margin-left: 2px;
    animation: cursorBlink 1.2s infinite;
    vertical-align: text-bottom;
}

@keyframes cursorBlink {
    0%, 50% { 
        opacity: 1; 
        background: #ff9800;
    }
    51%, 100% { 
        opacity: 0.3;
        background: #ffcc80;
    }
}

/* 완료된 메시지에서는 커서 숨김 */
.conversation-message.user.final .typing-cursor {
    display: none;
}

/* 실시간 중간 텍스트 스타일 */
.interim-text .message-text {
    opacity: 0.8;
    font-style: italic;
    position: relative;
}

/* 누적 텍스트 스타일 */
.accumulated-text .message-text {
    font-weight: 500;
}

/* 완료된 원본 텍스트 스타일 */
.completed-original .message-text {
    font-weight: 600;
    color: var(--text-color);
}

/* 번역된 텍스트 스타일 */
.translated-message .message-text {
    color: #0066cc;
    font-weight: 500;
}

/* 실시간 볼륨 표시 스타일 */
.realtime-volume-display {
    display: flex;
    align-items: center;
    margin-left: 15px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 170px;
}

.volume-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.volume-bar-background {
    width: 150px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.volume-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 60%, #dc3545 90%);
    border-radius: 4px;
    transition: width 0.1s ease, background-color 0.2s ease;
    position: relative;
}

.volume-level-text {
    font-size: 11px;
    color: #666;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    min-width: 30px;
    text-align: right;
}

/* 실시간 타이핑 애니메이션 스타일 */
.typing-text {
    position: relative;
    font-family: inherit;
}

.typing-text .typing-cursor {
    display: inline-block;
    margin-left: 2px;
    animation: typingBlink 1.2s infinite;
    color: #007bff;
    font-size: 1.1em;
    vertical-align: baseline;
}

@keyframes typingBlink {
    0%, 40% { 
        opacity: 1; 
        transform: scaleY(1);
    }
    41%, 80% { 
        opacity: 0; 
        transform: scaleY(0.8);
    }
    81%, 100% { 
        opacity: 1; 
        transform: scaleY(1);
    }
}

/* 최종 텍스트 스타일 */
.final-text {
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s ease;
}

/* 부분 텍스트 강조 */
.conversation-message.interim .typing-text {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

/* 타이핑 중일 때 메시지 강조 */
.conversation-message.typing-active {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transition: all 0.3s ease;
}

/* 타이핑 완료 애니메이션 */
.conversation-message.typing-complete {
    animation: typeComplete 0.5s ease;
}

@keyframes typeComplete {
    0% {
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: none;
    }
}

/* 실시간 텍스트 변화 효과 */
.message-content.updating {
    position: relative;
    overflow: hidden;
}

.message-content.updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 123, 255, 0.1) 50%, 
        transparent 100%);
    animation: textShimmer 1.5s ease-in-out infinite;
}

@keyframes textShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 실시간 문자 입력 효과 */
.char-typing {
    display: inline-block;
    opacity: 0;
    animation: charFadeIn 0.1s ease-out forwards;
}

@keyframes charFadeIn {
    from {
        opacity: 0;
        transform: translateY(-2px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 부드러운 텍스트 업데이트 */
.text-smooth-update {
    transition: all 0.2s ease;
}

/* 문장 완료 표시 */
.sentence-complete {
    position: relative;
}

.sentence-complete::after {
    content: '✓';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-size: 0.8em;
    opacity: 0;
    animation: checkFadeIn 0.5s ease-out forwards;
}

@keyframes checkFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* 볼륨 인디케이터 스타일 (기존 유지) */
.volume-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.volume-bars {
    display: flex;
    gap: 2px;
    align-items: end;
    height: 20px;
}

.volume-bar {
    width: 3px;
    border-radius: 1px;
    transition: all 0.1s ease;
    background: #ddd;
    opacity: 0.3;
}

.volume-db {
    font-size: 11px;
    color: #666;
    min-width: 40px;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* TTS 버튼 스타일 */
.tts-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
}

.tts-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #0056b3;
}

.tts-btn:active {
    transform: scale(0.95);
}

.tts-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tts-btn:hover {
    background: #007bff;
    color: white;
}

/* 실시간 음성 인식 스타일 */
.interim-text .message-text {
    position: relative;
}

.typing-cursor {
    animation: blink 1s infinite;
    color: var(--primary-color);
    font-weight: bold;
}

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

.accumulated-text {
    border-left-color: #28a745 !important;
    background: #d4edda !important;
}

.completed-original {
    border-left-color: var(--primary-color) !important;
    background: #f8f9fa !important;
}

/* 마이크 버튼 녹음 상태 */
.mic-button-compact.recording {
    background: #28a745 !important;
    border-color: #28a745 !important;
    animation: pulse-record 1.5s infinite;
}

.mic-button-compact.recording .mic-pulse-ring {
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-record {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.status-indicator i {
    font-size: 0.8em;
    animation: pulse 2s infinite;
}

/* 언어 설정 표시 */
.realtime-language-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.language-pair {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.1em;
    font-weight: 500;
}

.from-lang, .to-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: var(--text-color);
}

.language-arrow {
    color: var(--primary-color);
    font-size: 1.2em;
}

.swap-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    background: var(--primary-dark);
    transform: rotate(180deg);
}

/* 메인 컨트롤 영역 */
.realtime-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

/* 마이크 버튼 */
.mic-control-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.mic-button {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    overflow: hidden;
}

.mic-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.mic-button:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}

.mic-button.recording {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: recordingPulse 1.5s infinite;
    position: relative;
}

.mic-button.recording::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid rgba(231, 76, 60, 0.4);
    border-radius: 50%;
    animation: volumeRing 2s infinite;
}

.mic-button.recording::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 2px solid rgba(231, 76, 60, 0.2);
    border-radius: 50%;
    animation: volumeRing 2s infinite 0.5s;
}

.mic-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-icon {
    font-size: 2.5em;
    z-index: 2;
}

.mic-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.8);
}

.mic-button.recording .mic-pulse-ring {
    animation: pulseRing 2s infinite;
}

.mic-text {
    font-size: 0.9em;
    font-weight: 600;
    z-index: 2;
}

/* 음성 레벨 표시 */
.voice-level-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 25px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    min-width: 200px;
    animation: volumeContainerPulse 2s infinite;
}

.voice-level-container::before {
    content: '🎤';
    font-size: 1.2em;
    animation: micIconPulse 1s infinite;
}

.voice-level-bar {
    width: 120px;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.voice-level-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.3) 50%, 
        transparent 100%);
    animation: volumeShimmer 2s infinite;
}

.voice-level-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
    width: 0%;
    transition: width 0.05s ease-out;
    border-radius: 6px;
    position: relative;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.voice-level-text {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 80px;
    text-align: center;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
}

/* 볼륨 표시 애니메이션 */
@keyframes volumeContainerPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
    }
}

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

@keyframes volumeShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

/* TTS 컨트롤 */
.tts-control {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.tts-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-color);
    padding: 10px 20px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.tts-checkbox-label:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.tts-checkbox-label input[type="checkbox"] {
    display: none;
}

.tts-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.tts-checkbox-label input[type="checkbox"]:checked + .tts-checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.tts-checkbox-label input[type="checkbox"]:checked + .tts-checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 1em;
}

.tts-label-text {
    font-size: 1em;
    font-weight: 500;
}

/* 컨트롤 버튼들 */
.control-buttons {
    display: flex;
    gap: 15px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* 대화 내용 표시 영역 */
.conversation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.conversation-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-tts-btn {
    background: var(--info-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.panel-tts-btn:hover {
    background: var(--info-dark);
    transform: translateY(-1px);
}

.conversation-content {
    padding: 20px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 1em;
    line-height: 1.6;
}

.conversation-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.conversation-placeholder i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.3;
}

.conversation-placeholder p {
    margin: 0;
    font-size: 1.1em;
}

/* 대화 메시지 스타일 */
.conversation-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    animation: fadeInUp 0.3s ease;
}

/* 메시지 순번 Badge */
.message-sequence-badge {
    position: absolute;
    top: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

/* 원문 Badge (오른쪽 위) */
.conversation-message.user .message-sequence-badge {
    right: -8px;
    background: linear-gradient(135deg, #007bff, #0056b3);
}

/* 번역문 Badge (왼쪽 위) */
.conversation-message.assistant .message-sequence-badge {
    left: -8px;
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

/* 중간 결과는 Badge 표시 안함 */
.conversation-message.interim .message-sequence-badge {
    display: none;
}

.conversation-message.user {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid var(--primary-color);
}

.conversation-message.assistant {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border-left: 4px solid var(--secondary-color);
}

.conversation-message.interim {
    opacity: 0.7;
    font-style: italic;
    border-left-style: dashed;
}

.message-timestamp {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 5px;
}

/* 설정 패널 */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--primary-color);
    color: white;
}

.settings-header h3 {
    margin: 0;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

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

.settings-content {
    padding: 25px;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
}

.setting-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.setting-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.setting-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.9em;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider-value {
    margin-left: 10px;
    font-weight: 500;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

/* 라디오 버튼 그룹 스타일 */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.radio-label:hover {
    color: var(--primary-color);
}

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

.radio-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.radio-label input[type="radio"]:checked + .radio-checkmark {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-checkmark::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 마이크 장치 선택 */
.device-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.refresh-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
    font-size: 14px;
}

.refresh-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.refresh-btn i {
    font-size: 12px;
}

/* 상태 오버레이 */
.status-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.status-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.status-icon {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.status-message {
    font-size: 1.2em;
    font-weight: 500;
    color: var(--text-color);
}

/* 애니메이션 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

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

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

/* 반응형 디자인 */
@media (max-width: 768px) {
    .realtime-translator-container {
        padding: 10px 8px;
    }
    
    .conversation-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .realtime-controls {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .language-pair {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .language-arrow {
        transform: rotate(90deg);
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    
    .mic-button {
        width: 100px;
        height: 100px;
    }
    
    .mic-icon {
        font-size: 2em;
    }
}

/* 통합된 컨트롤 영역 스타일 */
.realtime-unified-controls {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

/* 단일 행 컨트롤 */
.controls-single-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

/* 언어 섹션 (컴팩트) */
.language-section-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    min-width: 180px;
}

.lang-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

.lang-compact i {
    color: var(--primary-color, #007bff);
    font-size: 12px;
}

.swap-btn-mini {
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 10px;
    flex-shrink: 0;
}

.swap-btn-mini:hover {
    background: var(--primary-color-dark, #0056b3);
    transform: rotate(180deg);
}

/* 마이크 섹션 (컴팩트) */
.mic-section-compact {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mic-button-compact {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    min-width: 90px;
    justify-content: center;
}

.mic-button-compact:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.mic-button-compact:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.mic-button-compact.recording {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    animation: pulse 2s infinite;
}

/* 인라인 볼륨 인디케이터 (말하기 버튼 옆 100px) */
.volume-indicator-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.volume-bar-inline {
    flex: 1;
    height: 6px;
    background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 100%);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.volume-bar-fill-inline {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 70%, #dc3545 90%);
    width: 0%;
    transition: width 0.05s ease-out;
    border-radius: 3px;
    position: relative;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.3);
}

.volume-text-inline {
    font-size: 10px;
    font-weight: 600;
    color: #495057;
    min-width: 22px;
    text-align: center;
    font-family: 'Courier New', monospace;
    background: rgba(102, 126, 234, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
}

/* 실시간 볼륨바 (150px) */
.volume-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 150px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.volume-bar {
    flex: 1;
    height: 8px;
    background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 100%);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.volume-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 70%, #dc3545 90%);
    width: 0%;
    transition: width 0.05s ease-out;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.3);
}

.volume-level-text {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    min-width: 28px;
    text-align: center;
    font-family: 'Courier New', monospace;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 인라인 음성 레벨 표시 */
.voice-level-container-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 120px;
    min-width: 80px;
}

.voice-level-bar {
    flex: 1;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.voice-level-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 2px;
}

.voice-level-text {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

/* 인라인 TTS 컨트롤 */
.tts-control-inline {
    flex-shrink: 0;
}

.tts-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
}

.tts-checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #dee2e6;
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.tts-checkbox-label input[type="checkbox"] {
    display: none;
}

.tts-checkbox-label input[type="checkbox"]:checked + .tts-checkmark {
    background: var(--primary-color, #007bff);
    border-color: var(--primary-color, #007bff);
}

.tts-checkbox-label input[type="checkbox"]:checked + .tts-checkmark::after {
    content: '✓';
    position: absolute;
    top: -3px;
    left: 1px;
    color: white;
    font-size: 11px;
    font-weight: bold;
}

/* 인라인 컨트롤 버튼들 */
.control-buttons-inline {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.control-btn-compact {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    font-size: 12px;
}

.control-btn-compact:hover {
    background: var(--primary-color, #007bff);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .language-section-compact {
        min-width: 160px;
    }
    
    .voice-level-container-inline {
        max-width: 100px;
    }
}

@media (max-width: 768px) {
    .controls-single-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .language-section-compact {
        min-width: 140px;
        order: 1;
    }
    
    .mic-section-compact {
        order: 2;
    }
    
    .voice-level-container-inline {
        order: 3;
        max-width: 80px;
    }
    
    .tts-control-inline {
        order: 4;
    }
    
    .control-buttons-inline {
        order: 5;
    }
}

@media (max-width: 480px) {
    .realtime-unified-controls {
        padding: 6px 8px;
    }
    
    .controls-single-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .language-section-compact {
        min-width: auto;
        justify-content: center;
    }
    
    .mic-section-compact {
        display: flex;
        justify-content: center;
    }
    
    .mic-button-compact {
        padding: 8px 16px;
        min-width: 80px;
    }
    
    .control-btn-compact {
        width: 28px;
        height: 28px;
    }
    
    .voice-level-container-inline,
    .tts-control-inline,
    .control-buttons-inline {
        justify-content: center;
    }
} 