@charset "utf-8";

/* ============================================
   Material Design 3 - 음성 녹음 UI
   커스텀 색상 팔레트
   ============================================ */

/* 커스텀 색상 시스템 */
:root {
  /* 메인 컬러 - 잿빛 민트 */
  --md-sys-color-primary: #a3c4bc;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d4e8e3;
  --md-sys-color-on-primary-container: #2d4a44;

  /* 보조 배경 - 샌드 베이지 */
  --md-sys-color-secondary: #d6c2a6;
  --md-sys-color-on-secondary: #4a4a4a;
  --md-sys-color-secondary-container: #ede4d6;
  --md-sys-color-on-secondary-container: #3d3428;

  /* 보조 강조 - 잿빛 민트 */
  --md-sys-color-tertiary: #a3c4bc;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #d4e8e3;
  --md-sys-color-on-tertiary-container: #2d4a44;

  /* 포인트 - 드라이 로즈 */
  --md-sys-color-accent: #d8a39d;
  --md-sys-color-on-accent: #ffffff;
  --md-sys-color-accent-container: #f0ddd9;
  --md-sys-color-on-accent-container: #4a3330;

  /* 에러 */
  --md-sys-color-error: #d8a39d;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #f0ddd9;
  --md-sys-color-on-error-container: #4a3330;

  /* 성공 */
  --md-sys-color-success: #a3c4bc;
  --md-sys-color-on-success: #ffffff;

  /* 경고 */
  --md-sys-color-warning: #d6c2a6;
  --md-sys-color-on-warning: #4a4a4a;

  /* 기본 배경 - 화이트 */
  --md-sys-color-surface: #ffffff;
  --md-sys-color-on-surface: #4a4a4a;
  --md-sys-color-surface-variant: #f5f5f5;
  --md-sys-color-on-surface-variant: #6b6b6b;
  --md-sys-color-surface-container: #fafafa;
  --md-sys-color-surface-container-low: #fcfcfc;
  --md-sys-color-surface-container-high: #f0f0f0;
  --md-sys-color-surface-container-highest: #ebebeb;

  /* 아웃라인 */
  --md-sys-color-outline: #c0c0c0;
  --md-sys-color-outline-variant: #e0e0e0;

  /* Elevation shadows */
  --md-sys-elevation-0: none;
  --md-sys-elevation-1: 0px 1px 3px rgba(0, 0, 0, 0.08),
    0px 1px 2px rgba(0, 0, 0, 0.12);
  --md-sys-elevation-2: 0px 2px 6px rgba(0, 0, 0, 0.08),
    0px 3px 8px rgba(0, 0, 0, 0.12);
  --md-sys-elevation-3: 0px 4px 12px rgba(0, 0, 0, 0.1),
    0px 2px 6px rgba(0, 0, 0, 0.08);
  --md-sys-elevation-4: 0px 6px 16px rgba(0, 0, 0, 0.12),
    0px 3px 8px rgba(0, 0, 0, 0.1);

  /* Shape */
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 9999px;

  /* Motion */
  --md-sys-motion-easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --md-sys-motion-easing-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --md-sys-motion-duration-short: 200ms;
  --md-sys-motion-duration-medium: 300ms;
  --md-sys-motion-duration-long: 400ms;
}

/* ============================================
   토글 버튼 - Material Chip (체크박스 제거)
   ============================================ */
.voice-recorder-toggle {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
}

.voice-recorder-toggle input[type="checkbox"],
.voice-recorder-toggle input[type="checkbox"] + label span,
.voice-recorder-toggle input[type="checkbox"]::before,
.voice-recorder-toggle input[type="checkbox"]::after {
  display: none !important;
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}

.voice-recorder-toggle label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: auto;
  line-height: 1.5;
  background: transparent;
  border: none;
  border-radius: var(--md-sys-shape-corner-small);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-standard);
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  user-select: none;
  box-shadow: none;
  vertical-align: middle;
}

