:root {
  --primary-color: #7c3aed;
  --secondary-color: #a855f7;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #1e293b;
  --border-color: #e2e8f0;
}

[data-theme="dark"] {
  --background: #0f0f23;
  --surface: #1e1e3f;
  --text-primary: #e2e8f0;
  --border-color: #374151;
}

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

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--text-primary);
  height: 100vh; display: flex;
}

.main { flex: 1; display: flex; flex-direction: column; width: 100%; }
.top-nav {
  padding: 0.8rem 1.2rem; background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  display: flex; justify-content: space-between; align-items: center;
}
.menu-toggle {
  font-size: 1.4rem; border: none; background: none; cursor: pointer;
}
.menu {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
}
.menu a {
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.4rem 0;
}
.menu {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  gap: 0.8rem; /* kasih jarak antar bagian */
}

.menu-section {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
}

.clear-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.clear-btn:hover {
  background: #dc2626;
}

.chat-container {
  flex: 1; padding: 1rem; overflow-y: auto; display: flex; flex-direction: column;
}
.message {
  max-width: 70%; padding: 0.8rem 1rem; border-radius: 10px;
  margin-bottom: 1rem; line-height: 1.4;
}
.user { align-self: flex-end; background: var(--primary-color); color: white; }
.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border-color); }

.input-bar {
  display: flex; border-top: 1px solid var(--border-color); background: var(--surface);
  padding: 0.6rem;
}
.input-bar input {
  flex: 1; border: none; outline: none; padding: 0.8rem;
  background: transparent; color: var(--text-primary);
}
.input-bar button {
  background: var(--primary-color); border: none; color: white;
  padding: 0 16px; border-radius: 6px; cursor: pointer;
}

.code-block {
  position: relative;
  background: #1e1e2f;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem;
}
.code-block pre {
  margin: 0;
  overflow-x: auto;
}
.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #7c3aed;
  color: white;
  border: none;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}
.copy-btn:hover {
  background: #a855f7;
}