:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1e1b4b 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

.week-select {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
}

.week-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.week-select option {
  background: var(--bg-dark);
  color: var(--text-primary);
}

.main-content {
  margin-top: 80px;
  padding: 40px 32px;
  min-height: calc(100vh - 80px);
}

.slide-container {
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

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

.cover-page {
  text-align: center;
  padding: 80px 0;
}

.cover-icon {
  font-size: 80px;
  margin-bottom: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cover-title {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cover-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

.cover-badge {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 32px;
}

.progress-bar-container {
  width: 400px;
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  margin: 0 auto;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  animation: progress 2s ease-out forwards;
}

@keyframes progress {
  from { width: 0%; }
  to { width: 100%; }
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.card-icon {
  font-size: 32px;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.card-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-list {
  list-style: none;
  padding: 0;
}

.card-list li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.card-list li:last-child {
  border-bottom: none;
}

.card-list li::before {
  content: '✓';
  color: var(--success-color);
  margin-right: 12px;
  font-weight: bold;
}

.highlight-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-color: var(--primary-color);
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.code-block {
  background: #0f172a;
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

.code-block pre {
  margin: 0;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.6;
}

.code-block code {
  color: #f1f5f9;
}

.code-comment {
  color: #64748b;
}

.code-keyword {
  color: #f472b6;
}

.code-string {
  color: #34d399;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.feature-item:hover {
  border-color: var(--primary-color);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.feature-icon.blue {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.feature-icon.purple {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.feature-icon.green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.feature-icon.yellow {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.feature-content h3 {
  color: var(--text-primary);
  font-size: 16px;
  margin-bottom: 8px;
}

.feature-content p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
  color: var(--text-secondary);
  font-size: 18px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 40px 0;
}

.footer-page {
  text-align: center;
  padding: 60px 0;
}

.footer-icon {
  font-size: 64px;
  color: var(--primary-color);
  margin-bottom: 24px;
}

.footer-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-text {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.cta-btn {
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.tts-controls {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  padding: 12px 20px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 100;
  transition: all 0.3s ease;
}

.tts-controls.playing {
  bottom: 80px;
  padding: 8px 12px;
}

.tts-controls.playing .voice-select {
  display: none;
}

.tts-controls.playing .tts-progress {
  width: 80px;
}

.tts-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.tts-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

.tts-progress {
  width: 120px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.tts-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0%;
  transition: width 0.3s ease;
}

.slide-header {
  margin-bottom: 32px;
}

.slide-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.slide-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }
  
  .header-title {
    font-size: 16px;
  }
  
  .nav-controls {
    gap: 10px;
  }
  
  .nav-btn {
    padding: 8px 14px;
    font-size: 12px;
  }
  
  .main-content {
    padding: 20px 16px;
  }
  
  .cover-title {
    font-size: 32px;
  }
  
  .progress-bar-container {
    width: 280px;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .two-column {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tts-controls {
    bottom: 16px;
    right: 16px;
    left: 16px;
    justify-content: center;
  }
}

.captions-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  width: calc(100% - 48px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 24px;
  text-align: center;
  z-index: 98;
  box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.3);
}

.voice-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  min-width: 140px;
}

.voice-select:hover {
  border-color: var(--primary-color);
}

.voice-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.voice-select option {
  background: var(--bg-dark);
  color: var(--text-primary);
}

.caption-line {
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.6;
  min-height: 28px;
  transition: all 0.3s ease;
}

.caption-line.active {
  color: var(--primary-color);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.caption-progress {
  height: 2px;
  background: var(--border-color);
  border-radius: 1px;
  margin-top: 12px;
  overflow: hidden;
}

.caption-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 1px;
  transition: width 0.5s ease;
}

@media (max-width: 768px) {
  .captions-container {
    bottom: 90px;
    padding: 16px;
  }
  
  .caption-line {
    font-size: 16px;
  }
}