.voice-recorder-toggle label:hover {
  background: rgba(163, 196, 188, 0.1);
  color: var(--md-sys-color-primary);
}

.voice-recorder-toggle input[type="checkbox"]:checked + label {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-1);
}

.voice-recorder-toggle input[type="checkbox"]:checked + label:hover {
  background: #8fcfc4;
  box-shadow: var(--md-sys-elevation-2);
}

.voice-recorder-toggle label svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* 체크박스 관련 모든 요소 완전 제거 */
.voice-recorder-toggle .chk_box,
.voice-recorder-toggle label span:not(span:last-child) {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
}

/* ============================================
   음성 녹음 컨테이너 - Material Surface
   ============================================ */
.voice-recorder-container {
  display: none;
  position: relative;
  min-height: 480px;
  background: linear-gradient(
    135deg,
    var(--md-sys-color-surface-container-low) 0%,
    var(--md-sys-color-surface) 100%
  );
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  padding: 48px 24px;
  margin-top: 16px;
  box-shadow: var(--md-sys-elevation-2);
  overflow: hidden;
}

.voice-recorder-container.active,
#voice-recorder-container.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  animation: voice-container-enter var(--md-sys-motion-duration-long)
    var(--md-sys-motion-easing-emphasized);
}

@keyframes voice-container-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   헤더
   ============================================ */
.voice-recorder-header {
  text-align: center;
  margin-bottom: 40px;
}

.voice-recorder-header h3 {
  font-size: 28px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.voice-recorder-header p {
  font-size: 15px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
  letter-spacing: 0;
}

/* ============================================
   마이크 영역
   ============================================ */
.voice-recorder-mic-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 48px 0;
}

.voice-mic-icon-container {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 마이크 아이콘 - Material FAB */
.voice-mic-icon {
  width: 112px;
  height: 112px;
  background: var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-full);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all var(--md-sys-motion-duration-medium)
    var(--md-sys-motion-easing-emphasized);
  box-shadow: var(--md-sys-elevation-3);
  cursor: pointer;
  animation: float-idle 3s ease-in-out infinite;
  /* GPU 가속 최적화 */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.voice-mic-icon::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary);
  opacity: 0.1;
  z-index: -1;
  animation: glow-pulse 2s ease-in-out infinite;
}

.voice-mic-icon::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: radial-gradient(
    circle,
    var(--md-sys-color-primary) 0%,
    transparent 70%
  );
  opacity: 0;
  z-index: -2;
  animation: ambient-glow 4s ease-in-out infinite;
}

.voice-mic-icon svg {
  width: 56px;
  height: 56px;
  fill: var(--md-sys-color-on-primary);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-emphasized);
}

.voice-mic-icon:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 12px 32px rgba(163, 196, 188, 0.5);
  animation: float-hover 1.5s ease-in-out infinite;
}

.voice-mic-icon:hover svg {
  transform: scale(1.1) rotate(5deg);
}

.voice-mic-icon:active {
  transform: scale(0.95);
  box-shadow: var(--md-sys-elevation-2);
}

/* 기본 떠있는 애니메이션 */
@keyframes float-idle {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* 호버 시 더 빠른 떠있는 애니메이션 */
@keyframes float-hover {
  0%,
  100% {
    transform: scale(1.1) translateY(-4px);
  }
  50% {
    transform: scale(1.1) translateY(-12px);
  }
}

/* 글로우 펄스 효과 */
@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.1);
  }
}

/* 주변 글로우 효과 */
@keyframes ambient-glow {
  0%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.2;
    transform: scale(1.3);
  }
}

/* 녹음 중 상태 */
.voice-mic-icon.recording {
  background: var(--md-sys-color-accent);
  animation: pulse-mic 1.5s ease-in-out infinite,
    recording-shake 0.15s ease-in-out infinite alternate;
  box-shadow: 0 8px 32px rgba(216, 163, 157, 0.6),
    0 0 60px rgba(216, 163, 157, 0.3);
  /* 애니메이션 성능 최적화 */
  will-change: transform, box-shadow;
}

