﻿.voice-chat-toggle-btn {
  position: fixed;
  bottom: 20px;
  left: 80px;
  width: 48px;
  height: 48px;
  background: #151515;
  border: 1px solid #222;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #666;
  z-index: 100;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.voice-chat-toggle-btn:hover {
  background: #1e1e1e;
  border-color: #333;
  transform: translateY(-2px);
}

.voice-chat-toggle-btn:active {
  transform: translateY(0) scale(0.95);
}

.voice-chat-toggle-btn.active {
  background: #1e3a1e;
  border-color: #2a5a2a;
  color: #4ade80;
}

.voice-chat-toggle-btn.muted {
  background: #3a1515;
  border-color: #5a2020;
  color: #f87171;
}

.voice-chat-panel {
  position: fixed;
  bottom: 80px;
  left: 20px;
  width: 320px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 20px;
  display: none;
  flex-direction: column;
  gap: 16px;
  z-index: 150;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: voicePanelIn 0.2s ease both;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .voice-chat-toggle-btn {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: 60px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .voice-chat-panel {
    bottom: 128px;
    left: 10px;
    right: 10px;
    transform: none;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 180px);
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .voice-chat-panel {
    bottom: 130px;
    width: calc(100vw - 30px);
    padding: 14px;
    gap: 14px;
  }
}

@keyframes voicePanelIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.voice-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.voice-chat-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.voice-chat-close {
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.voice-chat-close:hover {
  color: #aaa;
}

.voice-setting {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-setting-label {
  font-size: 13px;
  font-weight: 600;
  color: #aaa;
}

.voice-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  background: rgba(128,128,128,0.3);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.voice-toggle:hover {
  background: rgba(128,128,128,0.4);
}

.voice-toggle:active {
  transform: scale(0.95);
}

.voice-toggle.active {
  background: rgba(74,222,128,0.3);
}

.voice-toggle-circle {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  pointer-events: none;
}

.voice-toggle.active .voice-toggle-circle {
  transform: translateX(22px);
  background: #4ade80;
}

@media (max-width: 768px) {
  .voice-toggle {
    width: 52px;
    height: 28px;
  }
  
  .voice-toggle-circle {
    width: 22px;
    height: 22px;
  }
  
  .voice-toggle.active .voice-toggle-circle {
    transform: translateX(24px);
  }
}

.voice-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-slider {
  flex: 1;
  height: 6px;
  background: #1a1a1a;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  touch-action: none;
}

.voice-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.voice-slider::-webkit-slider-thumb:hover {
  background: #1d4ed8;
  transform: scale(1.1);
}

.voice-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

.voice-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #2563eb;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.voice-slider::-moz-range-thumb:hover {
  background: #1d4ed8;
  transform: scale(1.1);
}

.voice-slider::-moz-range-thumb:active {
  transform: scale(1.2);
}

@media (max-width: 768px) {
  .voice-slider {
    height: 8px;
  }
  
  .voice-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }
  
  .voice-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
}

.voice-slider-value {
  font-size: 12px;
  font-weight: 700;
  color: #666;
  min-width: 36px;
  text-align: right;
}

.voice-keybind-btn {
  padding: 6px 12px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 80px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.voice-keybind-btn:hover {
  background: #222;
  border-color: #333;
  color: #aaa;
}

.voice-keybind-btn:active {
  transform: scale(0.95);
}

.voice-keybind-btn.recording {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
  animation: keybindPulse 1s ease-in-out infinite;
}

@media (max-width: 768px) {
  .voice-keybind-btn {
    padding: 8px 14px;
    font-size: 13px;
    min-width: 90px;
  }
}

@keyframes keybindPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.voice-test-btn {
  padding: 10px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.voice-test-btn:hover {
  background: #222;
  border-color: #333;
  color: #aaa;
}

.voice-test-btn:active {
  transform: scale(0.98);
}

.voice-test-btn.testing {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}

@media (max-width: 768px) {
  .voice-test-btn {
    padding: 12px;
    font-size: 14px;
  }
}

.voice-mic-select {
  width: 100%;
  padding: 8px 12px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #aaa;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.voice-mic-select:hover {
  background: #222;
  border-color: #333;
}

.voice-mic-select:focus {
  border-color: #2563eb;
  background: #222;
}

.voice-mic-select option {
  background: #1a1a1a;
  color: #aaa;
  padding: 8px;
}

@media (max-width: 768px) {
  .voice-mic-select {
    padding: 10px 14px;
    font-size: 14px;
  }
}

.voice-divider {
  height: 1px;
  background: #1e1e1e;
  margin: 4px 0;
}

.voice-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #4ade80;
  border: 2px solid #111;
  border-radius: 50%;
  animation: voiceIndicatorPulse 1.5s ease-in-out infinite;
}

@keyframes voiceIndicatorPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.voice-indicator.muted {
  background: #f87171;
}

body.light-theme .voice-chat-toggle-btn {
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #666;
}

body.light-theme .voice-chat-toggle-btn:hover {
  background: #e8e8e8;
  border-color: #d0d0d0;
}

body.light-theme .voice-chat-toggle-btn.active {
  background: #e8f5e9;
  border-color: #a5d6a7;
  color: #2e7d32;
}

body.light-theme .voice-chat-toggle-btn.muted {
  background: #ffebee;
  border-color: #ef9a9a;
  color: #c62828;
}

body.light-theme .voice-chat-panel {
  background: #fff;
  border-color: #e0e0e0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

body.light-theme .voice-chat-title {
  color: #222;
}

body.light-theme .voice-chat-close {
  color: #999;
}

body.light-theme .voice-chat-close:hover {
  color: #666;
}

body.light-theme .voice-setting-label {
  color: #666;
}

body.light-theme .voice-toggle {
  background: rgba(0,0,0,0.1);
}

body.light-theme .voice-toggle:hover {
  background: rgba(0,0,0,0.15);
}

body.light-theme .voice-toggle.active {
  background: rgba(46,125,50,0.2);
}

body.light-theme .voice-toggle-circle {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

body.light-theme .voice-toggle.active .voice-toggle-circle {
  background: #4caf50;
}

body.light-theme .voice-slider {
  background: #e0e0e0;
}

body.light-theme .voice-slider::-webkit-slider-thumb {
  background: #2563eb;
}

body.light-theme .voice-slider::-moz-range-thumb {
  background: #2563eb;
}

body.light-theme .voice-slider-value {
  color: #999;
}

body.light-theme .voice-keybind-btn {
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #666;
}

body.light-theme .voice-keybind-btn:hover {
  background: #e8e8e8;
  border-color: #d0d0d0;
  color: #444;
}

body.light-theme .voice-test-btn {
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #666;
}

body.light-theme .voice-test-btn:hover {
  background: #e8e8e8;
  border-color: #d0d0d0;
  color: #444;
}

body.light-theme .voice-mic-select {
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #666;
}

body.light-theme .voice-mic-select:hover {
  background: #e8e8e8;
  border-color: #d0d0d0;
}

body.light-theme .voice-mic-select:focus {
  border-color: #2563eb;
  background: #fff;
}

body.light-theme .voice-mic-select option {
  background: #fff;
  color: #666;
}

body.light-theme .voice-divider {
  background: #e0e0e0;
}

body.light-theme .voice-indicator {
  border-color: #fff;
}
