/* AI Tool Banner Optimization - Red Theme */
.ai-tool-banner {
  max-height: 80px;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

.ai-tool-banner:hover {
  transform: scale(1.01) translateY(-2px);
}

.dark .ai-tool-banner {
  --tw-bg-opacity: 1;
  background: rgb(249 250 251 / var(--tw-bg-opacity, 1));
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 32px -18px rgba(15, 23, 42, 0.38);
  color: #1f2937;
}

.dark .ai-tool-banner:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 22px 40px -20px rgba(15, 23, 42, 0.45);
}

.dark .ai-tool-banner h3,
.dark .ai-tool-banner p,
.dark .ai-tool-banner span,
.dark .ai-tool-banner strong {
  color: #1f2937;
}

.dark .ai-tool-banner p {
  color: #4b5563;
}

.dark .ai-tool-banner span[aria-label="New tool announcement"] {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid rgba(248, 113, 113, 0.45);
}

@media (max-width: 640px) {
  .ai-tool-banner {
    max-height: none;
  }
}

/* Line clamping utilities */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

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

/* Dynamic animations for AI tool banner */
@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-subtle {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

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

.animate-fade-in {
  animation: fade-in 0.6s ease-out;
}

.animate-pulse-subtle {
  animation: pulse-subtle 2s ease-in-out infinite;
}

.animate-spin-slow {
  animation: spin-slow 8s linear infinite;
}

/* Loading animation styles */
.spinner {
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 输入框基础样式 */
#video-url {
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#video-url:focus {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

#paste-url-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}

#paste-url-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 按钮样式优化 */
button[type="submit"] {
  transition: all 0.2s ease-in-out;
  min-width: 100px;
}

/* 桌面端优化 */
@media (min-width: 640px) {
  #url-form {
    display: flex;
    flex-direction: column;
  }
  
  #video-url, button[type="submit"] {
    line-height: 1.5;
  }
  
  .flex.flex-col.sm\\:flex-row {
    align-items: center;
  }
}

/* 响应式输入框调整 */
@media (max-width: 640px) {
  #video-url {
    height: 48px; /* 固定高度 */
    font-size: 16px; /* 更大的字体，防止iOS自动缩放 */
  }
  
  button[type="submit"] {
    height: 48px;
    font-size: 16px;
  }
}

/* 针对大屏高分辨率手机 (如三星Note20 Ultra) */
@media (max-width: 767px) and (min-height: 800px) {
  #url-form {
    max-width: 100%;
    margin: 0 auto;
  }
  
  #video-url, button[type="submit"] {
    height: 44px; /* 稍微减小高度 */
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
}

/* 高DPI设备的优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #url-form input, #url-form button {
    border-width: 1px;
  }
}

/* 暗色模式优化 */
@media (prefers-color-scheme: dark) {
  #video-url {
    color-scheme: dark;
  }
}

/* 暗色模式下Hero区域文本亮度优化 - 只针对p元素 */
.dark .max-w-7xl > div > p {
  color: #e5e7eb !important; /* gray-200 - 更亮的灰色 */
}

/* 针对Hero区域中gray-500的文本进行优化 */
.dark .text-gray-500 {
  color: #d1d5db !important; /* 从gray-300提升到gray-200获得更好的对比度 */
}

/* 专门针对暗色模式下gray-300文本的进一步优化 */
.dark .dark\:text-gray-300 {
  color: #e5e7eb !important; /* 从gray-300提升到gray-200 */
}

/* 确保h1标题在暗色模式下正确显示 */
.dark h1.text-gray-900 {
  color: #ffffff !important; /* 确保标题在暗色模式下为白色 */
}

/* 确保h1中的第一个span元素继承正确的颜色 */
.dark h1 span:first-child {
  color: inherit !important; /* 继承父元素h1的白色 */
}

/* AI工具描述文本在暗色模式下的特定颜色 */
.dark #ai-tool-description {
  color: #a2afb9 !important;
} 
