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

/* 通用关闭按钮样式 */
.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 {
  top: 15px;
  right: 15px;
  background-color: rgba(0, 0, 0, 0.6);
  width: 36px;
  height: 36px;
  z-index: 1060;
  opacity: 1;
  display: flex !important;
  visibility: visible !important;
}

.image-viewer-modal .btn-close::before,
.image-viewer-modal .btn-close::after {
  background-color: #fff;
  width: 18px;
  height: 2px;
}

.image-viewer-modal .btn-close:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

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

/* 确保图片查看模态框的关闭按钮始终可见 */
.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: 1060 !important;
}

/* 添加额外的视觉提示，使关闭按钮更明显 */
.image-viewer-modal .btn-close {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  animation: pulse 2s infinite;
}

@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;
  }
}
