/* Azure AI Foundry Chatbot - Channel Talk Style */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;600&display=swap');

:root {
  --chatbot-bg-white-normal: #FFFFFF;
  --chatbot-bg-black-lightest: rgba(0, 0, 0, 0.05);
  --chatbot-txt-black-darkest: rgba(0, 0, 0, 0.85);
  --chatbot-txt-black-dark: rgba(0, 0, 0, 0.4);
  --chatbot-bdr-black-light: rgba(0, 0, 0, 0.08);
  --chatbot-brand: #4a26ff;
}

/* 챗봇 컨테이너 - 화면에 고정 */
#azure-chatbot-widget {
  position: fixed;
  z-index: 999999;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* 일반 문서 폰트 크기에 가깝게 조정 */
  font-size: 100%;
}

/* 위치별 스타일 */
#azure-chatbot-widget.bottom-right {
  bottom: 20px;
  right: 20px;
}

#azure-chatbot-widget.bottom-left {
  bottom: 20px;
  left: 20px;
}

/* 챗봇 트리거 버튼 */
.azure-chatbot-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chatbot-brand);
  background: linear-gradient(135deg, var(--chatbot-brand) 0%, rgba(116, 75, 162, 1) 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.azure-chatbot-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

.azure-chatbot-trigger:active {
  transform: scale(0.95);
}

.azure-chatbot-trigger svg {
  width: 24px;
  height: 24px;
  color: white;
  transition: transform 0.3s ease;
}

.azure-chatbot-trigger.opened svg {
  transform: rotate(180deg);
}

/* 채팅 창 */
.azure-chatbot-container {
  width: 350px;
  height: 500px;
  background-color: var(--chatbot-bg-white-normal);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  position: absolute;
  bottom: 70px;
  right: 0;
  animation: chatbotPopIn 400ms cubic-bezier(.2,.8,.2,1);
}

#azure-chatbot-widget.bottom-left .azure-chatbot-container {
  right: auto;
  left: 0;
}

/* 헤더 */
.azure-chatbot-header {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--chatbot-bdr-black-light);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  backdrop-filter: blur(6px);
  animation: chatbotFadeSlideIn 400ms ease;
}

.azure-chatbot-avatar-wrapper {
  width: 36px;
  height: 36px;
}

.azure-chatbot-avatar {
  width: 100%;
  height: 100%;
  border-radius: 42%;
  background-color: #cfccfb;
  background: var(--chatbot-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.6rem;
  font-weight: 600;
}

.azure-chatbot-info {
  margin-left: 12px;
  flex: 1;
}

.azure-chatbot-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--chatbot-txt-black-darkest);
  margin: 0;
}

.azure-chatbot-status {
  font-size: 0.85rem;
  color: var(--chatbot-txt-black-dark);
  margin: 0;
}

.azure-chatbot-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--chatbot-txt-black-dark);
  padding: 4px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.azure-chatbot-close:hover {
  background-color: var(--chatbot-bg-black-lightest);
}

/* 메시지 영역 */
.azure-chatbot-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fafafa;
  display: flex;
  flex-direction: column;
}

/* 메시지 */
.azure-chatbot-message {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 85%;
  margin-bottom: 8px;
  position: relative;
  line-height: 1.4;
  animation: chatbotMessageSlideIn 300ms ease;
}

.azure-chatbot-message p { margin: 0; font-size: 0.95rem; }

.azure-chatbot-incoming {
  background-color: var(--chatbot-bg-black-lightest);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.azure-chatbot-outgoing {
  background-color: var(--chatbot-brand);
  color: white;
  align-self: flex-end;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.azure-chatbot-time {
  font-size: 1rem;
  color: var(--chatbot-txt-black-dark);
  margin-top: 2px;
  text-align: right;
}

.azure-chatbot-incoming .azure-chatbot-time {
  text-align: left;
}

/* 타이핑 표시 */
.azure-chatbot-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--chatbot-bg-black-lightest);
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  margin-bottom: 8px;
  align-self: flex-start;
}

.azure-chatbot-typing .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  animation: chatbotDotBounce 1.2s infinite ease-in-out;
}

.azure-chatbot-typing .dot:nth-child(2) {
  animation-delay: .15s;
}

.azure-chatbot-typing .dot:nth-child(3) {
  animation-delay: .3s;
}

/* FAQ 옵션 */
.azure-chatbot-options-container {
  margin-top: 16px;
}

.azure-chatbot-options-title {
  font-size: 1rem;
  font-weight: bold;
  color: var(--chatbot-txt-black-darkest);
  margin-bottom: 8px;
}

.azure-chatbot-options-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.azure-chatbot-option { font-size: 0.95rem; }

.azure-chatbot-option:hover {
  background-color: rgba(0,0,0,0.07);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* 입력 영역 */
.azure-chatbot-footer {
  display: flex;
  padding: 16px;
  border-top: 1px solid var(--chatbot-bdr-black-light);
  gap: 8px;
  background: #fff;
  position: sticky;
  bottom: 0;
}

.azure-chatbot-input {
  flex: 1;
  border: 1px solid var(--chatbot-bdr-black-light);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.95rem;
  transition: border-color .2s ease;
  outline: none;
  font-family: inherit;
}

.azure-chatbot-input:focus {
  border-color: var(--chatbot-brand);
  box-shadow: 0 0 0 2px rgba(74,38,255,0.15);
}

.azure-chatbot-send-button {
  background-color: var(--chatbot-brand);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease;
  outline: none;
}

.azure-chatbot-send-button:hover {
  transform: scale(1.05);
}

.azure-chatbot-send-button:active {
  transform: scale(0.95);
}

.azure-chatbot-send-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.azure-chatbot-send-button svg {
  width: 20px;
  height: 20px;
  transform: rotate(-45deg);
}

/* 스크롤바 */
.azure-chatbot-body::-webkit-scrollbar {
  width: 8px;
}

.azure-chatbot-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
}

.azure-chatbot-body::-webkit-scrollbar-track {
  background: transparent;
}

/* 애니메이션 */
@keyframes chatbotFadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chatbotPopIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  70% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes chatbotMessageSlideIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chatbotDotBounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px);
  }
}

/* 반응형 디자인 */
@media (max-width: 480px) {
  .azure-chatbot-container {
    width: 320px;
    height: 450px;
  }
  
  .azure-chatbot-message {
    max-width: 90%;
  }
  
  #azure-chatbot-widget.bottom-right {
    right: 10px;
    bottom: 10px;
  }
  
  #azure-chatbot-widget.bottom-left {
    left: 10px;
    bottom: 10px;
  }
}

/* 애니메이션 효과 줄이기 (접근성) */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
  :root {
    --chatbot-bg-white-normal: #2d2d2d;
    --chatbot-bg-black-lightest: rgba(255, 255, 255, 0.08);
    --chatbot-txt-black-darkest: rgba(255, 255, 255, 0.9);
    --chatbot-txt-black-dark: rgba(255, 255, 255, 0.6);
    --chatbot-bdr-black-light: rgba(255, 255, 255, 0.12);
  }
  
  .azure-chatbot-body {
    background: #1a1a1a;
  }
  
  .azure-chatbot-footer,
  .azure-chatbot-header {
    background: #2d2d2d;
  }
  
  .azure-chatbot-input {
    background: #3d3d3d;
    color: rgba(255, 255, 255, 0.9);
  }
}