.voice-mic-icon.recording::before {
  background: var(--md-sys-color-accent);
  animation: pulse-ring 2s ease-out infinite;
}

.voice-mic-icon.recording::after {
  background: radial-gradient(
    circle,
    var(--md-sys-color-accent) 0%,
    transparent 70%
  );
  animation: recording-glow 2s ease-in-out infinite;
}

.voice-mic-icon.recording svg {
  fill: var(--md-sys-color-on-accent);
  animation: mic-bounce 0.6s ease-in-out infinite;
}

@keyframes pulse-mic {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.2;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@keyframes recording-shake {
  0% {
    transform: translateX(0) scale(1);
  }
  100% {
    transform: translateX(1px) scale(1.02);
  }
}

@keyframes recording-glow {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(1.2);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.5);
  }
}

@keyframes mic-bounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.05);
  }
}

/* 일시정지 상태 */
.voice-mic-icon.paused {
  background: var(--md-sys-color-secondary);
  box-shadow: 0 8px 24px rgba(214, 194, 166, 0.4);
  animation: paused-breathe 3s ease-in-out infinite;
}

.voice-mic-icon.paused::before {
  background: var(--md-sys-color-secondary);
  animation: paused-glow 3s ease-in-out infinite;
}

.voice-mic-icon.paused::after {
  background: radial-gradient(
    circle,
    var(--md-sys-color-secondary) 0%,
    transparent 70%
  );
  animation: paused-ambient 4s ease-in-out infinite;
}

.voice-mic-icon.paused svg {
  fill: var(--md-sys-color-on-secondary);
  animation: paused-fade 2s ease-in-out infinite;
}

@keyframes paused-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

@keyframes paused-glow {
  0%,
  100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.25;
  }
}

@keyframes paused-ambient {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 0.15;
  }
}

@keyframes paused-fade {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* 파동 효과 - Material Ripple */
.voice-wave {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--md-sys-shape-corner-full);
  border: 3px solid var(--md-sys-color-primary);
  opacity: 0;
  top: 0;
  left: 0;
}

.voice-mic-icon.recording ~ .voice-wave {
  animation: wave-animation 2.5s ease-out infinite;
  border-color: var(--md-sys-color-accent);
}

.voice-wave:nth-child(2) {
  animation-delay: 0.5s;
}

.voice-wave:nth-child(3) {
  animation-delay: 1s;
}

@keyframes wave-animation {
  0% {
    transform: scale(0.7);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* ============================================
   상태 표시
   ============================================ */
.voice-recorder-status {
  text-align: center;
  margin-top: 32px;
}

.voice-status-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

.voice-status-text.recording {
  color: var(--md-sys-color-accent);
}

.voice-status-text.paused {
  color: var(--md-sys-color-secondary);
}

/* 타이머 */
.voice-timer {
  font-size: 56px;
  font-weight: 300;
  color: var(--md-sys-color-on-surface);
  font-family: "Roboto Mono", "Courier New", monospace;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ============================================
   컨트롤 버튼 - Material Buttons
   ============================================ */
.voice-recorder-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 48px;
  flex-wrap: wrap;
}

/* 버튼 공통 스타일 - Material Filled Button */
.voice-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  height: 48px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-standard);
  box-shadow: var(--md-sys-elevation-1);
  position: relative;
  overflow: hidden;
  user-select: none;
}

/* Ripple 효과 제거됨 */

.voice-control-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-3);
}

.voice-control-btn:active {
  transform: translateY(0);
  box-shadow: var(--md-sys-elevation-1);
}

.voice-control-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Ripple 효과 제거됨 */

.voice-control-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  position: relative;
  z-index: 1;
}

