/*----- 因應網站色系與位置套用調整部分-----*/
.lh-40{ line-height:40px!important; }
.btn-chat{
  width: 48px;
  height: 48px;
  line-height: 48px;
  font-size: 20px;
  right: 20px;
  bottom: 60px;
  background-color: #00539C;
  color: #ffffff;
}
.btn-chat:hover{
  background-color: #194376;
  color: #ffffff;
}
.chat-content{
  height: 500px;
  width: 400px;
  bottom: 80px;
  right: 80px;
}
@media screen and (max-width: 768.9px) {
  .btn-chat{
    right: 20px;
    bottom: 60px;
  }
  .chat-content{
    bottom: 120px;
  }
}
@media screen and (max-width: 524.9px) {
  .chat-content{
    height: calc(100vh - 30px);
    width: calc(100% - 30px);
    bottom: 15px;
    right: 15px;
  }
}
/* 
---------------------------------------------
AI對話視窗樣式
--------------------------------------------- 
*/

.hidden{ display:none;}
.btn-chat{
  position: fixed; 
  padding: 0px; 
  text-align: center!important;  
  z-index: 99;
  border-radius: 50%;
}
.chat-content{
  max-height: 100%;
  max-width: 100%; 
  background-color: #fff;
  position: fixed; 
  z-index: 1031;
  border-radius: 10px;
  box-shadow: 0px 0px 12px rgba(119, 119, 119, 0.4);
}
.chat-box{
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
}
/* ----- 對話框header ----- */
.chat-box .chat-header{
  display: flex;
  align-items: center;
  color: #777777;
  font-size: 16px;
  letter-spacing: 2px;
  font-weight: 500;
  height: 60px;
  background: #F9FBFF;
  padding: 8px 15px;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid #eaeaea;
}
.chat-box .chat-header .chat-avatar{
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background: linear-gradient(to bottom left, #79C7C5 20%, #A1E2D9 100%);
  border-radius: 50%;
}
.chat-box .chat-header .chat-title{
  flex-grow: 1;
  margin: 0 8px;
}
.chat-box .chat-header .chat-dropdown .dropdown-toggle{ color:#777777; }
.chat-box .chat-header .chat-dropdown .dropdown-toggle:after{ display: none;}
.chat-box .chat-header .chat-dropdown .dropdown-menu{
  border: 1px solid #dadada;
}
.chat-box .chat-header .chat-dropdown .dropdown-item{
  font-size: 15px;
  color: #777777;
  padding: 8px 12px;
}
.chat-box .chat-header .chat-dropdown .dropdown-item:hover{
  background-color: #f4f4f4;
  color: #555555;
}
/* ----- 對話框body ----- */
.chat-box .chat-body{
  flex-grow: 1;
  background: #F1F1F1;
  padding: 15px;
  height: 385px;
  overflow-y: auto;
}
.chat-box .chat-body::-webkit-scrollbar{
  width: 5px;
  height: 5px;
  background-color: rgba(255,255,255,0);
}
.chat-box .chat-body::-webkit-scrollbar-thumb{
  border-radius: 5px;
  background-color: rgba(0,0,0,0.2);
  position: absolute;
}
.chat-box .chat-body .chat-date{
  text-align: center;
  font-size: 13px;
  color: #aaaaaa;
  letter-spacing: 2px;
  margin: 0px 0px 20px;
}
/*AI*/
.chat-box .chat-body .chat-staff{
  margin: 12px 15% 12px 10px;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.chat-box .chat-body .chat-staff .chat-bubble{
  display: inline-block;
  color: #4d4d4d;
  background-color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  position: relative;
  filter: drop-shadow(0px 0px 1px #00000015);
  word-break: break-all;
  margin-bottom: 4px;
  white-space: pre-line;  /*20250305-實現換行樣式*/
}
.chat-box .chat-body .chat-staff .chat-bubble::after{
  width: 10px;
  height: 20px;
  content: "";
  background: transparent url("../images/bubble_L.png") no-repeat 0 0 / auto 20px;
  position: absolute;
  left: -10px;
  top: 0px;
  filter: drop-shadow(-1px -1px 1px #00000010);
}
.chat-box .chat-body .chat-staff .chat-time{
  font-size: 12px;
  color: #cccccc;
  margin-top: 2px;
}
/*訪客*/
.chat-box .chat-body .chat-guest{
  margin: 12px 10px 12px 15%;
  font-size: 15px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.chat-box .chat-body .chat-guest .chat-bubble{
  display: inline-block;
  color: #4d4d4d;
  background-color: #dbe4ee;
  padding: 8px 12px;
  border-radius: 8px;
  position: relative;
  filter: drop-shadow(0px 0px 1px #00000015);
  text-align: left;
  word-break: break-all;
  margin-bottom: 4px;
}
.chat-box .chat-body .chat-guest .chat-bubble::after{
  width: 10px;
  height: 20px;
  content: "";
  background: transparent url("../images/bubble_R.png") no-repeat 0 0 / auto 20px;
  position: absolute;
  right: -10px;
  top: 0px;
  filter: drop-shadow(1px -1px 1px #00000010);
}
.chat-box .chat-body .chat-guest .chat-time{
  font-size: 12px;
  color: #cccccc;
  margin-top: 2px;
}
/* ----- 對話框footer ----- */
.chat-box .chat-footer{ 
  background: #F9FBFF;
  border-radius: 0 0 10px 10px;
  border-top: 1px solid #eaeaea;
  padding: 4px 15px; 
  color: #777777; 
  font-size: 16px;
  letter-spacing: 2px;
  font-weight: 500;
}
.chat-box .chat-footer .footer-sendbar{
  display: flex;
  align-items: center;
  margin: 4px 0px;
}
.chat-box .chat-footer .msg-input{
  font-size: 15px;
  border-width: 0px;
}
.chat-box .chat-footer .btn-appendix{
  height: 36px;
  line-height: 36px;
  border: 0px;
  border-radius: 4px;
  flex: 0 0 40px;
  background-color: #E7E8E8;
  color: #777777;
}
.chat-box .chat-footer .btn-appendix:hover{
  color: #555555;
}
.chat-box .chat-footer .btn-send{
  height: 36px;
  line-height: 36px;
  border: 0px;
  border-radius: 4px;
  margin-left: 10px;
  flex: 0 0 60px;
  background-color: #00539C;
  color: #ffffff;
  font-size: 15px;
}
.chat-box .chat-footer .btn-send:hover{
  background-color: #194376;
  color: #ffffff;
}
/* 等待AI回話的動畫 */
.ellipsis {
  margin:2px; /*把js和樣式套一起後球會擠在一起的關係而增加此設定*/
  width: 5px;
  height: 5px;
  display: inline-block;
  background: #b7b7b7;
  border-radius: 50%;
  animation: bounce 1.5s linear infinite;
}
.ellipsis.one{ animation-delay: 0.6s;}
.ellipsis.two{ animation-delay: 0.5s;}
.ellipsis.three{ animation-delay: 0.8s;}
@keyframes bounce {
  30% { transform: translateY(-2px);}
  60% { transform: translateY(0px);}
  80% { transform: translateY(2px);}
  100%{ transform: translateY(0px); opacity: 0.5;}
}

/* 檔案預覽和發送樣式 */
.file-preview {
  display: flex;
  align-items: center;
  gap: 5px;
} 
.file-preview-item {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 5px;
}
.file-preview-item.preview-item-img{
  width: 40px;
  height: 40px;
}
.file-preview-item.preview-item-text{
  padding: 4px;
  max-width: 160px;
}
.preview-img {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  object-fit: cover;
}
.preview-item-text i,
.chat-file i{
  font-size: 20px;
  color: #FED051;
}
.preview-item-text .preview-file,
.chat-file .preview-file{
  font-size: 12px;
  word-break: break-all;
  color: #888;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-line-clamp: 1;
}
.preview-item-text .preview-extension,
.chat-file .preview-extension{
  font-size: 11px;
  color: #aaa;
}
.chat-img{
  max-height: 200px;
} 
.btn-chat-remove {
  position: absolute;
  padding: 0;
  top: -4px;
  right: -8px;
  cursor: pointer;
  font-size: 9px;
  width: 16px;
  height: 16px;
  text-align: center;
  border-radius: 50%;
  color: #ffffff;
  background-color: #121212;
  border: 1px solid #f1f1f1;
}
.btn-chat-remove:hover{
  background-color: #000000;
}

/* 浮動標籤樣式 */
.tag-container {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  width: 100%;
  padding: 4px 0;
  background: #F1F1F1;
  height: 48px;
}
.tag-container::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  background: transparent;
}
.tag-container::-webkit-scrollbar-track {
  background: transparent;
}
.tag-container::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 5px;
  transition: background 0.3s;
}

.tag-scroll {
  display: flex;
  gap: 8px;
  padding: 0 12px;
}

.chat-tag {
  display: inline-block;
  background: #007bff;
  color: white;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}

.chat-tag:hover {
  background: #0056b3;
}