/* Styles unique to the Assistant pane's content - editing this file never affects Workspace. */

.ai-account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #eef0f3;
  background: #fafbfc;
}
.ai-account-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #718096;
}
.ai-account-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.ai-account-dot-in { background: #16a34a; }
.ai-account-dot-out { background: #cbd5e0; }
.ai-account-logout {
  background: none;
  border: 1px solid #eef0f3;
  color: #b91c1c;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ai-account-logout:hover { background: #fef2f2; border-color: #fecaca; }
.ai-account-login {
  background: linear-gradient(135deg, var(--ai-primary,#2563EB), var(--ai-accent,#0EA5E9));
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
}
.ai-account-login:hover { opacity: 0.9; }

.ai-account-gate {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  box-sizing: border-box;
}
.ai-account-gate p {
  color: #718096;
  font-size: 14px;
  margin: 0 0 16px;
  max-width: 280px;
}
.ai-account-gate-btn {
  background: linear-gradient(135deg, var(--ai-primary,#2563EB), var(--ai-accent,#0EA5E9));
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
}
.ai-account-gate-btn:hover { opacity: 0.9; }

/* Override the generic scrolling pane-body just for this pane: only the
   message list should scroll, the input row must always stay visible -
   this was a real bug (Send button hidden below the fold on mobile until
   the user scrolled to find it). */
.ai-pane[data-pane="assistant"] .ai-pane-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  min-height: 0;
}

.ai-chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  max-width: 85%;
}
.ai-chat-bubble.assistant-msg {
  background: #f0f4fa;
  color: #0d141a;
}
.ai-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #eef0f3;
  flex-shrink: 0;
  background: #fff;
}
.ai-chat-input-row input,
.ai-chat-input-row textarea.ai-chat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  overflow-y: auto;
  max-height: 120px;
  line-height: 1.4;
}
.ai-chat-input-row button {
  background: linear-gradient(135deg, var(--ai-primary,#2563EB), var(--ai-accent,#0EA5E9));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 18px;
  min-height: 40px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

/* Document upload row - below the chat input, always visible. */
.ai-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 10px;
  border-top: 1px solid #eef0f3;
  flex-shrink: 0;
  background: #fff;
}
.ai-upload-input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #4a5568;
}
.ai-upload-input::-webkit-file-upload-button {
  background: #f0f4fa;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 8px;
}
.ai-upload-btn {
  background: linear-gradient(135deg, var(--ai-primary,#2563EB), var(--ai-accent,#0EA5E9));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  min-height: 36px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.ai-upload-btn:hover { opacity: 0.9; }
.ai-upload-btn:disabled { opacity: 0.6; cursor: default; }

/* ---- Layout beautification (v0.124.0, D226): glass + rhythm ----
   Same token set as the admin sheets (navy #104058, flask #2088c0,
   radii 8/12/14/999). Additive only; pane layout untouched. */

/* Account bar goes frosted with a status pill */
.ai-account-bar {
  background: rgba(250, 251, 252, 0.7);
  border-bottom: 1px solid rgba(16, 64, 88, 0.1);
}
.ai-account-status {
  color: #3c545f;
}
.ai-account-dot-in { box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
.ai-account-logout {
  border: 1px solid rgba(185, 28, 28, 0.3);
  border-radius: 999px;
}
.ai-account-login,
.ai-account-gate-btn {
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Chat bubbles: frosted assistant card, gradient user action */
.ai-chat-bubble {
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(16, 64, 88, 0.06);
}
.ai-chat-bubble.assistant-msg {
  background: rgba(240, 244, 250, 0.85);
  border: 1px solid rgba(16, 64, 88, 0.09);
}

/* Input + upload rows go frosted; focus glows flask */
.ai-chat-input-row,
.ai-upload-row {
  background: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(16, 64, 88, 0.1);
}
.ai-chat-input-row input:focus,
.ai-chat-input-row textarea.ai-chat-input:focus {
  border-color: #2088c0;
  box-shadow: 0 0 0 1px #2088c0;
  outline: none;
}
.ai-chat-input-row button,
.ai-upload-btn {
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.ai-upload-input::-webkit-file-upload-button {
  border-radius: 999px;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .ai-account-bar,
  .ai-chat-bubble.assistant-msg,
  .ai-chat-input-row,
  .ai-upload-row {
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    backdrop-filter: blur(12px) saturate(1.2);
  }
}
