/* 음성 채팅 UI 스타일 — 2026-03-09 */

.vc-panel {
  width: 100%;
  max-width: 400px;
  background: #1a1a2e;
  border-radius: 12px;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
}

.vc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

.vc-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

/* 연결 상태 표시등 */
.vc-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.vc-status-on { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.vc-status-off { background: #6b7280; }

.vc-section { padding: 16px; }

/* ── 닉네임 입력 ─────────────────────────────────────────── */
#vc-nickname-form {
  display: flex;
  gap: 8px;
}

.vc-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #e0e0e0;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.vc-input:focus { border-color: #3b82f6; }
.vc-input::placeholder { color: #64748b; }

/* ── 버튼 ────────────────────────────────────────────────── */
.vc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
}

.vc-btn-primary { background: #3b82f6; }
.vc-btn-primary:hover { background: #2563eb; }

.vc-btn-small {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
  background: #334155;
}
.vc-btn-small:hover { background: #475569; }

.vc-btn-ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
}
.vc-btn-ghost:hover { background: #1e293b; }

.vc-btn-round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  background: #334155;
}
.vc-btn-round:hover { background: #475569; }
.vc-btn-round.vc-btn-muted { background: #ef4444; }
.vc-btn-round.vc-btn-muted:hover { background: #dc2626; }

.vc-btn-danger {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  background: #dc2626;
}
.vc-btn-danger:hover { background: #b91c1c; }

/* 2026-03-09: 녹음 버튼 */
.vc-btn-recording { background: #ef4444 !important; animation: vc-rec-blink 1s infinite; }
@keyframes vc-rec-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.vc-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── 로비 ────────────────────────────────────────────────── */
.vc-lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.vc-label {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

.vc-room-list {
  max-height: 240px;
  overflow-y: auto;
}

.vc-empty {
  text-align: center;
  padding: 24px 0;
  color: #64748b;
  font-size: 13px;
}

.vc-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 4px;
  background: #0f172a;
  border-radius: 8px;
  transition: background 0.15s;
}
.vc-room-item:hover { background: #1e293b; }

.vc-room-item-info { display: flex; flex-direction: column; gap: 2px; }
.vc-room-item-name { font-size: 13px; font-weight: 500; }
.vc-room-item-count { font-size: 11px; color: #64748b; }

/* 방 생성 폼 */
.vc-create-form {
  margin-top: 12px;
  padding: 12px;
  background: #0f172a;
  border-radius: 8px;
}
.vc-create-form .vc-input { width: 100%; margin-bottom: 8px; box-sizing: border-box; }
.vc-create-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── 채팅방 (통화 중) ────────────────────────────────────── */
.vc-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.vc-room-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.vc-room-count {
  font-size: 12px;
  color: #64748b;
  background: #1e293b;
  padding: 2px 8px;
  border-radius: 10px;
}

/* 멤버 목록 */
.vc-members {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.vc-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  background: #0f172a;
  border-radius: 10px;
  transition: all 0.2s;
  position: relative;
}

.vc-member-me { background: #172554; }

.vc-member-avatar { position: relative; }

.vc-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #e0e0e0;
  transition: all 0.2s;
}

.vc-member-me .vc-avatar-circle { background: #1d4ed8; }

/* 말하는 중 링 애니메이션 */
.vc-speaking-ring {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.vc-member-speaking .vc-speaking-ring {
  border-color: #22c55e;
  animation: vc-pulse 1s ease-in-out infinite;
}

@keyframes vc-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.7; }
}

/* 음소거 상태 */
.vc-member-muted .vc-avatar-circle { opacity: 0.5; }
.vc-member-disconnected .vc-avatar-circle { opacity: 0.3; }

.vc-member-name {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vc-member-status {
  position: absolute;
  top: 4px;
  right: 4px;
}

/* 통화 제어 */
.vc-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding-top: 4px;
}

/* ── 토스트 ──────────────────────────────────────────────── */
.vc-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  z-index: 10001;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.vc-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.vc-toast-info { background: rgba(59, 130, 246, 0.9); }
.vc-toast-error { background: rgba(239, 68, 68, 0.9); }

/* ── STT 자막 영역 ───────────────────────────────────────── */
/* 2026-03-09: 화자별 색상, 중간 인식 결과 시각 구분 */
.vc-transcript-area {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  margin-top: 12px;
  background: #0a0f1e;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid #1e293b;
}
.vc-transcript-line {
  padding: 4px 6px;
  margin-bottom: 2px;
  border-radius: 4px;
  transition: background 0.2s, opacity 0.2s;
}
/* 확정된 자막 */
.vc-transcript-final {
  background: rgba(15, 23, 42, 0.6);
}
/* 중간 인식 (인식중) */
.vc-transcript-interim {
  background: rgba(59, 130, 246, 0.08);
  border-left: 2px solid #3b82f6;
  opacity: 0.75;
}
.vc-transcript-nick {
  font-weight: 700;
  margin-right: 8px;
  font-size: 12px;
}
.vc-transcript-text { color: #e2e8f0; }
/* 인식 중인 텍스트 이탤릭 */
.vc-transcript-typing { font-style: italic; color: #94a3b8; }
/* "인식중..." 표시 */
.vc-transcript-indicator {
  color: #3b82f6;
  font-size: 10px;
  margin-left: 6px;
  animation: vc-blink 1.2s ease-in-out infinite;
}
@keyframes vc-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.vc-transcript-time { color: #475569; font-size: 10px; margin-left: 8px; }

/* STT 토글 버튼 */
.vc-btn-stt {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  background: #334155;
  position: relative;
}
.vc-btn-stt:hover { background: #475569; }
.vc-btn-stt.vc-stt-active { background: #059669; }
.vc-btn-stt.vc-stt-active:hover { background: #047857; }

/* ── 녹음 이력 모달 ──────────────────────────────────────── */
/* 2026-03-09: IndexedDB 녹음 이력 + 머지 다운로드 UI */
.vc-rec-history-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10002;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.vc-rec-history-panel {
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  background: #1a1a2e;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.vc-rec-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}
.vc-rec-history-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.vc-rec-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.vc-rec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #0f172a;
  border-radius: 8px;
  transition: background 0.15s;
}
.vc-rec-item:hover { background: #1e293b; }

.vc-rec-item-new {
  border: 1px solid #3b82f6;
  background: #172554;
}

.vc-rec-item-info {
  flex: 1;
  min-width: 0;
}
.vc-rec-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vc-rec-item-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.vc-rec-new-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  background: #3b82f6;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  margin-right: 4px;
  vertical-align: middle;
}

.vc-rec-item-actions {
  display: flex;
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}

.vc-rec-dl-btn { background: #059669 !important; }
.vc-rec-dl-btn:hover { background: #047857 !important; }
.vc-rec-del-btn { background: #dc2626 !important; }
.vc-rec-del-btn:hover { background: #b91c1c !important; }

/* ── 회의록 모달 ──────────────────────────────────────────── */
/* 2026-03-09: AI 회의록 생성 결과 표시 */
.vc-minutes-panel {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: #1a1a2e;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 2026-03-09: 회의록 링크 바 — 채팅방 게시 안내 + 검토 페이지 링크 */
.vc-minutes-link-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #172554;
  border-bottom: 1px solid #1e40af;
  font-size: 13px;
  color: #93c5fd;
}
.vc-minutes-link-btn {
  color: #fff;
  background: #2563eb;
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.vc-minutes-link-btn:hover { background: #1d4ed8; }

.vc-minutes-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.vc-minutes-content {
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.7;
}
.vc-minutes-content h2,
.vc-minutes-h2 {
  font-size: 18px;
  color: #fff;
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #334155;
}
.vc-minutes-content h3,
.vc-minutes-h3 {
  font-size: 15px;
  color: #93c5fd;
  margin: 14px 0 6px;
}
.vc-minutes-content h4 {
  font-size: 14px;
  color: #a5b4fc;
  margin: 10px 0 4px;
}
.vc-minutes-content ul {
  padding-left: 20px;
  margin: 4px 0;
}
.vc-minutes-content li {
  margin-bottom: 4px;
}
.vc-minutes-content strong {
  color: #60a5fa;
}
.vc-minutes-content hr {
  border: none;
  border-top: 1px solid #334155;
  margin: 12px 0;
}

/* 로딩 스피너 */
.vc-minutes-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
  color: #94a3b8;
  gap: 16px;
}
.vc-minutes-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #334155;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: vc-spin 0.8s linear infinite;
}
@keyframes vc-spin { to { transform: rotate(360deg); } }

/* 원본 자막 접기 */
.vc-minutes-raw {
  margin-top: 16px;
}
.vc-minutes-raw summary {
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  padding: 6px 0;
}
.vc-minutes-raw summary:hover { color: #94a3b8; }
.vc-minutes-raw-text {
  margin-top: 8px;
  padding: 10px;
  background: #0a0f1e;
  border-radius: 6px;
  font-size: 11px;
  color: #64748b;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
}

/* ── 반응형 ──────────────────────────────────────────────── */
/* ── 헤드셋 권장 안내 ───────────────────────────────────── */
/* 2026-03-09: 음성 통화 시작 시 헤드셋 권장 + 멀티디바이스 안내 */
.vc-headset-notice-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  animation: vc-fadein 0.2s ease;
}
.vc-headset-notice-fadeout { animation: vc-fadeout 0.3s ease forwards; }
@keyframes vc-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes vc-fadeout { from { opacity: 1; } to { opacity: 0; } }

.vc-headset-notice {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 28px 24px 20px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.vc-headset-notice-icon {
  font-size: 48px;
  margin-bottom: 8px;
}
.vc-headset-notice-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.vc-headset-notice-body {
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
  margin-bottom: 16px;
}
.vc-headset-notice-body p { margin: 6px 0; }
.vc-headset-notice-body strong { color: #f1f5f9; }
.vc-headset-notice-btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 40px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.vc-headset-notice-btn:hover { background: #2563eb; }

@media (max-width: 420px) {
  .vc-panel { max-width: 100%; border-radius: 0; }
  .vc-members { grid-template-columns: repeat(2, 1fr); }
  .vc-rec-history-panel { max-width: 100%; border-radius: 0; }
  .vc-minutes-panel { max-width: 100%; border-radius: 0; }
  .vc-headset-notice { max-width: 100%; border-radius: 12px; }
}

/* ── 통화 초대 알림 ──────────────────────────────────── */
.vc-call-invite {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 360px;
  background: #1a1a2e;
  border: 1px solid #3b82f6;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(59,130,246,0.3), 0 0 0 1px rgba(59,130,246,0.1);
  z-index: 10100;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #e0e0e0;
  animation: vc-invite-slide-in 0.35s ease-out;
}
@keyframes vc-invite-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.vc-call-invite-pulse {
  position: absolute;
  top: -2px; right: -2px; bottom: -2px; left: -2px;
  border-radius: 15px;
  border: 2px solid #3b82f6;
  animation: vc-invite-pulse 2s infinite;
  pointer-events: none;
}
@keyframes vc-invite-pulse {
  0%   { opacity: 1; transform: scale(1); }
  50%  { opacity: 0; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

.vc-call-invite-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.vc-call-invite-icon {
  font-size: 28px;
  animation: vc-phone-ring 0.5s ease-in-out infinite alternate;
  flex-shrink: 0;
}
@keyframes vc-phone-ring {
  from { transform: rotate(-15deg); }
  to   { transform: rotate(15deg); }
}

.vc-call-invite-info { flex: 1; min-width: 0; }

.vc-call-invite-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vc-call-invite-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.vc-call-invite-actions {
  display: flex;
  gap: 8px;
}

.vc-call-invite-accept {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 8px;
  background: #22c55e;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.vc-call-invite-accept:hover { background: #16a34a; }

.vc-call-invite-reject {
  width: 40px;
  border: none;
  border-radius: 8px;
  background: #334155;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.vc-call-invite-reject:hover { background: #ef4444; color: #fff; }

@media (max-width: 420px) {
  .vc-call-invite {
    width: calc(100vw - 16px);
    right: 8px;
    top: 8px;
  }
}
