/* ═══ Copilot (Alice) – Chat Panel Styles ═══ */

/* Button accent */
.btn-app-alice {
  background: var(--alice-accent);
  color: #fff;
}

.btn-app-alice:hover:not(:disabled) {
  background: #1e293b;
}

/* Panel chrome */
.alice-panel { border-color: rgba(51, 65, 85, 0.2); }
.alice-panel .panel-header-app { background: linear-gradient(135deg, #f8fafc, #f1f5f9); }
.alice-panel .panel-header-app h2 { color: var(--alice-accent); margin: 0; }
.alice-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.alice-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(51, 65, 85, 0.2);
}
.alice-header-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.alice-header-topline { display: flex; align-items: center; gap: 0.45rem; }
.alice-online-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #dcfce7;
  color: #166534;
}
.alice-online-badge.offline {
  background: #e2e8f0;
  color: #475569;
}

/* Messages container */
.chat-messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 0.85rem;
}

/* Message bubbles */
.chat-msg {
  max-width: 90%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: var(--radius-xs);
}

.chat-msg.alice {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--text-main);
  border-bottom-left-radius: var(--radius-xs);
}

/* Input area */
.chat-input-area {
  padding: var(--space-2) 0.85rem var(--space-3);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.chat-input-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}
.chat-input-row textarea {
  flex: 1;
  min-height: 60px;
  max-height: 220px;
  resize: vertical;
}
.chat-input-row textarea:focus {
  border-color: var(--alice-accent);
  box-shadow: 0 0 0 2px rgba(51, 65, 85, 0.15);
}

/* Activity messages */
.chat-activity {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.1rem 0.2rem;
}

/* Approval cards */
.chat-card.approval-card {
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.approval-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--alice-accent);
}

.approval-card-summary {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.approval-card-preview {
  margin-top: 0.45rem;
  margin-bottom: 0;
  white-space: pre-wrap;
  font-size: 0.75rem;
  color: var(--text-main);
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.55rem;
}

.approval-card-actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ═══ File attachment preview (staged before send) ═══ */
.chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-main);
}
.chat-attachment-preview-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.chat-attachment-preview-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-attachment-preview-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}
.chat-attachment-preview-remove:hover { color: var(--danger, #ef4444); }

/* ═══ Attachment thumbnails in message bubbles ═══ */
.chat-attachment-thumb {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
}
.chat-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  background: rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
}
.chat-attachment-file::before {
  content: "";
  display: inline-block;
  width: 12px; height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ═══ Voice recording indicator ═══ */
.btn-app-icon.recording {
  color: #ef4444;
  animation: pulse-recording 1.2s ease-in-out infinite;
}
@keyframes pulse-recording {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══ Drag-and-drop overlay ═══ */
.alice-panel.drag-over {
  outline: 2px dashed var(--alice-accent);
  outline-offset: -4px;
  background: rgba(51, 65, 85, 0.04);
}
