* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 20% 20%, #1f2937 0%, #000000 55%);
  color: #e5e7eb;
  min-height: 100vh;
}

.app {
  width: min(1100px, 96vw);
  min-height: calc(100vh - 2rem);
  margin: 1rem auto;
  padding: 1.5rem;
  background: linear-gradient(145deg, #05070c 0%, #0b1020 100%);
  border: 1px solid #1f2937;
  border-radius: 18px;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 35px rgba(56, 189, 248, 0.12);
}

h1 {
  margin: 0 0 0.25rem;
  color: #f8fafc;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}

.subtitle {
  margin: 0 0 1rem;
  color: #94a3b8;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.chip {
  border: 1px solid #334155;
  background: linear-gradient(135deg, #111827 0%, #0b1220 100%);
  color: #dbeafe;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chip:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.28);
}

.chat-history {
  height: 420px;
  overflow-y: auto;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 0.75rem;
  background: linear-gradient(180deg, #020617 0%, #111827 100%);
}

.follow-up-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
  min-height: 1.9rem;
}

.timeline-view {
  margin-top: 1rem;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #030712 0%, #111827 100%);
}

.timeline-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #7dd3fc;
}

.timeline-list {
  display: grid;
  gap: 0.6rem;
}

.timeline-item {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #0b1220;
}

.timeline-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.timeline-year {
  font-weight: 700;
  color: #67e8f9;
}

.timeline-type {
  font-size: 0.75rem;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.timeline-item h4 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  color: #f8fafc;
}

.timeline-item p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.88rem;
}

.message {
  margin: 0.5rem 0;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  max-width: 90%;
  white-space: pre-wrap;
  line-height: 1.35;
}

.message-text {
  display: inline-block;
}

.message-text a {
  color: #7dd3fc;
}

.thinking-bubble {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}

.thinking-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #67e8f9;
  opacity: 0.35;
  animation: pulse 1s infinite ease-in-out;
}

.thinking-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.message.user {
  margin-left: auto;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
}

.message.assistant {
  margin-right: auto;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #f8fafc;
  border: 1px solid #334155;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.45);
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

#messageInput {
  flex: 1;
  padding: 0.7rem;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #020617;
  color: #f8fafc;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#messageInput:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

#messageInput::placeholder {
  color: #64748b;
}

#sendBtn {
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#clearChatBtn {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  background: #0b1220;
  color: #cbd5e1;
  cursor: pointer;
  font-weight: 600;
}

#clearChatBtn:hover:not(:disabled) {
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.28);
}

#sendBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.52);
}

#sendBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-text {
  margin-top: 0.75rem;
  min-height: 1rem;
  color: #93c5fd;
  font-size: 0.9rem;
}
