body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background: #eddbb6;
  color: #222;
}

header {
  text-align: center;
  padding: 2rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

nav {
  text-align: center;
  padding: 1rem;
}

.logo {
  width: 50px;
  height: 50px;
}

main {
  padding: 2rem;
}

@keyframes flashCard {
  0%   { background-color: #fff3cd; }
  50%  { background-color: #ffeeba; }
  100% { background-color: #fff3cd; }
}

.ai-prototype-card {
  background-color: #fff3cd;
  border-left: 5px solid #ffc107;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  font-size: 0.95rem;
  color: #856404;
}

.ai-prototype-card.loading {
	animation: flashCard 2s ease-in-out infinite;
}

.loading-dots::after {
	content: '';
	display: inline-block;
	animation: dots 1.5s steps(3, end) infinite;
	width: 1em;
	text-align: left;
}

@keyframes dots {
	0%	 { content: ''; }
	33%	 { content: '.'; }
	66%	 { content: '..'; }
	100% { content: '...'; }
}

.ai-prototype.error-card {
  border-left: 4px solid #d9534f;
  background-color: #f8d7da;
  color: #721c24;
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 6px;
}

.ai-prototype.error-card .card-header {
  font-weight: bold;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.ai-prototype.error-card .icon {
  margin-right: 0.5rem;
}

.ai-prototype.error-card .error-message {
  font-style: italic;
  word-wrap: break-word;       /* Break long words */
  overflow-wrap: break-word;   /* Modern equivalent */
  white-space: pre-wrap;       /* Preserve line breaks, wrap text */
  max-width: 100%;             /* Prevent horizontal overflow */
  overflow: hidden;            /* Hide anything that still spills */
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.topic-card {
  background: white;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.topic-card:hover {
  transform: translateY(-4px);
}

.topic-card.plain-answer {
  background-color: #f9f9fc;
  border-left: 4px solid #444;
  margin-bottom: 12px;
}

.topic-card.list-item {
  background-color: #eef2f8;
  border-left: 4px solid #0078d4;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 6px;
}

.topic-card.paragraph-break {
	margin-top: 24px;
}

.typed-response {
  font-family: 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #333;
  padding: 12px;
  background-color: #f9f9fc;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  animation: fadeIn 0.3s ease-in;
}

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

.typed-response.typing::after {
  content: '|';
  animation: blink 1s infinite;
  margin-left: 4px;
  color: #0078d4;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

em {
  font-style: italic;
  color: #555;
}

code {
  background-color: #eef2f8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}