/* Chat Page Styles */
body.vx-chat-page {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  background-color: #2a333b;
  color: #ffffff;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('/images/hero-1024.jpg') center/cover no-repeat fixed;
  padding: 0;
  margin: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

body.vx-chat-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(42, 51, 59, 0.7);
  pointer-events: none;
}

.vx-chat-container {
  padding: 8px;
  width: 100vw;
  max-width: 100vw;
  height: var(--vvh, 100vh);
  max-height: var(--vvh, 100vh);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Remove padding on mobile */
@media (max-width: 768px) {
  .vx-chat-container {
    padding: 0;
  }

  /* Override the body.vx-chat-page .vx-container rule on mobile */
  body.vx-chat-page .vx-container.vx-chat-container {
    padding: 0;
  }
}

.vx-chat-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.vx-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vx-chat-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.vx-hub-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 16px;
}

.vx-hub-label {
  font-size: 14px;
  color: #e5e7eb;
  font-weight: 500;
}

.vx-hub-select {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vx-hub-select:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.vx-hub-select:focus {
  outline: none;
  border-color: #1b74b9;
}

.vx-chat-user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: #e5e7eb;
}

.vx-connection-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.vx-connected {
  background-color: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.vx-disconnected {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.vx-chat-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0; /* Important for flex children with overflow */
}

.vx-channels-panel {
  width: 240px;
  background-color: rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.vx-channels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vx-channels-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.vx-refresh-btn {
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.3s ease;
}

.vx-refresh-btn:hover {
  transform: rotate(180deg);
}

.vx-channel-list {
  flex: 1;
  list-style: none;
  padding: 8px;
  overflow-y: auto;
  margin: 0;
  min-height: 0; /* Important for scrolling in flex containers */
}

.vx-channel-item {
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #e5e7eb;
  transition: all 0.2s ease;
}

.vx-channel-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.vx-channel-item.vx-active {
  background-color: #1b74b9;
  color: #ffffff;
}

.vx-channel-item.vx-notifications-channel {
  font-style: italic;
  opacity: 0.9;
}

.vx-channel-item.vx-notifications-channel:hover {
  opacity: 1;
}

.vx-new-channel {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile sidebar sections */
.vx-mobile-header {
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vx-mobile-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  text-align: center;
}

.vx-mobile-members {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
  max-height: 200px; /* Limit height of members list */
}

.vx-mobile-members h4 {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
}

.vx-mobile-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-top: auto;
}

.vx-mobile-footer .vx-secondary-button {
  flex: 1;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.vx-channel-input {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
}

.vx-channel-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.vx-channel-input:focus {
  outline: none;
  border-color: #1b74b9;
  background-color: rgba(255, 255, 255, 0.15);
}

.vx-channel-create-btn {
  width: 100%;
  padding: 8px 16px;
  background-color: #1b74b9;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.vx-channel-create-btn:hover {
  background-color: #1560a0;
}

.vx-chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevent flex items from overflowing */
  overflow: hidden;
}

.vx-messages-container {
  flex: 1;
  padding: 16px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0; /* Important for proper scrolling in flex containers */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  overscroll-behavior: contain;
}

.vx-message-wrapper {
  display: flex;
  width: 100%;
  margin-bottom: 8px;
}

.vx-message-wrapper.vx-system {
  margin-bottom: 0;
}

.vx-message-wrapper.vx-sent {
  justify-content: flex-end;
}

.vx-message-wrapper.vx-sent-other {
  justify-content: flex-end;
}

.vx-message-wrapper.vx-received {
  justify-content: flex-start;
}

.vx-message-wrapper.vx-system {
  justify-content: center;
}

.vx-message {
  width: 90%;
  padding: 12px 16px;
  border-radius: 18px;
  word-wrap: break-word;
  word-break: break-word;
  text-align: left;
  position: relative;
}

.vx-sent .vx-message {
  background-color: rgba(27, 116, 185, 0.8);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.vx-sent-other .vx-message {
  background-color: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
  border-bottom-right-radius: 4px;
}

.vx-received .vx-message {
  background-color: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
  border-bottom-left-radius: 4px;
}

.vx-system-message {
  color: #9ca3af;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  border-radius: 12px;
  width: auto;
  max-width: 600px;
  margin: 0 auto;
}

/* Help command styling */
.vx-system-help {
  text-align: left;
}

.vx-help-title {
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
  font-size: 16px;
}

.vx-help-commands {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vx-help-command {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.vx-help-command-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vx-help-command-name {
  font-family: monospace;
  color: #60a5fa;
  font-size: 14px;
  font-weight: 600;
}

.vx-help-command-desc {
  color: #e5e7eb;
  font-size: 13px;
}

.vx-help-command-usage {
  color: #9ca3af;
  font-size: 12px;
  font-style: italic;
}

.vx-help-command-send {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fbbf24;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.vx-help-command-send:hover {
  background: rgba(251, 191, 36, 0.3);
  border-color: #fbbf24;
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.vx-help-command-populate {
  background: rgba(96, 165, 250, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.5);
  color: #60a5fa;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.vx-help-command-populate:hover {
  background: rgba(96, 165, 250, 0.3);
  border-color: #60a5fa;
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

/* Notification sent styling */
.vx-system-notification {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vx-notification-icon {
  font-size: 24px;
}

.vx-notification-content {
  flex: 1;
  text-align: left;
}

.vx-notification-title {
  color: #60a5fa;
  font-weight: 600;
  margin-bottom: 4px;
}

.vx-notification-message {
  color: #e5e7eb;
  font-style: italic;
}

/* History cleared styling */
.vx-system-cleared {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vx-cleared-icon {
  font-size: 24px;
}

.vx-cleared-content {
  color: #e5e7eb;
}

/* Error styling */
.vx-system-error {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.vx-error-icon {
  font-size: 24px;
}

.vx-error-content {
  color: #fca5a5;
}

/* Message deleted styling */
.vx-system-deleted {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9ca3af;
}

.vx-deleted-icon {
  font-size: 20px;
  opacity: 0.7;
}

.vx-deleted-content {
  color: #9ca3af;
  font-style: italic;
}

/* Message updated styling */
.vx-system-updated {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9ca3af;
}

.vx-updated-icon {
  font-size: 20px;
  opacity: 0.7;
}

.vx-updated-content {
  color: #9ca3af;
  font-style: italic;
}

/* Fallback system content */
.vx-system-content {
  text-align: center;
  color: #9ca3af;
  font-style: italic;
}

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

.vx-sent .vx-message-header {
  justify-content: flex-end;
}

.vx-sent-other .vx-message-header {
  justify-content: flex-end;
}

.vx-received .vx-message-header {
  justify-content: flex-start;
}

.vx-message-username {
  font-weight: 600;
  font-size: 13px;
  display: inline-block;
}

.vx-sent .vx-message-username {
  color: rgba(255, 255, 255, 0.8);
}

.vx-sent-other .vx-message-username {
  color: #60a5fa;
}

.vx-received .vx-message-username {
  color: #60a5fa;
}

.vx-message-time {
  font-size: 11px;
  opacity: 0.7;
}

.vx-message-content {
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap; /* Preserve whitespace and line breaks */
  text-align: left; /* Always left-align message content */
}

.vx-message-link {
  color: #60a5fa;
  text-decoration: underline;
  text-decoration-color: rgba(96, 165, 250, 0.5);
  transition: all 0.2s ease;
}

.vx-message-link:hover {
  color: #93bbfc;
  text-decoration-color: rgba(147, 187, 252, 0.8);
}

/* Link colors for sent messages */
.vx-sent .vx-message-link {
  color: #93bbfc;
  text-decoration-color: rgba(147, 187, 252, 0.5);
}

.vx-sent .vx-message-link:hover {
  color: #bdd7fd;
  text-decoration-color: rgba(189, 215, 253, 0.8);
}

.vx-system .vx-message-content {
  line-height: 1;
}

/* Code block styling */
.vx-code-block-wrapper {
  position: relative;
  margin: 8px 0;
}

.vx-code-block {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre;
}

.vx-code-block code {
  color: inherit;
  background: none;
  padding: 0;
}

/* Code block in sent messages */
.vx-sent .vx-code-block {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Language label styling */
.vx-code-language {
  position: absolute;
  top: 8px;
  right: 44px; /* Position to the left of copy button */
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  line-height: 28px; /* Match button height for vertical alignment */
  padding: 0 8px;
  z-index: 1;
}

/* Copy button styling */
.vx-code-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(96, 165, 250, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.5);
  color: #60a5fa;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1;
}

.vx-code-copy-button:hover {
  background: rgba(96, 165, 250, 0.3);
  border-color: #60a5fa;
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

/* Inline code styling */
.vx-inline-code {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  white-space: nowrap;
}

/* Inline code in sent messages */
.vx-sent .vx-inline-code {
  background-color: rgba(0, 0, 0, 0.2);
}

.vx-chat-input-container {
  display: flex;
  gap: 12px;
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0; /* Prevent shrinking when keyboard appears */
  position: relative;
  z-index: 10;
  align-items: flex-end; /* Align buttons to bottom when textarea grows */
}

.vx-help-button {
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #60a5fa;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
}

.vx-help-button:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #60a5fa;
}

.vx-help-button:disabled {
  color: #6b7280;
  cursor: not-allowed;
  opacity: 0.7;
}

.vx-chat-input {
  flex: 1;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 16px; /* Prevent zoom on iOS when focusing input */
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  overflow-y: hidden; /* Hide scrollbar initially */
  min-height: 44px;
  max-height: 120px;
  transition: height 0.1s ease;
  box-sizing: border-box;
}

/* Only show scrollbar when needed at max height */
.vx-chat-input:focus {
  overflow-y: auto;
}

.vx-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.vx-chat-input:focus {
  outline: none;
  border-color: #1b74b9;
  background-color: rgba(255, 255, 255, 0.15);
}

/* Monospace style when typing code */
.vx-chat-input-code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Attachment styles */
.vx-message-attachments {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vx-attachment-wrapper {
  position: relative;
}

.vx-attachment-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.vx-attachment-image:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Attachment delete button */
.vx-attachment-delete {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 4px 8px;
  background: rgba(239, 68, 68, 0.8);
  border: 1px solid rgba(239, 68, 68, 0.9);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10;
}

.vx-attachment-wrapper:hover .vx-attachment-delete {
  opacity: 1;
  visibility: visible;
}

.vx-attachment-delete:hover {
  background: rgba(239, 68, 68, 1);
  border-color: rgba(239, 68, 68, 1);
  color: #ffffff;
}

/* Pending attachments */
.vx-pending-attachments {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
}

.vx-pending-attachment {
  position: relative;
  flex-shrink: 0;
}

.vx-pending-attachment img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.vx-remove-attachment {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.vx-remove-attachment:hover {
  background: rgba(239, 68, 68, 1);
  transform: scale(1.1);
}

/* Attach button */
.vx-attach-button {
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #60a5fa;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
}

.vx-attach-button:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #60a5fa;
}

.vx-attach-button:disabled {
  color: #6b7280;
  cursor: not-allowed;
  opacity: 0.7;
}

.vx-send-button {
  padding: 12px 24px;
  background-color: #1b74b9;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.vx-send-button:hover:not(:disabled) {
  background-color: #1560a0;
}

.vx-send-button:disabled {
  background-color: #6b7280;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Update button (check icon) */
.vx-update-button {
  background-color: #10b981;
  padding: 10px 16px;
  font-size: 18px;
}

.vx-update-button:hover:not(:disabled) {
  background-color: #059669;
}

.vx-update-button:disabled {
  background-color: rgba(16, 185, 129, 0.3);
}

/* Cancel button (X icon) */
.vx-cancel-button {
  background-color: #ef4444;
  padding: 10px 16px;
  font-size: 18px;
  margin-left: 8px;
}

.vx-cancel-button:hover {
  background-color: #dc2626;
}

.vx-members-panel {
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vx-members-panel h4 {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
}

.vx-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vx-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #e5e7eb;
}

.vx-participant-id {
  font-size: 11px;
  color: #6b7280;
  font-family: monospace;
}

.vx-chat-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vx-chat-footer .vx-secondary-button {
  width: auto;
  padding: 8px 20px;
  font-size: 14px;
}

.vx-chat-footer .vx-footer-link {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.vx-chat-footer .vx-footer-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Override vx-container for chat page */
body.vx-chat-page .vx-container {
  padding: 8px;
  width: 100vw;
  max-width: 100vw;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Auth containers should use same sizing as main page */
body.vx-chat-page .vx-container.vx-auth-container {
  width: 100%;
  max-width: 500px;
  padding: 20px;
  margin: 0 auto;
}

.vx-logo {
  width: 360px;
  height: auto;
  margin-bottom: -60px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  position: relative;
  z-index: 2;
}

.vx-auth-card {
  width: 100%;
  padding: 80px 32px 32px 32px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  position: relative;
}

.vx-welcome-section {
  margin-bottom: 24px;
}

.vx-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #ffffff;
}

.vx-description {
  font-size: 16px;
  color: #e5e7eb;
  line-height: 1.5;
}

.vx-error-message {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.vx-button-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.vx-primary-button {
  border: none;
  background-color: #1b74b9;
  color: #ffffff;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  border-radius: 8px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.vx-primary-button:hover:not(:disabled) {
  background-color: #1560a0;
}

.vx-secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: transparent;
  color: #ffffff;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  border-radius: 8px;
  width: 100%;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.vx-secondary-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.vx-auth-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  flex: 1;
}

.vx-auth-text {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
}

.vx-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: vxSpin 1s linear infinite;
}

@keyframes vxSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.vx-fade-in {
  opacity: 0;
  animation: vxFadeIn 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Mobile menu toggle - hidden by default */
.vx-mobile-menu-toggle {
  display: none;
}

/* Visibility helpers */
.vx-desktop-only {
  display: block;
}

.vx-mobile-only {
  display: none;
}

.vx-mobile-menu-button {
  display: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1000;
}

.vx-mobile-menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: #ffffff;
  margin: 4px 0;
  transition: all 0.3s ease;
}

/* Responsive design for chat */
@media (max-width: 768px) {
  body.vx-chat-page {
    background-size: cover;
    overscroll-behavior: none;
  }

  .vx-mobile-menu-button {
    display: block;
  }

  .vx-desktop-only {
    display: none !important;
  }

  .vx-mobile-only {
    display: block !important;
  }

  .vx-channels-panel {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
  }

  .vx-mobile-menu-toggle:checked ~ .vx-chat-main .vx-channels-panel {
    transform: translateX(0);
  }

  .vx-mobile-menu-toggle:checked ~ .vx-chat-header .vx-mobile-menu-button span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .vx-mobile-menu-toggle:checked ~ .vx-chat-header .vx-mobile-menu-button span:nth-child(2) {
    opacity: 0;
  }

  .vx-mobile-menu-toggle:checked ~ .vx-chat-header .vx-mobile-menu-button span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .vx-chat-header {
    padding: 16px;
  }

  .vx-chat-user-info {
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
  }

  .vx-hub-selector {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 8px;
  }

  .vx-chat-container {
    padding: 0;
  }

  .vx-messages-container {
    padding: 12px 16px;
  }

  .vx-chat-input-container {
    padding: 12px;
    gap: 8px;
  }

  /* Handle virtual keyboard on mobile */
  .vx-chat-container {
    padding: 0;
  }

  .vx-chat-wrapper {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .vx-chat-content {
    min-height: 0;
    flex: 1;
    overflow: hidden;
  }

  .vx-messages-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* Toast Notifications */
.vx-toast-container {
  position: fixed;
  top: 90px; /* Position below the header (header is ~70px with padding) */
  right: 20px;
  z-index: 500; /* Below mobile menu z-index but above content */
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
}

.vx-toast {
  background-color: rgba(27, 116, 185, 0.95);
  color: #ffffff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: start;
  min-width: 300px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.vx-toast-content {
  flex: 1;
  margin-right: 12px;
}

.vx-toast-channel {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.vx-toast-message {
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.vx-toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.vx-toast-close:hover {
  color: #ffffff;
}

/* Toast animation */
.vx-toast-slide-in {
  animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .vx-container {
    padding: 4px;
  }

  .vx-auth-card {
    padding: 80px 8px 32px 8px;
  }

  body.vx-chat-page {
    align-items: start;
  }

  /* Auth containers on mobile */
  body.vx-chat-page .vx-container.vx-auth-container {
    padding: 4px;
  }

  .vx-title {
    font-size: 20px;
  }

  .vx-description {
    font-size: 14px;
  }

  .vx-chat-wrapper {
    border-radius: 0;
  }

  /* Toast adjustments for mobile */
  .vx-toast-container {
    top: 70px; /* Adjusted for smaller header on mobile */
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .vx-toast {
    min-width: auto;
  }
}

/* Message delete button */
.vx-message-delete {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 4px 8px;
  background: rgba(239, 68, 68, 0.8);
  border: 1px solid rgba(239, 68, 68, 0.9);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10;
}

.vx-message-wrapper:hover .vx-message-delete {
  opacity: 1;
  visibility: visible;
}

.vx-message-delete:hover {
  background: rgba(239, 68, 68, 1);
  border-color: rgba(239, 68, 68, 1);
  color: #ffffff;
}

/* Don't show delete button on system messages */
.vx-message-wrapper.vx-system .vx-message-delete {
  display: none;
}

/* Pending delete state */
.vx-message-wrapper.vx-pending-delete .vx-message {
  opacity: 0.5;
  filter: grayscale(100%);
  transition:
    opacity 0.2s ease,
    filter 0.2s ease;
}

.vx-message-wrapper.vx-pending-delete .vx-message-delete {
  opacity: 0.3;
  cursor: not-allowed;
}

.vx-message-wrapper.vx-pending-delete .vx-message-content {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Edit button styles */
.vx-message-edit {
  position: absolute;
  top: -8px;
  right: 28px; /* Space for delete button */
  padding: 4px 8px;
  background: rgba(37, 99, 235, 0.8);
  border: 1px solid rgba(37, 99, 235, 0.9);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10;
}

.vx-message-wrapper:hover .vx-message-edit {
  opacity: 1;
  visibility: visible;
}

.vx-message-edit:hover {
  background: rgba(37, 99, 235, 1);
  border-color: rgba(37, 99, 235, 1);
  color: #ffffff;
}

/* Don't show edit button on system messages */
.vx-message-wrapper.vx-system .vx-message-edit {
  display: none;
}

/* Editing state */
.vx-message-wrapper.vx-editing .vx-message {
  outline: 3px solid rgba(37, 99, 235, 0.8);
  outline-offset: 2px;
  border-radius: 0.5rem;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

/* Image Modal Styles */
.vx-image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

.vx-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
}

.vx-modal-close {
  position: absolute;
  top: -40px;
  right: -40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vx-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.vx-modal-image {
  max-width: 100%;
  max-height: calc(95vh - 80px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.vx-modal-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 25px;
  backdrop-filter: blur(10px);
}

.vx-modal-prev,
.vx-modal-next {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vx-modal-prev:hover:not(:disabled),
.vx-modal-next:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.vx-modal-prev:disabled,
.vx-modal-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.vx-modal-counter {
  color: white;
  font-size: 0.9rem;
  min-width: 60px;
  text-align: center;
}

/* Make pending attachment images clickable */
.vx-pending-attachment img {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.vx-pending-attachment img:hover {
  transform: scale(1.05);
}

/* Mobile adjustments for modal */
@media (max-width: 768px) {
  .vx-modal-close {
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .vx-modal-image {
    max-height: calc(100vh - 120px);
  }

  .vx-modal-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* System message styles for admin commands */
.vx-help-command-actions {
  display: flex;
  gap: 4px;
}

.vx-system-users {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

.vx-users-title {
  font-weight: bold;
  color: #8b5cf6;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vx-users-icon {
  font-size: 1.2em;
}

.vx-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vx-user-item {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 8px;
}

.vx-user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.vx-user-name {
  font-weight: 500;
  color: #fff;
}

.vx-admin-badge {
  background: #f59e0b;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: bold;
  margin-left: 8px;
}

.vx-user-id {
  font-family: monospace;
  font-size: 0.85em;
  color: #888;
}

.vx-user-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9em;
  color: #aaa;
}

.vx-user-email,
.vx-user-auth,
.vx-user-created,
.vx-user-login {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vx-system-list {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}

.vx-list-title {
  font-weight: bold;
  color: #3b82f6;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vx-list-icon {
  font-size: 1.2em;
}

.vx-list-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vx-list-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

.vx-list-item.vx-pattern {
  color: #fbbf24;
}

.vx-list-empty {
  color: #888;
  font-style: italic;
  padding: 8px;
}

.vx-system-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vx-success-icon {
  font-size: 1.2em;
}

.vx-online-badge {
  background: #22c55e;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 6px;
}

.vx-channel-admin-badge {
  background: #8b5cf6;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 6px;
}
