/* voice.css - 语音消息专用样式 */

.input-container.voice-recording,
.input-container.voice-preview {
  position: relative;
  display: flex;
  align-items: center;
  border: none;
  border-radius: 12px;
  transition: background 0.3s, box-shadow 0.3s;
  padding: 8px 10px 8px 16px;
  gap: 10px;
  justify-content: flex-start;
  min-height: 72px;
}

.input-container.voice-recording {
  background: linear-gradient(90deg, #e8efff 0%, #f5f9ff 100%);
  box-shadow: 
    0 0 0 1px rgba(79, 140, 255, 0.2),
    0 0 8px 2px rgba(79, 140, 255, 0.25),
    0 2px 12px 0 rgba(80, 120, 255, 0.15);
}

.input-container.voice-preview {
  background: linear-gradient(90deg, #e0e7ff 0%, #f0f4ff 100%);
  box-shadow: 
    0 0 0 1px rgba(0, 191, 174, 0.2),
    0 0 8px 2px rgba(0, 191, 174, 0.25),
    0 2px 12px 0 rgba(80, 120, 255, 0.15);
}

.input-container.voice-recording::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.7), rgba(120, 180, 255, 0.4), rgba(180, 210, 255, 0.3));
  z-index: -1;
  filter: blur(3px);
  pointer-events: none;
}
.input-container.voice-preview::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(0, 191, 174, 0.7), rgba(0, 210, 190, 0.4), rgba(180, 255, 250, 0.3));
  z-index: -1;
  filter: blur(3px);
  pointer-events: none;
}

.voice-wave {
  position: absolute;
  left: 50px; 
  right: 50px; 
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
}

.voice-wave-canvas {
  width: 100%;
  height: 40px;
}

.voice-status-tip {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  max-width: 320px;
  background: #fff;
  color: #222;
  font-size: 15px;
  font-weight: 500;
  border-radius: 20px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.10);
  padding: 8px 20px;
  pointer-events: none;
  border: 1px solid #e0e0e0;
  box-sizing: border-box;
}
.voice-status-tip .tip-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}
.voice-status-tip .tip-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-status-tip .tip-timer {
  font-family: monospace;
  font-size: 14px;
  color: #666;
  margin-left: 8px;
}

.voice-mic-btn {
  transition: all 0.3s ease;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0 8px 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  margin: 0;
  order: 0;
}
.voice-mic-btn:hover svg path {
  fill: #4f8cff;
}

.voice-speaker-wave-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-speaker-wave-anim {
  position: absolute;
  left: 50%; top: 50%;
  width: 36px; height: 36px;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  background: radial-gradient(circle, #ffbdbd55 60%, transparent 100%);
  animation: voice-speaker-wave-pulse 1.2s infinite;
  z-index: 1;
}
@keyframes voice-speaker-wave-pulse {
  0% { opacity: 0.7; transform: translate(-50%,-50%) scale(1); }
  70% { opacity: 0.2; transform: translate(-50%,-50%) scale(1.4); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.7); }
}

.voice-preview-play {
  background: #00bfae;
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px 0 #00bfae22;
  transition: all 0.2s ease;
  margin-right: 8px;
  order: 0;
}
.voice-preview-play:hover {
  background: #009e8e;
  transform: scale(1.05);
}
.voice-preview-time {
  color: #00bfae;
  font-size: 15px;
  font-weight: 600;
  min-width: 48px;
  text-align: center;
  margin-right: 8px;
  order: 1;
}
.voice-preview-wave {
  flex: 1;
  height: 18px;
  min-width: 60px;
  max-width: 120px;
  display: flex;
  align-items: center;
  margin-right: 8px;
  order: 2;
}
.voice-preview-wave-anim {
  width: 100%; height: 100%;
  background: url('data:image/svg+xml;utf8,<svg width="120" height="18" viewBox="0 0 120 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 9 Q15 0 30 9 T60 9 T90 9 T120 9" stroke="%2300bfae" stroke-width="2" fill="none"><animate attributeName="d" values="M0 9 Q15 0 30 9 T60 9 T90 9 T120 9;M0 9 Q15 18 30 9 T60 9 T90 9 T120 9;M0 9 Q15 0 30 9 T60 9 T90 9 T120 9" dur="1s" repeatCount="indefinite"/></path></svg>') repeat-x;
  animation: voice-wave-move 1.2s linear infinite;
}
.voice-preview-close {
  background: #fff4f4;
  border: 1px solid #ffdddd;
  border-radius: 8px;
  color: #ff4d4f;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 0;
  order: 3;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(255, 77, 79, 0.15);
}
.voice-preview-close:hover {
  background: #ffe4e4;
  color: #d9001b;
  transform: scale(1.05);
}
.voice-preview-close:active {
  transform: scale(0.95);
}

/* 新增样式，确保操作按钮（小飞机）在最右侧 */
.action-button.voice-preview-active {
  margin-left: auto;
  order: 4;
}

@media (max-width: 600px) {
  .voice-preview-box { font-size: 14px; padding: 6px 6px; }
  .voice-preview-play { width: 30px; height: 30px; }
  .voice-preview-time { font-size: 13px; }
  .voice-preview-wave { min-width: 40px; max-width: 80px; }
  .voice-preview-close { width: 32px; height: 32px; font-size: 16px; }
}