.voice-control-btn span {
  position: relative;
  z-index: 1;
}

/* 녹음 시작 버튼 */
.voice-btn-start,
.voice-btn-resume {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.voice-btn-start:hover,
.voice-btn-resume:hover {
  background: #8fcfc4;
}

/* 일시정지 버튼 */
.voice-btn-pause {
  background: var(--md-sys-color-secondary);
  color: var(--md-sys-color-on-secondary);
}

.voice-btn-pause:hover {
  background: #dec9af;
}

/* 녹음 종료 버튼 */
.voice-btn-stop {
  background: var(--md-sys-color-accent);
  color: var(--md-sys-color-on-accent);
}

.voice-btn-stop:hover {
  background: #e0afa9;
}

/* 취소 버튼 - Outlined Button */
.voice-btn-cancel {
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  border: 2px solid var(--md-sys-color-outline);
  box-shadow: none;
}

.voice-btn-cancel:hover {
  background: var(--md-sys-color-surface-variant);
  border-color: var(--md-sys-color-on-surface-variant);
}

/* Ripple 효과 제거됨 */

/* ============================================
   오디오 플레이어 - Material Card
   ============================================ */
.voice-audio-player {
  display: none;
  margin-top: 32px;
  padding: 28px;
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: var(--md-sys-elevation-2);
}

.voice-audio-player.active {
  display: block;
  animation: fade-in var(--md-sys-motion-duration-medium)
    var(--md-sys-motion-easing-standard);
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.voice-audio-player h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin: 0 0 20px 0;
  letter-spacing: -0.2px;
}

/* ============================================
   믹서 패널 - 항상 표시
   ============================================ */
.voice-mixer-panel {
  margin-top: 32px;
  padding: 24px;
  background: linear-gradient(
    135deg,
    var(--md-sys-color-primary-container) 0%,
    var(--md-sys-color-surface) 100%
  );
  border: 2px solid var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: var(--md-sys-elevation-3);
  animation: mixer-appear var(--md-sys-motion-duration-long)
    var(--md-sys-motion-easing-emphasized);
}

@keyframes mixer-appear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.voice-mixer-panel h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin: 0 0 16px 0;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-mixer-content {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.voice-effect-selector {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-effect-selector label {
  font-size: 13px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.voice-effect-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-standard);
  box-shadow: var(--md-sys-elevation-1);
}

.voice-effect-select:hover {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container);
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-2);
}

.voice-effect-select:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 4px rgba(163, 196, 188, 0.3);
  transform: translateY(-2px);
}

.voice-btn-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  height: 48px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-standard);
  box-shadow: var(--md-sys-elevation-2);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

/* Ripple 효과 제거됨 */

.voice-btn-preview svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  position: relative;
  z-index: 1;
}

.voice-btn-preview span {
  position: relative;
  z-index: 1;
}

.voice-btn-preview:hover {
  background: #8fcfc4;
  box-shadow: var(--md-sys-elevation-3);
  transform: translateY(-3px);
}

.voice-btn-preview:active {
  transform: translateY(-1px);
  box-shadow: var(--md-sys-elevation-1);
}

.voice-btn-preview:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--md-sys-elevation-1);
}

/* Ripple 효과 제거됨 */

.voice-audio-player audio {
  width: 100%;
  margin-bottom: 20px;
  border-radius: var(--md-sys-shape-corner-small);
}

.voice-audio-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.voice-audio-actions button {
  padding: 10px 24px;
  height: 44px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-standard);
  position: relative;
  overflow: hidden;
}

.voice-btn-use {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-1);
}

.voice-btn-use:hover {
  background: #8fcfc4;
  box-shadow: var(--md-sys-elevation-2);
  transform: translateY(-2px);
}

.voice-btn-rerecord {
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  border: 2px solid var(--md-sys-color-outline);
}

.voice-btn-rerecord:hover {
  background: var(--md-sys-color-surface-variant);
  border-color: var(--md-sys-color-on-surface-variant);
}

