/* =========================================
   客服浮動視窗樣式 (中間方形設計)
   符合網站原本設計風格
   ========================================= */

/* 遮罩層 */
.cs-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.cs-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* 方形浮動視窗 */
.cs-modal-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 50px 40px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  text-align: center;
  transform: scale(0.7);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

.cs-modal-backdrop.active .cs-modal-box {
  transform: scale(1);
  opacity: 1;
}

/* 關閉按鈕 */
.cs-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  line-height: 1;
  padding: 0;
}

.cs-modal-close:hover {
  background-color: #f0f0f0;
  color: #333;
  transform: rotate(90deg);
}

/* 圖示容器 */
.cs-modal-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 25px;
  animation: iconPulse 2s ease-in-out infinite;
}

.cs-modal-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(124, 144, 130, 0.2));
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* 標題 */
.cs-modal-title {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin: 0 0 20px 0;
  letter-spacing: 1px;
}

/* 內容文字 */
.cs-modal-message {
  font-size: 18px;
  line-height: 1.8;
  color: #666;
  margin: 0 0 35px 0;
}

/* 確認按鈕 */
.cs-modal-btn {
  background: linear-gradient(135deg, #7c9082 0%, #6a7c71 100%);
  color: #ffffff;
  border: none;
  padding: 14px 50px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(124, 144, 130, 0.3);
  transition: all 0.3s ease;
  letter-spacing: 2px;
}

.cs-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 144, 130, 0.4);
  background: linear-gradient(135deg, #6a7c71 0%, #5a6c61 100%);
}

.cs-modal-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(124, 144, 130, 0.3);
}

/* =========================================
   深色模式適配
   ========================================= */

body.dark-mode .cs-modal-box {
  background: #2a2a2a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark-mode .cs-modal-title {
  color: #f0f0f0;
}

body.dark-mode .cs-modal-message {
  color: #b0b0b0;
}

body.dark-mode .cs-modal-close {
  color: #888;
}

body.dark-mode .cs-modal-close:hover {
  background-color: #3a3a3a;
  color: #f0f0f0;
}

body.dark-mode .cs-modal-icon svg path,
body.dark-mode .cs-modal-icon svg circle {
  stroke: #8fa895;
}

/* =========================================
   手機版適配
   ========================================= */

@media only screen and (max-width: 768px) {
  .cs-modal-box {
    padding: 40px 30px;
    max-width: 340px;
  }

  .cs-modal-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
  }

  .cs-modal-title {
    font-size: 24px;
    margin-bottom: 15px;
  }

  .cs-modal-message {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .cs-modal-btn {
    padding: 12px 40px;
    font-size: 15px;
  }

  .cs-modal-close {
    top: 10px;
    right: 10px;
    font-size: 28px;
    width: 36px;
    height: 36px;
  }
}
