/* Chat styles - messages, input, typing */

.chat-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
  overflow: hidden;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 48px 0 120px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.message {
  animation: fadeIn 0.2s ease;
}

.message-label {
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 8px;
}

.message-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #e0e0e0;
}

.message.user .message-text {
  color: #888;
}

.message.bot .message-text {
  background: #141414;
  padding: 16px 20px;
  border-radius: 4px;
  border-left: 2px solid #333;
}

.message.bot .message-text .list-item {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid #222;
}

.message.bot .message-text .list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.message.bot .message-text .list-item:first-child {
  padding-top: 0;
}

/* Message images */
.message-image-wrapper {
  margin-bottom: 24px;
  border: 1px solid #222;
  border-radius: 4px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  transition: border-color 0.15s;
}

.message-image-wrapper:hover {
  border-color: #444;
}

.message-image {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.message-image:hover {
  opacity: 1;
}

.message-image-meta {
  padding: 12px 16px;
  border-top: 1px solid #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.message-image-category {
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #555;
  background: #1a1a1a;
  padding: 4px 8px;
  border-radius: 2px;
}

.message-image-caption {
  font-size: 0.75rem;
  color: #666;
}

/* Typing indicator */
.typing-indicator {
  display: inline;
}

.typing-indicator::after {
  content: '▊';
  animation: blink 1s infinite;
}

/* Input container */
.input-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0a0a0a;
  padding: 16px 32px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid #222;
  z-index: 100;
}

.input-row {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #e0e0e0;
  resize: none;
  min-height: 24px;
  max-height: 200px;
}

textarea::placeholder {
  color: #333;
}

.send-button {
  background: transparent;
  border: 1px solid #333;
  color: #666;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.send-button:hover {
  border-color: #e0e0e0;
  color: #e0e0e0;
}

.send-button:disabled {
  border-color: #222;
  color: #333;
  cursor: not-allowed;
}

/* Welcome screen */
.welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-text {
  font-size: 0.875rem;
  color: #333;
  letter-spacing: 0.05em;
}

/* Custom scrollbar */
.messages::-webkit-scrollbar {
  width: 4px;
}

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: #222;
}

/* Admin mode indicator */
#adminIndicator {
  display: none;
  align-items: center;
  gap: 8px;
  background: #2a4a2a;
  color: #6f6;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  margin-left: auto;
  margin-right: 12px;
}

#adminIndicator button {
  background: none;
  border: 1px solid #6f6;
  color: #6f6;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.7rem;
  font-family: inherit;
}

#adminIndicator button:hover {
  background: #6f6;
  color: #1a1a1a;
}

/* System messages */
.message.system .message-text {
  background: #1a2a1a;
  border: 1px solid #2a4a2a;
  color: #6a6;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  text-align: center;
}

/* Responsive */
@media (max-width: 640px) {
  .chat-container {
    padding-left: 20px;
    padding-right: 20px;
  }
  .input-container {
    padding: 12px 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  #adminIndicator {
    font-size: 0.65rem;
    padding: 3px 8px;
  }
}
