/* ==========================================================================
   CHAT AUDIOS - MODULAR VOICE NOTE & AUDIO RECORDING STYLES (APPLE HIG)
   ========================================================================== */

/* Microphone Button in Input Bar */
.ca-mic-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  background: rgba(241, 245, 249, 0.9) !important;
  color: #2546ED !important;
  border: 1px solid rgba(203, 213, 225, 0.8) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0 !important;
}

.ca-mic-btn:hover {
  background: #2546ED !important;
  color: #FFFFFF !important;
  border-color: #2546ED !important;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 70, 237, 0.3) !important;
}

.ca-mic-btn.recording {
  background: #EF4444 !important;
  color: #FFFFFF !important;
  border-color: #EF4444 !important;
  animation: caPulseMic 1.2s infinite ease-in-out !important;
}

@keyframes caPulseMic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Floating Audio Recording Bar Overlay */
.ca-recording-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(37, 70, 237, 0.25);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  animation: caSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

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

.ca-recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ca-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #EF4444;
  animation: caBlink 1s infinite;
}

@keyframes caBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.ca-rec-timer {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  font-family: monospace;
}

/* Audio Wave Visualizer */
.ca-wave-container {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}

.ca-wave-bar {
  width: 3px;
  background: #2546ED;
  border-radius: 3px;
  height: 4px;
  transition: height 0.1s ease;
}

.ca-btn-cancel {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #64748B;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ca-btn-cancel:hover {
  background: #FEE2E2;
  color: #EF4444;
  border-color: #FCA5A5;
}

.ca-btn-send {
  background: linear-gradient(135deg, #2546ED 0%, #1032CC 100%);
  color: #FFFFFF;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 70, 237, 0.3);
  transition: transform 0.15s ease;
}

.ca-btn-send:hover {
  transform: scale(1.08);
}

/* Voice Note Player Card in Chat Message Stream */
.ca-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  min-width: 220px;
  margin: 4px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-message.sent .ca-player-card {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
}

.ca-player-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2546ED;
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 70, 237, 0.25);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.chat-message.sent .ca-player-btn {
  background: #FFFFFF;
  color: #2546ED;
}

.ca-player-btn:hover {
  transform: scale(1.08);
}

.ca-player-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.ca-player-title {
  font-size: 12px;
  font-weight: 700;
}

.ca-player-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.ca-player-wave-bar {
  flex: 1;
  height: 6px;
  background: rgba(37, 70, 237, 0.3);
  border-radius: 2px;
}

.chat-message.sent .ca-player-wave-bar {
  background: rgba(255, 255, 255, 0.4);
}
