/* ==========================================================================
   키아노스 옴니 다이얼로그 (Kyanos Omni Dialogue - SI 통합 검색 & 지능 안내소)
   디스크/시스템 부하 0MB (전화기형 순수 클라우드 연동 & 경량 프론트엔드 UI)
   ========================================================================== */

/* 플로팅 런처 그룹 */
.kyanos-floating-hub {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10005;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 키아노스 보이스 런처 버튼 */
#kyanos-voice-launcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
  border: 1.5px solid #eab308;
  padding: 10px 16px;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 16px rgba(250, 204, 21, 0.4);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: #78350f;
  font-family: 'Cinzel', 'Noto Serif KR', sans-serif;
  user-select: none;
}

#kyanos-voice-launcher:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 24px rgba(250, 204, 21, 0.7);
}

.voice-launcher-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.voice-launcher-text {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #854d0e;
}

.voice-launcher-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 12px;
  background: #1e3a8a;
  color: #ffffff;
  font-weight: 700;
}

/* 플로팅 런처 버튼 */
#kyanos-omni-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  padding: 10px 18px;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.35);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: #fff;
  font-family: 'Cinzel', 'Noto Serif KR', serif;
  user-select: none;
}

#kyanos-omni-launcher:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: #fde68a;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75), 0 0 28px rgba(245, 158, 11, 0.55);
}

.omni-launcher-icon {
  font-size: 1.35rem;
  line-height: 1;
  animation: omni-pulse 3s infinite;
}

.omni-launcher-text {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fde68a;
}

.omni-launcher-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.25);
  border: 1px solid #60a5fa;
  color: #93c5fd;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

@keyframes omni-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.9)); }
}

/* 대화창 모달 오버레이 */
#kyanos-omni-modal {
  position: fixed;
  bottom: 85px;
  right: 28px;
  width: 420px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 20px;
  z-index: 10006;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 35px rgba(245, 158, 11, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#kyanos-omni-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* 모달 헤더 */
.omni-modal-header {
  padding: 14px 18px;
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.omni-header-title-box {
  display: flex;
  align-items: center;
  gap: 9px;
}

.omni-header-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fde68a;
  letter-spacing: 0.06em;
}

.omni-header-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 1px;
}

.omni-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.omni-close-btn:hover {
  color: #fde68a;
}

/* 메시지 대화 본문 */
.omni-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  scroll-behavior: smooth;
}

.omni-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
}

.omni-msg.bot {
  align-self: flex-start;
}

.omni-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.omni-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.omni-msg.bot .omni-avatar {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  border: 1px solid #fde68a;
}

.omni-msg.user .omni-avatar {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: 1px solid #93c5fd;
}

.omni-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  word-break: break-word;
}

.omni-msg.bot .omni-bubble {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f1f5f9;
}

.omni-msg.user .omni-bubble {
  background: rgba(37, 99, 235, 0.85);
  border: 1px solid rgba(147, 197, 253, 0.3);
  color: #ffffff;
}

/* 직통 라우팅 카드 (검색 결과/내비게이션) */
.omni-action-card {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.omni-action-title {
  font-weight: 700;
  font-size: 0.84rem;
  color: #fde68a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.omni-action-desc {
  font-size: 0.76rem;
  color: #cbd5e1;
}

.omni-action-btn {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 6px;
  transition: transform 0.2s, background 0.2s;
}

.omni-action-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
}

/* 퀵 추천 태그 칩 */
.omni-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 4px 14px;
  background: rgba(15, 23, 42, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.omni-chip {
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 15px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}

.omni-chip:hover {
  border-color: #fde68a;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.15);
}

/* 입력 바 */
.omni-input-bar {
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.9);
  border-top: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  gap: 8px;
}

.omni-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  font-size: 0.86rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.omni-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.omni-input::placeholder {
  color: #64748b;
  font-size: 0.8rem;
}

.omni-send-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
}

.omni-send-btn:hover {
  transform: scale(1.08);
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
}

/* 모바일 반응형 */
@media (max-width: 480px) {
  #kyanos-omni-modal, #kyanos-voice-modal {
    right: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    height: 75vh;
  }
  .kyanos-floating-hub {
    right: 12px;
    bottom: 16px;
    gap: 6px;
  }
  #kyanos-omni-launcher, #kyanos-voice-launcher {
    padding: 8px 12px;
  }
  .omni-launcher-text, .voice-launcher-text {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   키아노스 보이스 인터랙티브 창 모달 (실시간 음성 대화 & PC 사용법 듀얼 콘솔)
   ========================================================================== */
#kyanos-voice-modal {
  position: fixed;
  bottom: 85px;
  right: 28px;
  width: 420px;
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 110px);
  background: linear-gradient(135deg, #fffdf5 0%, #fef9c3 100%);
  border: 2px solid #eab308;
  border-radius: 20px;
  z-index: 10006;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(250, 204, 21, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: #0f172a;
  font-family: 'Pretendard', sans-serif;
}

#kyanos-voice-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.voice-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: #fde047;
  border-bottom: 1.5px solid #eab308;
}