/* ============================================
   에러 메시지 - Material Banner
   ============================================ */
.voice-error-message {
  display: none;
  padding: 20px 28px;
  background: var(--md-sys-color-error-container);
  border-left: 4px solid var(--md-sys-color-accent);
  border-radius: var(--md-sys-shape-corner-medium);
  color: var(--md-sys-color-on-error-container);
  margin-top: 24px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: var(--md-sys-elevation-1);
}

.voice-error-message.active {
  display: block;
  animation: slide-up var(--md-sys-motion-duration-medium)
    var(--md-sys-motion-easing-emphasized);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   파일 정보 - Material Card
   ============================================ */
.voice-file-info {
  display: none;
  margin-top: 24px;
  padding: 24px 28px;
  background: var(--md-sys-color-primary-container);
  border-radius: var(--md-sys-shape-corner-large);
  text-align: center;
  box-shadow: var(--md-sys-elevation-1);
  border: 1px solid var(--md-sys-color-primary);
}

.voice-file-info.active {
  display: block;
  animation: fade-in var(--md-sys-motion-duration-medium)
    var(--md-sys-motion-easing-standard);
}

.voice-file-info p {
  margin: 8px 0;
  font-size: 15px;
  color: var(--md-sys-color-on-primary-container);
  letter-spacing: 0;
}

.voice-file-info strong {
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

/* ============================================
   로딩 스피너 - Material Progress Indicator
   ============================================ */
.voice-loading {
  display: none;
  text-align: center;
  margin-top: 24px;
}

.voice-loading.active {
  display: block;
}

.voice-spinner {
  border: 4px solid var(--md-sys-color-surface-variant);
  border-top: 4px solid var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-full);
  width: 56px;
  height: 56px;
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.voice-loading p {
  font-size: 15px;
  color: var(--md-sys-color-on-surface-variant);
  letter-spacing: 0;
}

/* ============================================
   브라우저 호환성 폴백
   ============================================ */

/* gap 속성 미지원 브라우저 대응 */
@supports not (gap: 12px) {
  .voice-recorder-controls > * + * {
    margin-left: 12px;
  }
  
  .voice-mixer-content > * + * {
    margin-left: 16px;
  }
  
  .voice-audio-actions > * + * {
    margin-left: 12px;
  }
}

/* backdrop-filter 미지원 브라우저 대응 */
@supports not (backdrop-filter: blur(10px)) {
  .voice-recorder-container {
    background: var(--md-sys-color-surface);
  }
}

/* ============================================
   반응형 - Mobile
   ============================================ */
@media (max-width: 768px) {
  .voice-recorder-container {
    padding: 32px 20px;
    min-height: 420px;
    border-radius: var(--md-sys-shape-corner-large);
  }

  .voice-recorder-header h3 {
    font-size: 24px;
  }

  .voice-mic-icon-container {
    width: 160px;
    height: 160px;
  }

  .voice-mic-icon {
    width: 96px;
    height: 96px;
  }

  .voice-mic-icon svg {
    width: 48px;
    height: 48px;
  }

  .voice-timer {
    font-size: 42px;
  }

  .voice-recorder-controls {
    gap: 8px;
  }

  .voice-control-btn {
    padding: 10px 20px;
    height: 44px;
    font-size: 14px;
  }

  .voice-status-text {
    font-size: 16px;
  }

  .voice-mixer-panel {
    padding: 20px;
  }

  .voice-mixer-content {
    flex-direction: column;
    align-items: stretch;
  }

  .voice-effect-selector {
    min-width: 100%;
  }

  .voice-btn-preview {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .voice-recorder-container {
    padding: 24px 16px;
  }

  .voice-recorder-header h3 {
    font-size: 20px;
  }

  .voice-mic-icon-container {
    width: 140px;
    height: 140px;
  }

  .voice-mic-icon {
    width: 80px;
    height: 80px;
  }

  .voice-mic-icon svg {
    width: 40px;
    height: 40px;
  }

  .voice-timer {
    font-size: 36px;
  }

  .voice-control-btn {
    padding: 8px 16px;
    height: 40px;
    font-size: 13px;
  }

  .voice-mixer-panel {
    padding: 16px;
  }

  .voice-mixer-panel h4 {
    font-size: 16px;
  }

  .voice-btn-preview {
    padding: 10px 20px;
    height: 44px;
    font-size: 14px;
  }
}


/* ============================================
   AI 음성 인식 텍스트 표시
   ============================================ */
.voice-recognized-text {
  margin-top: 20px;
  padding: 20px 24px;
  background: linear-gradient(
    135deg,
    rgba(163, 196, 188, 0.1) 0%,
    rgba(163, 196, 188, 0.05) 100%
  );
  border-left: 4px solid var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-medium);
  animation: slide-in var(--md-sys-motion-duration-medium)
    var(--md-sys-motion-easing-emphasized);
}

.voice-recognized-text p {
  margin: 8px 0;
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
}

.voice-recognized-text strong {
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

.voice-recognized-text .text-content {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  padding: 12px;
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-small);
  margin: 12px 0;
  line-height: 1.6;
}

.voice-recognized-text .confidence {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   API 상태 표시
   ============================================ */
.voice-api-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--md-sys-color-surface-variant);
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

.voice-api-status.active {
  background: rgba(163, 196, 188, 0.2);
  color: var(--md-sys-color-primary);
}

.voice-api-status.error {
  background: rgba(216, 163, 157, 0.2);
  color: var(--md-sys-color-accent);
}

.voice-api-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* 로딩 상태 */
.voice-btn-preview.loading {
  pointer-events: none;
  opacity: 0.7;
}

.voice-btn-preview.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  right: 12px;
}


/* ============================================
   모바일 호환성 강화 - 최종 우선순위
   ============================================ */
body #voice-recorder-container.voice-recorder-container.active,
html body #voice-recorder-container.active,
#voice-recorder-container.voice-recorder-container.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 100 !important;
}

