/**
 * File: client/css/bgm-generator.css
 * 背景音乐生成组件样式 - Apple风格黑白主题
 * 作用: 定义背景音乐生成区域的布局和视觉效果
 * @date 2025-12-13
 * @modification 优化UI设计，与网站整体风格保持一致
 */

/* ======================================
 * 背景音乐生成板块容器
 * 参考音效生成板块样式
 * ====================================== */
.bgm-generation-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #eeeeee;
}

/* 头部 - 标题和按钮 */
.bgm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.bgm-header .section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  display: flex;
  align-items: center;
  gap: 8px;
}

/**
 * @description 去掉标题图标
 * @date 2025-12-13
 */

/**
 * @description 生成背景音乐按钮样式 - 与音效按钮风格一致
 * @date 2025-12-13
 */
#dubbing-panel .bgm-generation-section .btn-warning,
#dubbing-panel #generateBgmBtn {
  background: #1a1a1a !important;
  background-color: #1a1a1a !important;
  border: 1px solid #1a1a1a !important;
  color: #fff !important;
  font-weight: 600;
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#dubbing-panel .bgm-generation-section .btn-warning:hover,
#dubbing-panel #generateBgmBtn:hover {
  background: #333333 !important;
  background-color: #333333 !important;
  border-color: #333333 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#dubbing-panel .bgm-generation-section .btn-warning:disabled,
#dubbing-panel #generateBgmBtn:disabled {
  background: #999999 !important;
  background-color: #999999 !important;
  border-color: #999999 !important;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none !important;
  box-shadow: none !important;
}

/* 状态提示 */
.bgm-status {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid #e5e5e5;
  border-left: 4px solid #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bgm-status p {
  margin: 0;
  color: #555555;
  font-size: 14px;
  line-height: 1.6;
}

/* ======================================
 * 提示词区域
 * ====================================== */
.bgm-prompt-section {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bgm-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bgm-prompt-header label {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  display: flex;
  align-items: center;
  gap: 6px;
}

/**
 * @description 去掉label图标
 * @date 2025-12-13
 */

/**
 * @description AI生成提示词按钮样式
 * @date 2025-12-13
 */
#generateBgmPromptBtn {
  background: #ffffff !important;
  border: 1.5px solid #1a1a1a !important;
  color: #1a1a1a !important;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#generateBgmPromptBtn:hover {
  background: #1a1a1a !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#generateBgmPromptBtn:disabled {
  background: #f5f5f5 !important;
  border-color: #cccccc !important;
  color: #999999 !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/**
 * @description 提示词输入框样式 - 现代感设计
 * @date 2025-12-13
 */
.bgm-prompt-input {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  background: #fafafa;
  color: #333333;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  transition: all 0.2s ease;
}

.bgm-prompt-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.08);
  background: #ffffff;
}

.bgm-prompt-input:hover:not(:focus) {
  border-color: #cccccc;
}

.bgm-prompt-input::placeholder {
  color: #999999;
  font-size: 13px;
  line-height: 1.6;
}

/* ======================================
 * 加载状态
 * ====================================== */
.bgm-generation-section .loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid #e5e5e5;
}

.bgm-generation-section .loading-indicator .spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #f0f0f0;
  border-top: 3px solid #1a1a1a;
  border-radius: 50%;
  animation: bgm-spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes bgm-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.bgm-generation-section .loading-indicator p {
  margin: 0;
  color: #555555;
  font-size: 14px;
  font-weight: 500;
}

/* ======================================
 * 生成结果区域
 * ====================================== */
.bgm-result-section {
  margin-top: 24px;
}

.bgm-result-section > label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/**
 * @description 去掉结果标签图标
 * @date 2025-12-13
 */

/**
 * @description 结果列表 - 单列布局
 * @date 2025-12-13
 * @modification 改为只显示1首音乐
 */
.bgm-result-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/**
 * @description 单个音乐卡片样式 - 精致卡片设计
 * @date 2025-12-13
 */
.bgm-card {
  background: #ffffff;
  border: 1.5px solid #e5e5e5;
  border-radius: 14px;
  padding: 20px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.bgm-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1a1a1a 0%, #666666 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.bgm-card:hover {
  border-color: #1a1a1a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.bgm-card:hover::before {
  opacity: 1;
}

/**
 * @description 已选择样式（绿色条和标签）已移除
 * @date 2025-12-13
 */

/* 卡片头部 */
.bgm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.bgm-card-index {
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, #1a1a1a 0%, #444444 100%);
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.bgm-card-duration {
  font-size: 12px;
  color: #666666;
  background: #f5f5f5;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "SF Mono", monospace;
}

/* 卡片内容 - 标题 */
.bgm-card-content {
  margin-bottom: 16px;
}

.bgm-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.bgm-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bgm-card-tag {
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f0f0 100%);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: #555555;
  font-weight: 500;
  border: 1px solid #e5e5e5;
}

/* ======================================
 * 播放器样式 - 精致播放器
 * ====================================== */
.bgm-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 10px;
  border: 1px solid #e5e5e5;
  margin-bottom: 16px;
}

.bgm-play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.bgm-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.bgm-play-btn:active {
  transform: scale(0.95);
}

.bgm-play-btn.playing {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  animation: bgm-pulse 1.5s ease-in-out infinite;
}

@keyframes bgm-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3); }
  50% { box-shadow: 0 4px 20px rgba(40, 167, 69, 0.5); }
}

.bgm-play-btn .play-icon {
  font-size: 14px;
  margin-left: 2px;
}

.bgm-progress-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.bgm-progress-bar {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: height 0.15s ease;
}

.bgm-progress-bar:hover {
  height: 8px;
}

.bgm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a1a1a 0%, #444444 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.bgm-time-display {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #666666;
  font-family: -apple-system, BlinkMacSystemFont, "SF Mono", monospace;
}

.bgm-time-sep {
  color: #cccccc;
}

.bgm-current-time {
  color: #1a1a1a;
  font-weight: 600;
}

.bgm-total-time {
  color: #888888;
}

/* ======================================
 * 卡片操作按钮
 * ====================================== */
.bgm-card-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.bgm-card-actions .btn {
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

/**
 * @description 选择作为背景音乐按钮 - 主按钮
 * @date 2025-12-13
 */
.bgm-select-btn {
  background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bgm-select-btn:hover {
  background: linear-gradient(135deg, #333333 0%, #444444 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/**
 * @description 下载按钮 - 次要按钮
 * @date 2025-12-13
 */
.bgm-download-btn {
  background: #ffffff;
  color: #333333;
  border: 1.5px solid #e5e5e5;
}

.bgm-download-btn:hover {
  background: #f5f5f5;
  border-color: #cccccc;
  transform: translateY(-1px);
}

/* ======================================
 * 空状态
 * ====================================== */
.bgm-empty-state {
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
  border: 2px dashed #e5e5e5;
  border-radius: 16px;
  color: #888888;
}

.bgm-empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.bgm-empty-state-text {
  font-size: 15px;
  font-weight: 500;
  color: #666666;
  margin: 0;
}

/* ======================================
 * 响应式调整
 * ====================================== */

@media (max-width: 768px) {
  .bgm-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .bgm-prompt-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .bgm-prompt-section {
    padding: 16px;
  }

  .bgm-card {
    padding: 16px;
  }

  .bgm-card-actions {
    flex-wrap: wrap;
  }

  .bgm-card-actions .btn {
    flex: 1;
    min-width: 100px;
    text-align: center;
    justify-content: center;
  }

  .bgm-player {
    padding: 12px;
  }

  .bgm-play-btn {
    width: 38px;
    height: 38px;
  }
}
