/* ─── AI REMODELING ASSISTANT ─── */
/* Luxury/industrial chat interface with session sidebar */

.assistant-layout {
  display: flex;
  height: calc(100vh - 65px);
  overflow: hidden;
}

/* ─── SIDEBAR ─── */
.assistant-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
}

.assistant-sidebar.collapsed {
  margin-left: -280px;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.btn-new-chat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--brass);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-new-chat:hover { background: var(--brass-dark); }

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.session-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--fg-light);
  font-size: 0.85rem;
}

.session-item {
  padding: 12px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.session-item:hover { background: var(--bg-alt); }
.session-item.active { background: var(--bg-alt); border-left: 3px solid var(--brass); }

.session-item-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.session-item-meta {
  font-size: 0.72rem;
  color: var(--fg-light);
  display: flex;
  justify-content: space-between;
}

.session-item-actions {
  display: none;
}

.session-item:hover .session-item-actions {
  display: flex;
}

.btn-delete-session {
  background: none;
  border: none;
  color: var(--fg-light);
  cursor: pointer;
  padding: 2px;
  font-size: 0.7rem;
}

.btn-delete-session:hover { color: #e74c3c; }

/* ─── MAIN CHAT ─── */
.assistant-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
}

.btn-toggle-sidebar {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  transition: all 0.15s;
}

.btn-toggle-sidebar:hover {
  background: var(--bg-alt);
  color: var(--fg);
}

.chat-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.2;
}

.chat-subtitle {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

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

.message {
  display: flex;
  gap: 12px;
  max-width: 780px;
  animation: messageIn 0.25s ease;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-assistant {
  align-self: flex-start;
}

.message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  margin-top: 2px;
}

.message-user .message-avatar {
  background: var(--slate);
  border-color: var(--slate);
  color: #fff;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-text {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.65;
}

.message-assistant .message-text {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top-left-radius: 2px;
  color: var(--fg);
}

.message-user .message-text {
  background: var(--slate);
  color: #fff;
  border-top-right-radius: 2px;
}

.message-text p { margin-bottom: 8px; }
.message-text p:last-child { margin-bottom: 0; }
.message-text ul, .message-text ol { margin: 8px 0; padding-left: 20px; }
.message-text li { margin-bottom: 4px; }
.message-text strong { font-weight: 600; }
.message-text code {
  background: rgba(0,0,0,0.06);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.88em;
}

.message-user .message-text code {
  background: rgba(255,255,255,0.15);
}

.message-text h3, .message-text h4 {
  font-family: var(--font-body);
  font-weight: 600;
  margin: 12px 0 6px;
}

.message-text h3 { font-size: 1rem; }
.message-text h4 { font-size: 0.92rem; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brass);
  animation: typingBounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── DISCLAIMER ─── */
.chat-disclaimer {
  padding: 8px 24px;
  font-size: 0.72rem;
  color: var(--fg-light);
  text-align: center;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

/* ─── INPUT AREA ─── */
.chat-input-area {
  padding: 16px 24px 20px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.quick-prompts {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.quick-prompts.hidden { display: none; }

.quick-prompt {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.quick-prompt:hover {
  border-color: var(--brass);
  color: var(--brass-dark);
  background: rgba(201, 169, 110, 0.06);
}

.chat-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--fg);
  background: var(--bg);
  resize: none;
  max-height: 140px;
  line-height: 1.5;
  transition: border-color 0.2s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--brass);
}

.chat-input::placeholder { color: var(--fg-light); }

.btn-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brass);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-send:hover:not(:disabled) { background: var(--brass-dark); }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .assistant-sidebar {
    position: fixed;
    top: 65px;
    left: 0;
    bottom: 0;
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
  }

  .assistant-sidebar.collapsed {
    margin-left: -280px;
  }

  .chat-messages { padding: 16px; }
  .chat-input-area { padding: 12px 16px 16px; }

  .quick-prompts {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .quick-prompts::-webkit-scrollbar { display: none; }
}
