/* ===========================
   CO-PILOT APP STYLES
   Matches LaunchStack cream/slate/amber design system
   =========================== */

.app-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background: var(--cream);
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: var(--slate);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  margin-bottom: 2.5rem;
}

.logo-link {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-on-dark);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.sidebar-section {
  flex: 1;
}

.sidebar-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.875rem;
}

.context-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.context-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.context-key {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-on-dark-mid);
  letter-spacing: 0.05em;
}

.context-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text-on-dark);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
  transition: border-color 0.2s ease;
  outline: none;
}

.context-input::placeholder {
  color: rgba(209,213,219,0.4);
}

.context-input:focus {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(255,255,255,0.08);
}

.sidebar-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.back-link {
  font-size: 0.8125rem;
  color: var(--text-on-dark-mid);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--amber-light);
}

/* ===== CHAT MAIN ===== */
.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--cream);
}

.chat-header {
  padding: 3rem 3rem 2rem;
  border-bottom: 1px solid var(--cream-mid);
  background: var(--cream);
}

.chat-header .section-label {
  margin-bottom: 0.5rem;
}

.chat-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--slate);
  line-height: 1.1;
  margin-bottom: 0.625rem;
  letter-spacing: -0.015em;
}

.chat-subtitle {
  font-size: 0.9375rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ===== CONVERSATION ===== */
.conversation {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.welcome-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  gap: 1.25rem;
  color: var(--text-light);
}

.welcome-icon {
  opacity: 0.8;
}

.welcome-prompt p {
  font-size: 0.9375rem;
  color: var(--text-light);
  max-width: 400px;
  line-height: 1.7;
}

.message {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  max-width: 680px;
}

.message-user {
  flex-direction: row-reverse;
  margin-left: auto;
}

.message-avatar {
  flex-shrink: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
}

.ai-avatar {
  background: var(--slate);
  color: var(--amber);
}

.user-avatar {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-dark);
}

.message-bubble {
  padding: 0.875rem 1.125rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 100%;
  word-break: break-word;
}

.message-assistant .message-bubble {
  background: var(--cream-mid);
  color: var(--text-dark);
  border: 1px solid rgba(10,22,40,0.06);
}

.message-user .message-bubble {
  background: var(--slate);
  color: var(--text-on-dark);
}

/* ===== INPUT AREA ===== */
.chat-input-area {
  padding: 1.5rem 3rem 2rem;
  border-top: 1px solid var(--cream-mid);
  background: var(--cream);
}

.chat-form {
  max-width: 680px;
}

.input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  background: white;
  border: 1.5px solid rgba(10,22,40,0.12);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--text-dark);
  line-height: 1.6;
  resize: none;
  outline: none;
  min-height: 48px;
  max-height: 160px;
  overflow-y: auto;
  transition: border-color 0.2s ease;
}

.chat-textarea::placeholder {
  color: var(--text-light);
}

.chat-textarea:focus {
  border-color: var(--amber);
}

.send-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--slate);
  color: var(--text-on-dark);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.send-btn:hover:not(:disabled) {
  background: var(--amber);
  color: var(--slate);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.625rem;
  padding-left: 0.25rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .app-body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .chat-header {
    padding: 2rem 1.5rem 1.5rem;
  }
  .conversation {
    padding: 1.5rem;
  }
  .chat-input-area {
    padding: 1rem 1.5rem 1.5rem;
  }
  .input-row {
    gap: 0.5rem;
  }
}