/* 播客应用自定义样式 */

/* CSS 变量定义 */
:root {
  --podcast-primary: #6366f1;
  --podcast-secondary: #8b5cf6;
  --podcast-accent: #06b6d4;
  --podcast-dark: #1e293b;
  --podcast-light: #f8fafc;
  --podcast-gradient: linear-gradient(135deg, var(--podcast-primary), var(--podcast-secondary));

  /* 动画变量 */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局样式重置 */
* {
  box-sizing: border-box;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--podcast-primary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--podcast-secondary);
}

/* 文本截断 */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* 播放器特效 */
.audio-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.audio-wave .bar {
  width: 3px;
  background: var(--podcast-primary);
  border-radius: 2px;
  animation: wave 1.5s ease-in-out infinite;
}

.audio-wave .bar:nth-child(1) {
  height: 10px;
  animation-delay: 0s;
}
.audio-wave .bar:nth-child(2) {
  height: 16px;
  animation-delay: 0.1s;
}
.audio-wave .bar:nth-child(3) {
  height: 12px;
  animation-delay: 0.2s;
}
.audio-wave .bar:nth-child(4) {
  height: 18px;
  animation-delay: 0.3s;
}
.audio-wave .bar:nth-child(5) {
  height: 8px;
  animation-delay: 0.4s;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.5);
    opacity: 0.7;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* 播放进度条 */
.progress-bar {
  position: relative;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.progress-bar .progress {
  height: 100%;
  background: var(--podcast-gradient);
  border-radius: 2px;
  transition: width var(--transition-normal);
}

.progress-bar .thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background: white;
  border: 2px solid var(--podcast-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.progress-bar:hover .thumb {
  opacity: 1;
}

/* 专辑封面旋转动画 */
.album-rotating {
  animation: rotate 20s linear infinite;
}

.album-rotating.paused {
  animation-play-state: paused;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 卡片悬停效果 */
.podcast-card {
  transition: all var(--transition-normal);
  cursor: pointer;
}

.podcast-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--podcast-gradient);
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--podcast-primary);
  border: 1px solid var(--podcast-primary);
}

.btn-secondary:hover {
  background: var(--podcast-primary);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--podcast-primary);
}

.btn-ghost:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* 输入框样式 */
.input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: var(--podcast-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 模态框动画 */
.modal-enter {
  opacity: 0;
  transform: scale(0.95);
}

.modal-enter-active {
  opacity: 1;
  transform: scale(1);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.modal-leave {
  opacity: 1;
  transform: scale(1);
}

.modal-leave-active {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

/* 加载状态 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 2s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 播客特色样式 */
.podcast-gradient-bg {
  background: var(--podcast-gradient);
}

.podcast-glassmorphism {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 响应式工具类 */
@media (max-width: 640px) {
  .mobile-hidden {
    display: none;
  }
}

@media (min-width: 641px) {
  .mobile-only {
    display: none;
  }
}

/* 辅助功能 */
.focus-visible:focus {
  outline: 2px solid var(--podcast-primary);
  outline-offset: 2px;
}

/* 暗黑模式支持 */
.dark {
  --podcast-light: #1e293b;
  --podcast-dark: #f8fafc;
}

.dark .bg-white {
  background-color: #1e293b;
}

.dark .text-gray-900 {
  color: #f8fafc;
}

.dark .text-gray-600 {
  color: #cbd5e1;
}

.dark .border-gray-200 {
  border-color: #374151;
}

/* 播放器控制按钮 */
.play-button {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--podcast-gradient);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.play-button:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.play-button svg {
  width: 20px;
  height: 20px;
  color: white;
}

/* 音量控制 */
.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 80px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--podcast-primary);
  border-radius: 50%;
  cursor: pointer;
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--podcast-primary);
}

/* 评分星星 */
.star-rating {
  display: flex;
  gap: 2px;
}

.star {
  width: 16px;
  height: 16px;
  color: #fbbf24;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.star:hover,
.star.active {
  color: #f59e0b;
}

/* 通知样式 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--podcast-primary);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.notification.show {
  transform: translateX(0);
}

/* 列表动画 */
.list-enter {
  opacity: 0;
  transform: translateY(20px);
}

.list-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all var(--transition-normal);
}

/* 搜索高亮 */
.search-highlight {
  background: rgba(255, 235, 59, 0.3);
  padding: 1px 2px;
  border-radius: 2px;
}

/* 自定义选择器样式 */
.custom-select {
  position: relative;
}

.custom-select select {
  appearance: none;
  background: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e")
    no-repeat right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* 波浪形分隔线 */
.wave-divider {
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' fill='%236366f1'%3E%3C/path%3E%3C/svg%3E")
    no-repeat center;
  background-size: cover;
}

/* 渐变文字 */
.gradient-text {
  background: var(--podcast-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Alpine.js 隐藏 */
[x-cloak] {
  display: none !important;
}
