/*
 * 优化巡礼点卡片关闭按钮样式
 * 确保在各种背景图片下都清晰可见
 */

/* 通用关闭按钮样式 */
.btn-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.9;
  cursor: pointer;
  padding: 0;
  outline: none;
}

/* 关闭按钮悬停效果 */
.btn-close:hover {
  background-color: rgba(255, 255, 255, 0.95);
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  opacity: 1;
}

/* 关闭按钮激活效果 */
.btn-close:active {
  transform: scale(0.95);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

/* 自定义关闭图标 - 使用伪元素创建叉叉 */
.btn-close::before,
.btn-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background-color: #333;
  border-radius: 1px;
  transition: all 0.2s ease;
}

.btn-close::before {
  transform: rotate(45deg);
}

.btn-close::after {
  transform: rotate(-45deg);
}

/* 悬停时改变叉叉颜色和粗细 */
.btn-close:hover::before,
.btn-close:hover::after {
  background-color: #000;
  width: 18px;
  height: 2.5px;
}

/* 移动端样式调整 */
@media (max-width: 768px) {
  .btn-close {
    width: 28px;
    height: 28px;
    top: 8px;
    right: 8px;
  }

  .btn-close::before,
  .btn-close::after {
    width: 14px;
  }

  .btn-close:hover::before,
  .btn-close:hover::after {
    width: 16px;
    height: 2px;
  }
}

/* 为信息卡片添加特定样式 */
.info-card .btn-close {
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* 为模态框添加特定样式 */
.modal .btn-close {
  top: 15px;
  right: 15px;
  background-color: rgba(245, 245, 245, 0.9);
}

/* 图片查看模态框关闭按钮 - 优化版 */
.image-viewer-modal .btn-close {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  width: 44px !important;
  height: 44px !important;
  background-color: rgba(0, 0, 0, 0.7) !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 50% !important;
  z-index: 1310 !important; /* 确保在图片之上 */
  opacity: 1 !important;
  display: flex !important;
  visibility: visible !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.image-viewer-modal .btn-close::before,
.image-viewer-modal .btn-close::after {
  content: '' !important;
  position: absolute !important;
  background-color: #fff !important;
  width: 20px !important;
  height: 2px !important;
  border-radius: 1px !important;
  transition: all 0.2s ease !important;
}

.image-viewer-modal .btn-close::before {
  transform: rotate(45deg) !important;
}

.image-viewer-modal .btn-close::after {
  transform: rotate(-45deg) !important;
}

.image-viewer-modal .btn-close:hover {
  background-color: rgba(220, 53, 69, 0.9) !important;
  border-color: rgba(255, 255, 255, 1) !important;
  transform: scale(1.1) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.4) !important;
}

.image-viewer-modal .btn-close:hover::before,
.image-viewer-modal .btn-close:hover::after {
  background-color: #fff !important;
  width: 22px !important;
  height: 2.5px !important;
}

.image-viewer-modal .btn-close:active {
  transform: scale(0.95) !important;
}

/* 确保图片查看模态框的关闭按钮始终可见和可点击 */
.image-viewer-modal .btn-close,
.image-viewer-modal.show .btn-close,
.image-viewer-modal .image-viewer-close,
.modal-open .image-viewer-modal .btn-close {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: absolute !important;
  z-index: 1310 !important;
  pointer-events: auto !important;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .image-viewer-modal .btn-close {
    top: 15px !important;
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
  }

  .image-viewer-modal .btn-close::before,
  .image-viewer-modal .btn-close::after {
    width: 18px !important;
  }

  .image-viewer-modal .btn-close:hover::before,
  .image-viewer-modal .btn-close:hover::after {
    width: 20px !important;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7), 0 2px 12px rgba(0, 0, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

/* 暗色模式适配 */
.dark-mode .btn-close {
  background-color: rgba(50, 50, 50, 0.85);
}

.dark-mode .btn-close::before,
.dark-mode .btn-close::after {
  background-color: #eee;
}

.dark-mode .btn-close:hover {
  background-color: rgba(60, 60, 60, 0.95);
}

.dark-mode .btn-close:hover::before,
.dark-mode .btn-close:hover::after {
  background-color: #fff;
}

/* 确保在各种背景下都可见 - 添加外发光效果 */
.info-card .btn-close {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* 移动端抽屉中的关闭按钮 */
#mobile-anime-list .point-item .btn-close {
  width: 24px;
  height: 24px;
  top: 6px;
  right: 6px;
}

#mobile-anime-list .point-item .btn-close::before,
#mobile-anime-list .point-item .btn-close::after {
  width: 12px;
}

/* 确保关闭按钮在所有设备上都能正常显示 */
@media (max-width: 320px) {
  .btn-close {
    width: 24px;
    height: 24px;
    top: 6px;
    right: 6px;
  }

  .btn-close::before,
  .btn-close::after {
    width: 12px;
  }
}
