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

:root {
  --color-bg: #0f0f0f;
  --color-surface: #1a1a1a;
  --color-border: #2a2a2a;
  --color-text: #f0f0f0;
  --color-muted: #888;
  --color-accent-from: #6366f1;
  --color-accent-to: #8b5cf6;
  --color-confirmed: #10b981;
  --color-video-based: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
}

.page-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 16px;
}

.product-header { margin-bottom: 20px; }
.product-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-accent-from), var(--color-accent-to));
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.product-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}
.product-subtitle { font-size: 14px; color: var(--color-muted); }

.player-wrapper {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
}
#video { width: 100%; height: 100%; display: block; }

.ask-ai-btn {
  position: absolute;
  bottom: 70px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--color-accent-from), var(--color-accent-to));
  color: white;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(99,102,241,0.4);
}
.ask-ai-btn:hover { opacity: 0.85; }

.qa-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-top: 12px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}
.qa-section.open {
  max-height: 600px;
  opacity: 1;
}
.qa-inner { padding: 20px; }

.qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.qa-title { font-size: 15px; font-weight: 700; }
.qa-close {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  line-height: 1;
}
.qa-close:hover { color: var(--color-text); }

.suggested-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.suggested-chip {
  background: #252525;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.suggested-chip:hover {
  background: #2e2e2e;
  border-color: var(--color-accent-from);
}

.question-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.question-input {
  flex: 1;
  background: #252525;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.question-input:focus { border-color: var(--color-accent-from); }
.question-input::placeholder { color: var(--color-muted); }
.send-button {
  background: linear-gradient(135deg, var(--color-accent-from), var(--color-accent-to));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  padding: 10px 14px;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
}
.send-button:hover { opacity: 0.85; }
.send-button:disabled { opacity: 0.4; cursor: not-allowed; }

.answer-area { min-height: 0; }

.answer-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-muted);
  font-size: 14px;
  padding: 12px 0;
}
.loading-dots { display: flex; gap: 4px; }
.loading-dots span {
  width: 6px; height: 6px;
  background: var(--color-accent-from);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.answer-card {
  background: #1e1e2e;
  border: 1px solid #2e2e4e;
  border-radius: var(--radius-sm);
  padding: 16px;
}
.answer-source-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 20px;
}
.answer-source-label.confirmed {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-confirmed);
}
.answer-source-label.video-based {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-video-based);
}
.answer-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
}
.timestamp-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-accent-from);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.timestamp-link:hover { text-decoration: underline; }

.fallback-card {
  background: #1e1a1a;
  border: 1px solid #3a2a2a;
  border-radius: var(--radius-sm);
  padding: 16px;
}
.fallback-card p { font-size: 14px; color: var(--color-muted); margin-bottom: 10px; }
.fallback-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--color-accent-from), var(--color-accent-to));
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}
