/* Play Right with AI - 主樣式表 */
:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
}

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-color) 0%, #1a1f3a 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* 導航列 */
.navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(30, 41, 59, 0.95);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--primary-color);
}

/* 英雄區塊 */
.hero {
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* 章節卡片 */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.chapter-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition:
    transform 0.3s,
    border-color 0.3s;
  text-decoration: none;
  color: inherit;
}

.chapter-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
}

.chapter-number {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.chapter-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.chapter-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* 程式碼區塊 */
pre {
  background: #0d1117;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border-color);
}

code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
}

.inline-code {
  background: rgba(99, 102, 241, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--primary-color);
}

/* 互動元素 */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  border: none;
  cursor: pointer;
}

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

.btn-secondary {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

/* Playground 樣式 */
.playground-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.playground-input,
.playground-output {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.playground-textarea {
  width: 100%;
  min-height: 300px;
  background: #0d1117;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Fira Code', monospace;
  resize: vertical;
}

/* 搜尋功能 */
.search-container {
  position: relative;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* 響應式設計 */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .playground-container {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

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

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

/* Highlight.js 主題 */
.hljs {
  background: #0d1117;
  color: #c9d1d9;
}

.hljs-keyword {
  color: #ff7b72;
}

.hljs-string {
  color: #a5d6ff;
}

.hljs-function {
  color: #d2a8ff;
}

.hljs-comment {
  color: #8b949e;
  font-style: italic;
}

/* LLM Guide Section */
.llm-guide {
  padding: 80px 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
}

.llm-card {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.llm-card h3 {
  color: #a78bfa;
  font-size: 28px;
  margin-bottom: 20px;
}

.llm-card p {
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 30px;
}

.llm-highlights {
  background: rgba(99, 102, 241, 0.05);
  border-left: 4px solid #8b5cf6;
  padding: 20px 30px;
  margin: 30px 0;
  border-radius: 8px;
}

.llm-highlights ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.llm-highlights li {
  color: #e2e8f0;
  padding: 8px 0;
  font-size: 16px;
}

.llm-actions {
  display: flex;
  gap: 20px;
  margin-top: 30px;
}

.llm-actions .btn {
  padding: 12px 30px;
}

/* Quick Start Section - if not already exists */
.quick-start {
  padding: 80px 0;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.95));
}

/* Copy Button Styles */
pre {
  position: relative;
  background: #0d1117;
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.8;
  z-index: 10;
}

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

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn.copied {
  background: linear-gradient(135deg, #10b981, #059669);
  animation: pulse 0.3s ease;
}

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

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(10px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* Code Block Styling */
pre code {
  display: block;
  padding: 0;
  margin: 0;
  font-family: 'Fira Code', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #c9d1d9;
}

/* Step Section Code Blocks */
.step pre {
  margin-top: 1rem;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.step pre:hover .copy-btn {
  opacity: 1;
}