.input-wrapper {
  position: relative;
  width: 100%;
}

/* 语音消息播放条 - 统一为voice_message_buttons_test.html风格 */
.voice-player {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    box-sizing: border-box;
}
.voice-player .play-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fa5252;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(250, 82, 82, 0.3);
}
.voice-player.sent .play-btn {
    background: #ff8787;
}
.voice-player .play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(250, 82, 82, 0.4);
}
.voice-player .play-btn:active {
    transform: scale(0.98);
}
.voice-player .play-btn svg {
    transition: all 0.3s ease;
    fill: white;
    width: 18px;
    height: 18px;
}
.voice-player .play-btn .play-icon { display: block; }
.voice-player .play-btn .pause-icon { display: none; }
.voice-player.playing .play-btn .play-icon { display: none; }
.voice-player.playing .play-btn .pause-icon { display: block; }
.voice-player .progress-container {
    flex: 1 1 0;
    min-width: 40px;
    max-width: calc(100% - 100px);
    position: relative;
    height: 4px;
    background: rgba(173, 181, 189, 0.2);
    border-radius: 2px;
    overflow: hidden;
}
.bubble.sent .voice-player .progress-container {
    background: rgba(255, 92, 92, 0.2);
}
.voice-player .progress-bar {
    position: absolute;
    height: 100%;
    width: 0%;
    background: #fa5252;
    transition: width 0.2s linear;
}
.bubble.sent .voice-player .progress-bar {
    background: #ff8787;
}
.voice-player .progress-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fa5252;
    top: 50%;
    transform: translateY(-50%) scale(0);
    left: 0;
    margin-left: -4px;
    z-index: 2;
    transition: transform 0.3s ease;
    box-shadow: 0 0 0 0 rgba(250, 82, 82, 0.3);
}
.bubble.sent .voice-player .progress-dot {
    background: #ff8787;
}
.voice-player.playing .progress-dot {
    transform: translateY(-50%) scale(1);
    animation: pulse-dot 1.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}
@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(250, 82, 82, 0.3); }
    70% { box-shadow: 0 0 0 6px rgba(250, 82, 82, 0); }
    100% { box-shadow: 0 0 0 0 rgba(250, 82, 82, 0); }
}
.voice-player .duration-display {
    flex-shrink: 0;
    min-width: 48px;
    max-width: 64px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
    background: rgba(173, 181, 189, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}
.bubble.sent .voice-player .duration-display {
    color: #e03131;
    background: rgba(255, 107, 107, 0.1);
}
.voice-player .duration-display .time-icon {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}
.voice-player .wave-indicator {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 14px;
    margin-right: 4px;
    opacity: 0.7;
}
.voice-player .wave-line {
    width: 2px;
    height: 30%;
    background: #adb5bd;
    border-radius: 1px;
}
.bubble.sent .voice-player .wave-line {
    background: #ff8787;
}
.voice-player.playing .wave-line {
    animation: wave-line 1s ease-in-out infinite alternate;
}
.voice-player .wave-line:nth-child(1) { height: 30%; animation-delay: 0s; }
.voice-player .wave-line:nth-child(2) { height: 60%; animation-delay: 0.2s; }
.voice-player .wave-line:nth-child(3) { height: 40%; animation-delay: 0.4s; }
@keyframes wave-line {
    0% { height: 30%; }
    100% { height: 80%; }
}
@media (max-width: 480px) {
    .bubble {
        max-width: 90%;
        padding: 10px 12px;
    }
    .voice-player .play-btn {
        width: 32px;
        height: 32px;
    }
    .voice-player .duration-display {
        font-size: 12px;
        padding: 2px 6px;
    }
}

.voice-bubble-style {
    background: #eaedf2 !important;
    border-radius: 18px !important;
    padding: 12px 16px !important;
    max-width: 80%;
    display: inline-block;
    margin: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
}
.voice-bubble-style.sent {
    background: #ffe3e3 !important;
    border-top-right-radius: 4px !important;
    border-top-left-radius: 18px !important;
    align-self: flex-end;
}
.voice-bubble-style.received {
    background: #eaedf2 !important;
    border-top-left-radius: 4px !important;
    border-top-right-radius: 18px !important;
    align-self: flex-start;
}

.bubble {
    padding: 12px 16px;
    max-width: 80%;
    min-width: 180px;
    display: block;
    margin: 10px 0;
    border-radius: 18px;
    width: auto;
    box-sizing: border-box;
}
.bubble.sent {
    background: #ffe3e3;
    border-top-right-radius: 4px;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
    width: auto;
}
.bubble.received {
    background: #eaedf2;
    border-top-left-radius: 4px;
    align-self: flex-start;
    margin-right: auto;
    margin-left: 0;
    width: auto;
}

/* 彻底去除所有录音按钮的背景，仅显示SVG，保证所有浏览器一致 */
.voice-preview-play,
.micButton,
.voice-speaker-wave-btn,
.voice-preview-close {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
}
.voice-preview-play svg,
.micButton svg,
.voice-speaker-wave-btn svg,
.voice-preview-close svg {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
} 

