/* 猫语翻译器工具组件样式 */
@import url("/static/default/css/poppins.css");

.cat-translator-body {
  font-family: 'Poppins', sans-serif;
  padding: 1rem 0;
}

/* 玻璃拟态效果 */
.cat-translator-glass {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.3s ease;
}

.cat-translator-glass-dark {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 按钮悬浮效果 */
.cat-translator-btn {
  transition: all 0.2s ease;
  transform: translateY(0);
}

.cat-translator-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

/* 视频预览区域 */
.cat-translator-video-container {
  position: relative;
  transition: all 0.3s ease;
}

.cat-translator-video-container img,
.cat-translator-video-container video {
  transition: all 0.3s ease;
}

/* 进度条动画 */
@keyframes cat-translator-progress-animation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.cat-translator-progress-bar {
  background: linear-gradient(90deg, #6366f1, #a78bfa, #f472b6);
  background-size: 200% 200%;
  animation: cat-translator-progress-animation 2s ease infinite;
}

/* 结果卡片悬浮效果 */
.cat-translator-result-card {
  transition: all 0.3s ease;
}

.cat-translator-result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 加载动画 */
@keyframes cat-translator-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.cat-translator-loading-icon {
  animation: cat-translator-bounce 1.5s ease infinite;
}

/* 响应式调整 */
@media (min-width: 768px) {
  .cat-translator-container {
    max-width: 500px;
    margin: 0 auto;
  }
}

/* 调整工具区域与页脚的间距 */
.cat-translator-body .container {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

/* 调整按钮间距 */
.cat-translator-glass .flex.gap-4 {
  margin-bottom: 0.75rem; /* 减小按钮组的下边距 */
}

/* 翻译按钮的下边距 */
#translate-btn {
  margin-top: 1rem; /* 增加顶部间距 */
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

#translate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 114, 182, 0.3);
}

/* 视频预览容器 */
.cat-translator-video-wrapper {
  aspect-ratio: 9/9; /* 保持9:16的宽高比 */
  max-height: 70vh; /* 限制最大高度为视口高度的70% */
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: #000;
  position: relative;
}

/* 占位图片容器 */
#video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0.75rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 占位图片样式 */
.cat-translator-placeholder-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0.7;
  transition: all 0.3s ease;
}

/* 视频预览样式 */
#video-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
  border-radius: 0.75rem;
  position: absolute;
  top: 0;
  left: 0;
}

/* 视频播放控制 */
#video-preview::-webkit-media-controls {
  background-color: rgba(0, 0, 0, 0.5);
}

/* 视频容器样式调整 */
.aspect-video {
  aspect-ratio: auto; /* 移除固定宽高比，让视频决定容器高度 */
}

/* 可点击的视频占位区域 */
.cat-translator-clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.cat-translator-clickable:hover .cat-translator-placeholder-image {
  opacity: 0.8;
  transform: scale(1.15); /* 悬停时稍微放大 */
}

.cat-translator-clickable:hover .absolute {
  background-color: rgba(0, 0, 0, 0.4); /* 悬停时加深覆盖层 */
}

/* 确保覆盖层与图片大小一致 */
#video-placeholder .absolute {
  border-radius: 0.75rem;
}

/* 重新上传按钮 */
.cat-translator-reupload-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cat-translator-reupload-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: translateY(-2px);
}

/* 对话框样式 */
.cat-translator-dialog-overlay {
  opacity: 0;
  animation: cat-translator-fade-in 0.3s ease forwards;
}

@keyframes cat-translator-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 对话框关闭按钮 */
.cat-translator-dialog-close-btn {
  transition: all 0.3s ease;
  font-weight: 500;
  min-width: 100px;
}

.cat-translator-dialog-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 114, 182, 0.3);
}

/* 对话框内的图标 */
.cat-translator-dialog-overlay img.text-red-600 {
  filter: invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
}

.cat-translator-dialog-overlay img.text-blue-600 {
  filter: invert(39%) sepia(57%) saturate(2881%) hue-rotate(205deg) brightness(101%) contrast(101%);
}