/* iOS Safari 전용 */
@supports (-webkit-touch-callout: none) {
  .voice-recorder-container.active {
    display: block !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* Android Chrome 전용 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .voice-recorder-container.active {
    display: block !important;
  }
}

/* 체크박스 완전 제거 - 최종 */
.voice-recorder-toggle input[type="checkbox"].selec_chk,
.voice-recorder-toggle .selec_chk,
.voice-recorder-toggle input.selec_chk {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}


/* ============================================
   음성 게시물 표시 스타일
   ============================================ */

/* 게시글 목록에서 음성 게시물 아이콘 */
.voice-post-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 1.1em;
    vertical-align: middle;
    animation: voice-pulse 2s ease-in-out infinite;
}

@keyframes voice-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* 게시글 제목에 음성 배지 */
.voice-post-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    color: white;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 게시글 목록 아이템에 음성 표시 */
.board-list .voice-post {
    position: relative;
}

.board-list .voice-post::before {
    content: '🎙️';
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    opacity: 0.8;
}

/* 게시글 상세보기 제목 스타일 */
.view-title .voice-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border-radius: 16px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 10px;
    vertical-align: middle;
}

.view-title .voice-indicator::before {
    content: '🎙️';
    font-size: 1.2em;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .voice-post-icon {
        font-size: 1em;
        margin-right: 4px;
    }
    
    .voice-post-badge {
        font-size: 0.7em;
        padding: 2px 6px;
        margin-left: 4px;
    }
    
    .board-list .voice-post::before {
        left: -20px;
        font-size: 1em;
    }
}


/* ============================================
   텍스트 수정 UI 스타일
   ============================================ */

