:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --success: #4cc9f0;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --user-bg: #e3f2fd;
  --bot-bg: #f8f9fa;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  color: var(--dark);
  line-height: 1.6;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.app-header {
  text-align: center;
  margin-bottom: 30px;
  color: var(--secondary);
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 80vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #f9fbfd;
}

.message {
  display: flex;
  margin-bottom: 16px;
  animation: slideIn 0.3s ease-out;
}

.message.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.4;
}

.user .message-bubble {
  background-color: var(--user-bg);
  border-bottom-right-radius: 4px;
  color: var(--dark);
}

.bot .message-bubble {
  background-color: var(--bot-bg);
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 4px;
}

.chat-input {
  display: flex;
  padding: 15px;
  background-color: white;
  border-top: 1px solid #e9ecef;
}

.chat-input input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #dee2e6;
  border-radius: 24px;
  font-size: 16px;
  margin-right: 10px;
  outline: none;
  transition: border 0.3s, box-shadow 0.3s;
}

.chat-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.3);
}

.chat-input button {
  padding: 12px 24px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}

.chat-input button:hover {
  background-color: var(--secondary);
}

.chat-input button:disabled {
  background-color: var(--gray);
  cursor: not-allowed;
}

.search-results {
  margin-top: 15px;
}

.results-header {
  padding: 10px 0;
  color: var(--gray);
}

.results-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  margin-top: 10px;
}

.result-card {
  padding: 15px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--primary);
  margin-bottom: 15px;
  transition: transform 0.2s;
  animation: fadeIn 0.3s ease-in-out;
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-card.lecture {
  border-left-color: var(--primary);
}

.result-card.seminar {
  border-left-color: var(--success);
}

.result-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--secondary);
  font-size: 1.1rem;
}

.result-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  font-size: 0.9rem;
}

.result-details p {
  margin: 5px 0;
}

.error-notice {
  color: #e63946;
  margin-top: 8px;
  font-size: 0.85rem;
}

/* Loading Indicator */
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.loading-indicator {
  display: flex;
  padding: 15px;
  justify-content: center;
}

.loading-dot {
  width: 10px;
  height: 10px;
  margin: 0 4px;
  background-color: var(--gray);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.5s;
}

.loading-dot:nth-child(3) {
  animation-delay: 1s;
}

/* Pesan dengan baris baru */
.message-text {
  white-space: pre-line;
}

/* Informasi entitas */
.entities-info {
  margin-top: 15px;
  padding: 10px;
  background-color: #f0f8ff;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.entities-info h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--secondary);
}

.entities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.entity-item {
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #eee;
}

.entity-key {
  font-weight: bold;
  color: var(--secondary);
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.entity-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entity-value {
  background-color: #e0e7ff;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.85rem;
}

/* Kategori pencarian */
.search-types-info {
  margin-top: 15px;
  padding: 10px;
  background-color: #e6f7ff;
  border-radius: 8px;
  border-left: 3px solid var(--success);
}

.search-types-info h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--secondary);
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.search-tag {
  background-color: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
}

/* Informasi normalisasi */
.normalized-info {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed #ddd;
}

.normalized-info h5 {
  margin-bottom: 8px;
  color: var(--gray);
  font-size: 0.9rem;
}

.normalized-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  font-size: 0.8rem;
  margin-top: 8px;
}

.normalized-item {
  display: flex;
  flex-direction: column;
}

.normalized-key {
  font-weight: bold;
  color: #666;
}

.normalized-value {
  font-family: monospace;
  word-break: break-all;
}

/* Header hasil pencarian */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.result-type {
  background-color: var(--primary);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

/* Pesan selamat datang */
.welcome-message {
  text-align: center;
  padding: 20px;
  color: var(--primary);
}

.welcome-message h3 {
  margin-bottom: 10px;
}

/* Contoh pertanyaan */
.example-queries {
  margin-top: 25px;
  text-align: left;
}

.example-queries p {
  font-weight: bold;
  margin-bottom: 10px;
}

.example-queries ul {
  list-style-type: none;
  padding: 0;
  max-width: 500px;
  margin: 0 auto;
}

.example-queries li {
  padding: 10px 15px;
  margin-bottom: 8px;
  background-color: #f0f7ff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #d0e6ff;
}

.example-queries li:hover {
  background-color: #e1eeff;
  transform: translateX(5px);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .chat-container {
    height: 90vh;
  }
  
  .message-bubble {
    max-width: 85%;
  }
  
  .results-container,
  .entities-grid,
  .normalized-grid {
    grid-template-columns: 1fr;
  }
  
  .example-queries li {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
}
