/* GenAI Chat — Interactive Chat UI (Light Mode) */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  height: 100vh;
  overflow: hidden;
}

#app {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Login view */
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #f5f5f5;
}

.login-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 380px;
}

.login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
  color: #1a1a1a;
}

.login-card p {
  color: #666;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.login-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 16px;
  background: #f8f8f8;
}

.login-card input:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25,118,210,0.1);
}

.login-card button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
}

.login-card button[type="submit"]:hover {
  background: #1565c0;
}

.login-card button[type="submit"]:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

.login-error {
  margin-top: 12px;
  padding: 8px 12px;
  background: #fff3f3;
  color: #c62828;
  border-radius: 6px;
  font-size: 0.85rem;
  border: 1px solid #ffcdd2;
}

/* Chat view */
.chat-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
}

.user-label {
  font-size: 0.85rem;
  color: #555;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-controls select {
  background: #f8f8f8;
  color: #333;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.8rem;
  max-width: 280px;
}

.header-controls button {
  background: #e53935;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
}

.header-controls button:hover {
  background: #c62828;
}

.header-controls .new-chat-btn {
  background: #1976d2;
}

.header-controls .new-chat-btn:hover {
  background: #1565c0;
}

/* Chat messages area */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fafafa;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message.user {
  align-self: flex-end;
  background: #1976d2;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  align-self: flex-start;
  background: #ffffff;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.message.error {
  align-self: flex-start;
  background: #fff3f3;
  color: #c62828;
  border: 1px solid #ffcdd2;
  border-bottom-left-radius: 4px;
}

.message-meta {
  font-size: 0.7rem;
  color: #888;
  margin-top: 6px;
}

/* Chat input area */
.chat-input-area {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.input-row textarea {
  flex: 1;
  resize: none;
  background: #f5f5f5;
  color: #1a1a1a;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
}

.input-row textarea:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25,118,210,0.1);
}

.input-row textarea::placeholder {
  color: #999;
}

.input-row button {
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.input-row button:hover {
  background: #1565c0;
}

.input-row button:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding: 0 4px;
}

.session-total {
  font-size: 0.7rem;
  color: #888;
}

.spinner {
  font-size: 0.85rem;
}

/* Architecture log panel */
.arch-log {
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  padding: 10px 16px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.75rem;
}

.arch-log h3 {
  font-size: 0.8rem;
  color: #1976d2;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

.arch-log h3 button {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  margin-left: 8px;
}

.arch-log ol {
  list-style: none;
  padding: 0;
}

.arch-log li {
  padding: 2px 0;
  border-bottom: 1px solid #eee;
  color: #555;
}

.log-ts {
  color: #999;
}

.log-component {
  color: #e65100;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