.voice-text-edit {
    background: var(--md-sys-color-surface);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.voice-text-editor {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid var(--md-sys-color-outline, #ddd);
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.2s ease;
    background: var(--md-sys-color-surface-variant, #f8f9fa);
}

.voice-text-editor:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(163, 196, 188, 0.1);
}

/* 버튼 그룹 */
.voice-button-group {
    display: flex !important;
    gap: 12px !important;
    margin-top: 16px !important;
    flex-wrap: wrap !important;
}

/* 기본 버튼 스타일 */
.voice-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
}

/* Ripple 효과 제거됨 */

.voice-btn svg {
    flex-shrink: 0;
}

/* Primary 버튼 (확인) */
.voice-btn-primary {
    background: linear-gradient(135deg, #a3c4bc, #a3c4bc) !important;
    color: white !important;
}

.voice-btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(163, 196, 188, 0.4) !important;
    background: linear-gradient(135deg, #8fb5ad, #8fb5ad) !important;
}

.voice-btn-primary:active {
    transform: translateY(0) !important;
}

.voice-btn-primary:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Secondary 버튼 (취소) */
.voice-btn-secondary {
    background: #e9ecef !important;
    color: #495057 !important;
}

.voice-btn-secondary:hover {
    background: #dee2e6 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.voice-btn-secondary:active {
    transform: translateY(0) !important;
}

/* 정보 박스 */
.voice-info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f8ff 100%);
    border-left: 4px solid var(--md-sys-color-primary);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #004085;
}

.voice-info-box svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--md-sys-color-primary);
}

.voice-info-box strong {
    color: var(--md-sys-color-primary);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .voice-text-edit {
        padding: 16px;
    }
    
    .voice-text-editor {
        min-height: 100px;
        padding: 12px;
        font-size: 14px;
    }
    
    .voice-button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .voice-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .voice-info-box {
        padding: 12px;
        font-size: 13px;
    }
}

/* 다크모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
    .voice-text-edit {
        background: #1e1e1e;
    }
    
    .voice-text-editor {
        background: #2d2d2d;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .voice-text-editor:focus {
        background: #333;
        border-color: var(--md-sys-color-primary);
    }
    
    .voice-btn-secondary {
        background: #3a3a3a;
        color: #e0e0e0;
    }
    
    .voice-btn-secondary:hover {
        background: #4a4a4a;
    }
    
    .voice-info-box {
        background: linear-gradient(135deg, #1a3a4a 0%, #1e4555 100%);
        color: #a3d5ea;
    }
}


/* ============================================
   Material Design 3 음성 플레이어
   ============================================ */

.voice-preview-container {
    background: var(--md-sys-color-surface);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 성공 메시지 */
.voice-success-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #d4f4dd 0%, #e8f5e9 100%);
    border-radius: 16px;
    color: #1b5e20;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.1);
}

.voice-success-message svg {
    flex-shrink: 0;
    color: #2e7d32;
}

/* 텍스트 미리보기 */
.voice-text-preview {
    background: var(--md-sys-color-surface-variant, #f8f9fa);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--md-sys-color-outline, #e0e0e0);
}

.voice-text-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--md-sys-color-on-surface-variant, #666);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voice-text-preview-content {
    color: var(--md-sys-color-on-surface, #333);
    font-size: 15px;
    line-height: 1.7;
    padding: 12px;
    background: white;
    border-radius: 12px;
}

/* MD3 플레이어 */
.md3-voice-player {
    background: linear-gradient(135deg, var(--md-sys-color-primary-container), var(--md-sys-color-tertiary-container));
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(163, 196, 188, 0.2);
    margin-bottom: 20px;
}

.md3-player-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.md3-player-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(163, 196, 188, 0.3);
    flex-shrink: 0;
}

.md3-player-info {
    flex: 1;
    min-width: 0;
}

.md3-player-title {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--md-sys-color-on-primary-container);
}

.md3-player-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--md-sys-color-on-primary-container);
    opacity: 0.8;
}

