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

:root {
  --bg: #f5f5f5;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: #e0e0e0;
  --main-bg: #ffffff;
  --user-bubble: #0066cc;
  --coach-bubble: #e8e8e8;
  --user-text: #ffffff;
  --coach-text: #1a1a1a;
  --accent: #0066cc;
  --border: #ddd;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.new-session-btn {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
}

.new-session-btn:hover { opacity: 0.9; }

.session-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.session-list li {
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 4px;
}

.session-list li:hover { background: rgba(255,255,255,0.1); }
.session-list li.active { background: rgba(255,255,255,0.15); }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 12px;
  font-size: 11px;
}

.uuid-display {
  display: block;
  font-size: 10px;
  word-break: break-all;
  margin-top: 4px;
  opacity: 0.7;
  cursor: pointer;
}

/* Main area */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--main-bg);
}

.gpx-dropzone {
  display: inline-block;
  padding: 8px 16px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  transition: border-color 0.2s;
}

.gpx-dropzone:hover,
.gpx-dropzone.dragover {
  border-color: var(--accent);
  color: var(--accent);
}

.gpx-dropzone.uploaded {
  border-color: #4caf50;
  color: #4caf50;
  border-style: solid;
}

.persona-slider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.slider-label {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}

#persona-slider { width: 160px; }

/* Chat */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #aaa;
  font-size: 15px;
}

.message {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: var(--user-text);
  border-bottom-right-radius: 4px;
}

.message.coach {
  align-self: flex-start;
  background: var(--coach-bubble);
  color: var(--coach-text);
  border-bottom-left-radius: 4px;
}

.gpx-card {
  align-self: center;
  background: #f0f7ff;
  border: 1px solid #c8ddf5;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  max-width: 400px;
  width: 100%;
}

.gpx-card h4 {
  margin-bottom: 8px;
  font-size: 13px;
  color: #555;
}

.gpx-card .stat {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.gpx-card .stat-label { color: #888; }
.gpx-card .stat-value { font-weight: 600; }

/* Chat form */
.chat-form {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--main-bg);
}

#chat-input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
}

#chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

#send-btn {
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

#send-btn:hover { opacity: 0.9; }
#send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .message { max-width: 85%; }
  .toolbar { flex-direction: column; gap: 8px; }
  .persona-slider { margin-left: 0; }
}
