/* ─── Discord Set Styles ─────────────────────────────────────────────────── */

.discord-app {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  color: #dcddde;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Sidebar */
.discord-sidebar {
  width: 220px;
  background: #2b2d31;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(0,0,0,0.2);
}

.sidebar-header {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.channel-category {
  padding: 18px 8px 4px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #949ba4;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 16px;
  margin: 1px 8px;
  border-radius: 4px;
  color: #949ba4;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.1s, color 0.1s;
}

.channel-item:hover,
.channel-item.dp-hovered,
.channel-item.active {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.channel-item.active {
  background: rgba(255,255,255,0.1);
}

.channel-hash {
  font-size: 18px;
  opacity: 0.5;
  font-weight: 300;
}

.sidebar-user {
  margin-top: auto;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #232428;
  border-top: 1px solid rgba(0,0,0,0.2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.user-status {
  font-size: 11px;
  color: #949ba4;
}

/* Main chat area */
.discord-main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #313338;
  min-width: 0;
}

.chat-header {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(0,0,0,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.chat-header-channel {
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header-hash {
  color: #949ba4;
  font-size: 20px;
  font-weight: 300;
}

.chat-header-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  margin: 0 12px;
}

.chat-header-topic {
  color: #949ba4;
  font-size: 13px;
}

/* Messages */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message {
  display: flex;
  gap: 16px;
  padding: 4px 0;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  font-size: 16px;
}

.message-body {
  min-width: 0;
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.message-author {
  font-weight: 600;
  font-size: 14px;
}

.message-timestamp {
  font-size: 11px;
  color: #949ba4;
}

.message-text {
  color: #dcddde;
  line-height: 1.4;
}

/* Message input */
.message-input-area {
  padding: 0 16px 20px;
  flex-shrink: 0;
}

.message-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  background: #383a40;
  border-radius: 8px;
  padding: 11px 4px 11px 16px;
}

.message-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #dcddde;
  font-size: 14px;
  font-family: inherit;
  font-weight: inherit;
  padding: 0;
  margin: 0;
  resize: none;
  line-height: 22px;
  /* The autoResize handler in props/message-input.js sets height to
     scrollHeight. The first line is line-height (22px) tall, multi-line
     grows from there until max-height. */
  height: 22px;
  max-height: 200px;
  overflow-y: hidden;
  box-sizing: content-box;
  display: block;
}

.message-input::placeholder {
  color: #6d6f78;
}

.send-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: #5865f2;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  /* Nudge so the button bottom aligns with the textarea baseline. */
  margin-bottom: -3px;
}

.send-btn:hover,
.send-btn.dp-hovered {
  background: #4752c4;
}

.send-btn.dp-active {
  background: #3c46a8;
  transform: scale(0.95);
}

.send-btn svg {
  width: 18px;
  height: 18px;
}

/* ─── Typing Indicator ───────────────────────────────────────────────────── */

.discord-typing-indicator {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 4px 16px 0;
  font-size: 13px;
  color: #b5bac1;
  flex-shrink: 0;
}

.discord-typing-indicator.open {
  display: flex;
}

.discord-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.discord-typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b5bac1;
  animation: discord-typing-pulse 1.4s ease-in-out infinite;
}

.discord-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.discord-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes discord-typing-pulse {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.discord-typing-text strong {
  color: #fff;
  font-weight: 600;
}

/* ─── Slash Command Autocomplete ─────────────────────────────────────────── */

.discord-slash-autocomplete {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 76px;
  background: #2b2d31;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 8px 0;
  display: none;
  z-index: 5;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.discord-slash-autocomplete.open {
  display: block;
}

.discord-slash-header {
  padding: 4px 16px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #949ba4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
}

.discord-slash-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  font-size: 14px;
  color: #dcddde;
  cursor: pointer;
}

.discord-slash-item.highlighted {
  background: #404249;
  color: #fff;
}

.discord-slash-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #5865f2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.discord-slash-item-name {
  font-weight: 600;
  color: #fff;
}

.discord-slash-item-desc {
  color: #949ba4;
  font-size: 13px;
}

/* ─── Modal Overlay ──────────────────────────────────────────────────────── */

.discord-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.18s ease-out;
  padding: 24px;
}

.discord-modal-overlay.open {
  opacity: 1;
}

.discord-modal {
  background: #313338;
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease-out;
  overflow: hidden;
}

.discord-modal-overlay.open .discord-modal {
  transform: translateY(0) scale(1);
}

.discord-modal-header {
  padding: 16px 20px 4px;
  flex-shrink: 0;
}

.discord-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.discord-modal-body {
  padding: 12px 20px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.discord-modal-field {
  margin-top: 16px;
}

.discord-modal-field:first-child {
  margin-top: 0;
}

.discord-modal-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #b5bac1;
}

.discord-modal-input {
  width: 100%;
  background: #1e1f22;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  color: #dcddde;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  resize: none;
  box-sizing: border-box;
  line-height: 1.4;
}

.discord-modal-input::placeholder {
  color: #6d6f78;
}

textarea.discord-modal-input {
  min-height: 60px;
}

.discord-modal-fileupload {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #1e1f22;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  color: #b5bac1;
  font-size: 13px;
  padding: 14px 12px;
  box-sizing: border-box;
}

.discord-modal-fileupload svg {
  flex-shrink: 0;
  color: #b5bac1;
}

.discord-modal-footer {
  padding: 16px 20px;
  background: #2b2d31;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.discord-modal-btn {
  border: none;
  border-radius: 4px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.discord-modal-btn-cancel {
  background: transparent;
  color: #fff;
}

.discord-modal-btn-cancel:hover,
.discord-modal-btn-cancel.dp-hovered {
  text-decoration: underline;
}

.discord-modal-btn-submit {
  background: #5865f2;
  color: #fff;
}

.discord-modal-btn-submit:hover,
.discord-modal-btn-submit.dp-hovered {
  background: #4752c4;
}

.discord-modal-btn-submit.dp-active {
  background: #3c46a8;
  transform: scale(0.97);
}

/* ─── Bot Messages: markdown blocks, components, ephemeral, APP tag ─────── */

.message-text-block {
  color: #dcddde;
  line-height: 1.4;
}

.message-text-block + .message-text-block {
  margin-top: 6px;
}

.message-quote {
  position: relative;
  padding: 2px 0 2px 12px;
  margin: 4px 0;
  color: #dcddde;
  line-height: 1.4;
}

.message-quote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 4px;
  background: #4e5058;
}

.message-hr {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0 4px;
}

.message-link {
  color: #00a8fc;
  text-decoration: none;
}

.message-link:hover {
  text-decoration: underline;
}

.message-components {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.message-component-button {
  background: #4e5058;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.message-component-button-primary {
  background: #5865f2;
}

.message-component-button-link {
  background: #4e5058;
}

.message-bot-tag {
  background: #5865f2;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* Ephemeral message ("Only you can see this") */

.message.ephemeral .message-author::after {
  content: " (only you can see this)";
  color: #6d6f78;
  font-weight: 400;
  font-style: italic;
  font-size: 11px;
  margin-left: 4px;
}

.message.ephemeral {
  opacity: 0.95;
}

/* Pulse for incoming bot messages */

@keyframes discord-message-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.incoming {
  animation: discord-message-in 0.25s ease-out;
}