.md3-player-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 플레이어 컨트롤 */
.md3-player-controls {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.md3-audio-element {
    display: none;
}

.md3-audio-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.md3-play-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(163, 196, 188, 0.4);
    flex-shrink: 0;
}

.md3-play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(163, 196, 188, 0.5);
}

.md3-play-button:active {
    transform: scale(0.95);
}

.md3-play-button svg {
    color: white;
}

.md3-play-button.playing {
    background: linear-gradient(135deg, var(--md-sys-color-accent), #e8a39d);
}

.md3-progress-container {
    flex: 1;
    min-width: 0;
}

.md3-time-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant, #666);
}

.md3-progress-bar {
    position: relative;
    height: 6px;
    background: var(--md-sys-color-surface-variant, #e0e0e0);
    border-radius: 3px;
    overflow: visible;
    cursor: pointer;
}

.md3-progress-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--md-sys-color-surface-variant, #e0e0e0);
    border-radius: 3px;
}

.md3-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    border-radius: 3px;
    transition: width 0.1s linear;
}

.md3-progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--md-sys-color-primary);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: left 0.1s linear;
}

.md3-volume-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--md-sys-color-surface-variant, #f0f0f0);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.md3-volume-button:hover {
    background: var(--md-sys-color-primary-container);
    transform: scale(1.05);
}

.md3-volume-button svg {
    color: var(--md-sys-color-on-surface-variant, #666);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .voice-preview-container {
        padding: 16px;
        border-radius: 16px;
    }
    
    .md3-voice-player {
        padding: 16px;
    }
    
    .md3-player-header {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .md3-player-icon {
        width: 48px;
        height: 48px;
    }
    
    .md3-player-title {
        font-size: 16px;
    }
    
    .md3-player-subtitle {
        font-size: 13px;
    }
    
    .md3-player-controls {
        padding: 16px;
    }
    
    .md3-play-button {
        width: 48px;
        height: 48px;
    }
    
    .md3-volume-button {
        width: 36px;
        height: 36px;
    }
    
    .md3-time-display {
        font-size: 11px;
    }
}

/* 애니메이션 */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.md3-play-button.playing::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--md-sys-color-accent);
    animation: pulse-ring 1.5s ease-out infinite;
}


/* ============================================
   게시글 조회용 MD3 플레이어
   ============================================ */

.md3-voice-player-view {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: linear-gradient(135deg, var(--md-sys-color-primary-container), var(--md-sys-color-tertiary-container));
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(163, 196, 188, 0.2);
    margin: 20px 0 30px 0;
    position: relative;
    z-index: 10;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .md3-voice-player-view {
        display: block !important;
        padding: 16px !important;
        border-radius: 16px !important;
        margin: 16px 0 24px 0 !important;
    }
}

/* iOS Safari 전용 */
@supports (-webkit-touch-callout: none) {
    .md3-voice-player-view {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}


/* ============================================
   [VOICE] 텍스트 마커 스타일링
   ============================================ */

/* 제목에서 [VOICE] 텍스트를 아이콘처럼 보이게 */
a[href*="wr_id"]:not(.voice-styled)::before,
.subject a:not(.voice-styled)::before,
.bo_v_title:not(.voice-styled)::before {
    content: '';
}

/* [VOICE] 텍스트가 포함된 링크 스타일 */
a[href*="wr_id"]:has-text("[VOICE]"),
a[href*="wr_id"] {
    position: relative;
}

/* JavaScript 없이 CSS만으로 [VOICE] 스타일링 */
.subject,
.bo_v_title,
.view-title,
h1.title {
    position: relative;
}

/* [VOICE] 텍스트를 배지처럼 표시 */
.subject:has-text("[VOICE]")::before,
.bo_v_title:has-text("[VOICE]")::before {
    content: '🎙️';
    display: inline-block;
    margin-right: 6px;
    font-size: 1.1em;
}