.voice-modal-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 6px;
}

.voice-close-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  font-weight: 800;
  color: #78350f;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.2s;
}

.voice-close-btn:hover {
  background: #facc15;
  color: #000;
}

/* 상단 탭 네비게이션 */
.voice-nav-tabs {
  display: flex;
  background: rgba(254, 240, 138, 0.6);
  border-bottom: 1px solid rgba(234, 179, 8, 0.4);
  padding: 4px 10px 0;
  gap: 6px;
}

.voice-nav-tab {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  color: #854d0e;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px 8px 0 0;
}

.voice-nav-tab:hover {
  background: rgba(255, 255, 255, 0.4);
  color: #713f12;
}

.voice-nav-tab.active {
  background: #ffffff;
  color: #1e3a8a;
  border-bottom-color: #2563eb;
  font-weight: 800;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
}

.voice-modal-body {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

/* 탭 패널 전환 */
.voice-view-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.voice-view-panel.active {
  display: flex;
}

/* 실시간 마이크 제어 영역 */
.voice-live-mic-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px 10px;
  background: #ffffff;
  border: 1.5px solid rgba(234, 179, 8, 0.4);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.voice-mic-main-btn {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 3px solid #60a5fa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.voice-mic-main-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
}

.voice-mic-main-btn .mic-icon {
  font-size: 2rem;
  line-height: 1;
}

/* 마이크 녹음 중 상태 */
.voice-mic-main-btn.recording {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #fca5a5;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.7);
  animation: mic-listening-pulse 1.3s infinite;
}

@keyframes mic-listening-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.voice-mic-status {
  font-size: 0.92rem;
  font-weight: 800;
  color: #78350f;
  margin-top: 10px;
  text-align: center;
}

.voice-mic-substatus {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 2px;
  text-align: center;
}

/* 실시간 텍스트 결과 영역 */
.voice-result-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voice-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.voice-char-count {
  font-size: 0.72rem;
  color: #2563eb;
  font-weight: 800;
}

.voice-result-textarea {
  width: 100%;
  height: 110px;
  box-sizing: border-box;
  padding: 10px 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #0f172a;
  resize: vertical;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.voice-result-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 액션 툴바 */
.voice-action-toolbar {
  display: flex;
  gap: 6px;
}

.voice-action-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.voice-action-btn.copy {
  background: #1e3a8a;
  color: #ffffff;
}

.voice-action-btn.copy:hover {
  background: #1d4ed8;
}

.voice-action-btn.send-omni {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
}

.voice-action-btn.send-omni:hover {
  background: #b45309;
}

.voice-action-btn.clear {
  flex: 0 0 auto;
  background: #f1f5f9;
  color: #64748b;
}

.voice-action-btn.clear:hover {
  background: #e2e8f0;
  color: #334155;
}

/* 토스트 메시지 */
.voice-toast-msg {
  min-height: 18px;
  font-size: 0.75rem;
  color: #059669;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.voice-toast-msg.show {
  opacity: 1;
}

/* F9 가이드 탭 내부 카드 */
.voice-step-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(234, 179, 8, 0.5);
  border-radius: 10px;
  padding: 10px 14px;
}

.voice-step-card.highlight {
  background: #ffffff;
  border: 2px solid #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.voice-step-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.voice-step-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.voice-key-badge {
  display: inline-block;
  background: #1e293b;
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 5px;
}

.voice-traffic-lights {
  display: flex;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px 10px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  justify-content: space-around;
}

.voice-full-link-btn {
  display: block;
  text-align: center;
  background: #1e3a8a;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 9px;
  border-radius: 8px;
  transition: background 0.2s;
}

.voice-full-link-btn:hover {
  background: #1d4ed8;
}

/* 옴니 다이얼로그 입력창 내부 마이크 버튼 */
.omni-mic-btn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.omni-mic-btn:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #fde68a;
  transform: scale(1.05);
}

.omni-mic-btn.recording {
  background: #dc2626;
  border-color: #f87171;
  color: #fff;
  animation: mic-listening-pulse 1.3s infinite;
}
