/* 八哥电影网 - 样式文件 */
:root {
  --primary: #3b82f6;
  --secondary: #8b5cf6;
  --accent: #f59e0b;
  --dark: #111827;
  --darker: #0f172a;
  --light: #f8fafc;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #ffffff;
  background-color: #0f172a;
  overflow-x: hidden;
}

/* 全局样式增强 */
a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

button {
  border: none;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

input {
  outline: none;
  border: none;
  font-family: inherit;
}

/* 导航栏增强 */
nav {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav.scroll {
  background-color: rgba(17, 24, 39, 0.9);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 搜索增强 */
.search-container {
  position: relative;
}

.suggestions-box {
  animation: fadeInUp 0.3s ease;
}

/* 英雄区域增强 */
.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: shine 3s infinite;
  z-index: 1;
}

/* 卡片悬停效果增强 */
.movie-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.movie-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
  z-index: 2;
}

.movie-card:hover::before {
  left: 100%;
}

.movie-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* 动画定义 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shine {
  0%, 100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 动画类 */
.animate-fade-in {
  animation: fadeIn 0.6s ease;
}

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

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* 移动端菜单增强 */
.mobile-menu {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 模态框样式 */
.modal {
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  animation: fadeInUp 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 响应式设计 */
@media (max-width: 640px) {
  .hero-section h2 {
    font-size: 2rem !important;
  }
  
  .hero-section p {
    font-size: 1rem !important;
  }
  
  .movie-card {
    margin-bottom: 1rem;
  }
  
  .grid-responsive {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .search-container {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .grid-responsive {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-section {
    height: 300px !important;
  }
  
  .section-title {
    font-size: 1.5rem !important;
  }
}

@media (max-width: 1024px) {
  .grid-responsive {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 高分辨率设备优化 */
@media (min-width: 1280px) {
  .grid-responsive {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #374151;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 工具类 */
.glass-effect {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.shadow-glow {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.border-gradient {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) border-box;
  background-clip: padding-box;
}

/* 无障碍增强 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 焦点样式 */
.focus-ring:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* 打印样式 */
@media print {
  * {
    background: white !important;
    color: black !important;
  }
  
  .no-print {
    display: none !important;
  }
}

/* 性能优化 */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #60a5fa;
    --secondary: #a78bfa;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
  .movie-card:hover {
    transform: none;
    box-shadow: none;
  }
  
  .movie-card:active {
    transform: scale(0.98);
  }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
  .movie-card {
    border: 2px solid #ffffff;
  }
  
  button {
    border: 2px solid #ffffff;
  }
}