/* Bee App Styles — Clean, minimal, mobile-first */
:root {
  --primary: #00d4aa;
  --primary-dark: #00b894;
  --bg: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f3460;
  --text: #eaeaea;
  --text-muted: #a0a0a0;
  --border: #2a2a4a;
  --error: #ff6b6b;
  --success: #00d4aa;
  --warning: #ffe66d;
  --info: #74b9ff;
}

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

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

header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 { font-size: 1.25rem; color: var(--primary); }

main { flex: 1; padding: 1rem; max-width: 800px; margin: 0 auto; width: 100%; }

.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card h2 { color: var(--primary); margin-bottom: 1rem; font-size: 1.1rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.form-group input, .form-group textarea {
  width: 100%; padding: 0.75rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,212,170,0.2);
}

.btn {
  padding: 0.75rem 1.5rem; border: none; border-radius: 8px;
  font-family: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

#chat-container { display: flex; flex-direction: column; height: 400px; }
#chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.message { max-width: 85%; padding: 0.75rem 1rem; border-radius: 12px; animation: slideIn 0.2s ease; }
@keyframes slideIn { from {opacity: 0; transform: translateY(10px);} to {opacity: 1; transform: translateY(0);} }
.message-user { align-self: flex-end; background: var(--primary); color: var(--bg); border-bottom-right-radius: 4px; }
.message-agent { align-self: flex-start; background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.message-system { align-self: center; background: var(--warning); color: var(--bg); font-size: 0.85rem; padding: 0.5rem 1rem; border-radius: 20px; }
.message-header { display: flex; justify-content: space-between; font-size: 0.75rem; margin-bottom: 0.25rem; opacity: 0.7; }
.message-time { font-size: 0.7rem; }

.chat-input-area { display: flex; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.chat-input-area input { flex: 1; }

.toast { position: fixed; bottom: 1rem; right: 1rem; padding: 1rem 1.5rem; border-radius: 8px; color: var(--bg); font-weight: 500; animation: slideUp 0.3s ease; z-index: 1000; }
.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--info); }
.toast-warning { background: var(--warning); color: var(--bg); }
@keyframes slideUp { from {opacity: 0; transform: translateY(20px);} to {opacity: 1; transform: translateY(0);} }

#install-btn { position: fixed; bottom: 1rem; left: 1rem; z-index: 100; }

.offline-badge { position: fixed; top: 4rem; right: 1rem; background: var(--warning); color: var(--bg); padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; z-index: 100; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% {opacity: 1;} 50% {opacity: 0.7;} }

@media (max-width: 600px) {
  header { padding: 0.75rem; }
  main { padding: 0.75rem; }
  .card { padding: 1rem; }
  .message { max-width: 90%; }
}