:root {
  --primary-color: #4a6fa5;
  --primary-dark: #3a5985;
  --primary-light: #eef2f9;
  --secondary-color: #6c757d;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --success-color: #28a745;
  --background-color: #f8f9fa;
  --text-color: #333;
  --border-color: #dee2e6;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.app-container {
  max-width: 1200px;
  height: 100vh;
  margin: 0 auto;
  padding: 20px;
}

/* Authentication */
.auth-container {
  max-width: 400px;
  margin: 50px auto;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  font-size: 16px;
  color: var(--secondary-color);
}

.auth-tab.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

.btn.primary {
  background-color: var(--primary-color);
  color: white;
}

.btn.primary:hover {
  background-color: var(--primary-dark);
}

.btn.secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn.danger {
  background-color: var(--danger-color);
  color: white;
}

.btn.warning {
  background-color: var(--warning-color);
  color: black;
}

.btn.small {
  padding: 5px 10px;
  font-size: 14px;
}

.btn.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  background: none;
  color: var(--secondary-color);
}

.btn.icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Main Layout */
.main-container {
  display: flex;
  height: calc(100vh - 40px);
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar {
  width: 300px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

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

.sidebar-actions {
  display: flex;
  gap: 8px;
}

#notionBtn {
  background-color: #ffffff;
  color: #37352f;
  border: 1px solid #e0e0e0;
}

#notionBtn:hover {
  background-color: #f7f6f3;
}

.chat-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px;
}

.chat-item {
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-item:hover {
  background-color: var(--primary-light);
}

.chat-item.active {
  background-color: var(--primary-light);
  font-weight: 500;
}

/* Owner chat styling */
.chat-item.owner {
  border-left: 3px solid var(--primary-color);
  font-weight: 500;
}

.user-info {
  padding: 15px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

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

.chat-actions {
  display: flex;
  gap: 10px;
}

.messages-container {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  background-color: var(--background-color);
  display: flex;
  flex-direction: column; /* Consistent across all devices - oldest at top */
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--secondary-color);
  text-align: center;
  padding: 20px;
}

.message {
  max-width: 70%;
  margin-bottom: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  position: relative;
  transition: background-color 0.2s;
}

.message:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.message.outgoing {
  align-self: flex-end;
  background-color: var(--primary-light);
}

.message.incoming {
  align-self: flex-start;
  background-color: white;
  border: 1px solid var(--border-color);
}

/* Read marked message styling */
.message.read-marked {
  /* Subtle visual cue that message has been marked as read */
  border-left-color: var(--success-color);
}

.message.poke {
  align-self: center;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-style: italic;
  padding: 10px 15px;
  max-width: 90%;
  border-radius: 20px;
  animation: pokeAnimation 0.5s ease-in-out;
}

@keyframes pokeAnimation {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.poke-message {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poke-icon {
  color: var(--warning-color);
  animation: pokeIconAnimation 1s ease-in-out infinite;
}

@keyframes pokeIconAnimation {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.message.system {
  align-self: center;
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--secondary-color);
  font-style: italic;
  padding: 6px 12px;
  max-width: 90%;
  border-radius: 16px;
  text-align: center;
}

/* Blocked message styling */
.message.blocked {
  align-self: center;
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--secondary-color);
  font-style: italic;
  padding: 6px 12px;
  max-width: 60%;
  border-radius: 16px;
  opacity: 0.7;
}

.blocked-message-content {
  font-size: 12px;
  text-align: center;
}

.message-sender {
  font-weight: 500;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.message-content {
  word-break: break-word;
}

.message-timestamp {
  font-size: 12px;
  color: var(--secondary-color);
  text-align: right;
  margin-top: 5px;
}

.message-input-container {
  padding: 15px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}

.message-input-container input {
  flex-grow: 1;
}

.message-actions {
  display: flex;
  gap: 10px;
}

/* Pinned Messages */
.pinned-messages-container {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--primary-light);
  padding: 10px 15px;
  margin-bottom: 0;
  overflow: hidden;
}

.pinned-messages-container.hidden {
  display: none;
}

.pinned-header {
  font-weight: 500;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.pinned-header .material-icons {
  margin-right: 5px;
  font-size: 16px;
}

.pinned-messages-container .message {
  max-width: 100%;
  background-color: white;
  border-left: 3px solid var(--warning-color);
  margin-bottom: 0;
  position: relative;
  padding-right: 30px; /* Space for the unpin button */
}

.message.pinned {
  border-left: 3px solid var(--warning-color);
}

.pin-icon {
  font-size: 14px;
  vertical-align: middle;
  color: var(--warning-color);
  margin-left: 5px;
}

.unpin-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: none;
  border: none;
  color: var(--secondary-color);
  cursor: pointer;
  padding: 2px;
}

.unpin-btn:hover {
  color: var(--danger-color);
}

.unpin-btn .material-icons {
  font-size: 16px;
}

.message-actions-menu {
  position: absolute;
  top: 5px;
  right: 5px;
  display: none;
  background-color: white;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.message:hover .message-actions-menu {
  display: flex;
}

.message-actions-menu button {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--secondary-color);
  border-radius: 4px;
}

.message-actions-menu button:hover {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

.message-actions-menu .edit-btn,
.message-actions-menu .delete-btn,
.message-actions-menu .pin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-actions-menu .edit-btn:hover {
  color: var(--primary-color);
}

.message-actions-menu .delete-btn:hover {
  color: var(--danger-color);
}

.message-actions-menu .pin-btn:hover {
  color: var(--warning-color);
}

.message-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 11px;
  color: var(--secondary-color);
  margin-top: 4px;
}

.message-edited-indicator {
  margin-right: 5px;
  font-style: italic;
}

.context-menu {
  background-color: white;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  border-radius: 4px;
  padding: 5px 0;
  z-index: 1000;
  min-width: 150px;
}

.context-menu-item {
  padding: 8px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.context-menu-item:hover {
  background-color: var(--primary-light);
}

.context-menu-item .material-icons {
  margin-right: 8px;
  font-size: 18px;
}

.context-menu-item[data-action="edit"]:hover {
  color: var(--primary-color);
}

.context-menu-item[data-action="delete"]:hover {
  color: var(--danger-color);
}

.context-menu-item[data-action="pin"]:hover {
  color: var(--warning-color);
}

.context-menu-item[data-action="changeDisplayName"]:hover {
  color: var(--primary-color);
}

.context-menu-item[data-action="blockUser"]:hover {
  color: var(--danger-color);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  width: 400px;
  max-width: 90%;
}

.modal-content.wide {
  width: 600px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

/* Tabs */
.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  font-size: 16px;
  color: var(--secondary-color);
}

.tab.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

.tab-pane.hidden {
  display: none;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 4px;
  box-shadow: var(--shadow);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(20px);
  min-width: 250px;
  max-width: 400px;
  display: flex;
  align-items: center;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background-color: var(--success-color);
}

.toast.error {
  background-color: var(--danger-color);
}

.toast.info {
  background-color: var(--primary-color);
}

.toast.warning {
  background-color: var(--warning-color);
  color: black;
}

.toast-icon {
  margin-right: 10px;
}

/* Role badges */
.sender-roles {
  display: inline-flex;
  gap: 5px;
  margin-left: 8px;
  vertical-align: middle;
}

.role-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background-color: var(--primary-color);
  color: white;
  font-weight: normal;
  display: inline-block;
}

.message.outgoing .role-badge {
  background-color: var(--primary-dark);
}

.message.incoming .role-badge {
  background-color: var(--secondary-color);
}

/* Invite Link Styles */
.invite-link-container {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
}

.invite-link-container input {
  flex-grow: 1;
  padding: 12px;
  font-size: 14px;
  border: 1px solid var(--primary-color);
  background-color: var(--primary-light);
  border-radius: 4px;
  color: var(--primary-dark);
  font-family: monospace;
}

.note {
  font-size: 12px;
  color: var(--secondary-color);
  margin-top: 5px;
  font-style: italic;
}

/* Invite Banner */
.invite-banner {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
}

/* Enhanced Invite Link Styles */
.invite-link-instructions {
  margin-bottom: 15px;
  color: var(--text-color);
}

.invite-link-sharing {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.btn-share {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  justify-content: center;
}

.invite-banner {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 111, 165, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(74, 111, 165, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 111, 165, 0);
  }
}

.welcome-banner {
  background-color: var(--success-color);
  color: white;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom display name styling */
.custom-name-indicator {
  font-size: 10px;
  color: var(--primary-color);
  margin-left: 4px;
  vertical-align: super;
  cursor: help;
}

/* Blocked Users List */
.blocked-users-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.blocked-user-item {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blocked-user-item:last-child {
  border-bottom: none;
}

.blocked-username {
  font-weight: 500;
}

.unblock-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 4px;
}

.unblock-btn:hover {
  background-color: var(--primary-light);
}

.unblock-btn .material-icons {
  font-size: 16px;
}

.loading,
.error-state {
  padding: 20px;
  text-align: center;
  color: var(--secondary-color);
}

.error-state {
  color: var(--danger-color);
}

/* Error Modal Styling */
.error-container {
  display: flex;
  align-items: center;
  margin: 20px 0;
  padding: 15px;
  background-color: rgba(220, 53, 69, 0.1);
  border-radius: 4px;
}

.error-icon {
  margin-right: 15px;
  color: var(--danger-color);
}

.error-icon .material-icons {
  font-size: 32px;
}

#errorModalMessage {
  flex: 1;
  color: var(--text-color);
  line-height: 1.5;
}

/* Form validation styles */
input:invalid {
  border-color: var(--danger-color);
}

.validation-message {
  color: var(--danger-color);
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.form-group.error .validation-message {
  display: block;
}

.form-group.error input {
  border-color: var(--danger-color);
}

/* Read Receipt Styles */
.message-read-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  font-size: 0.7rem;
  color: #999;
  cursor: pointer;
}

.message-read-status:hover {
  color: #666;
}

.read-indicator {
  font-size: 1rem;
}

.read-indicator.sent {
  color: #999;
}

.read-indicator.delivered {
  color: #999;
}

.read-indicator.read {
  color: #4caf50;
}

.read-status-text {
  font-size: 0.7rem;
}

/* Read Receipts Modal */
.read-receipts-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timestamp-info {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.receipt-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.receipt-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.receipt-list li:last-child {
  border-bottom: none;
}

.receipt-list .username {
  font-weight: 500;
}

.receipt-list .timestamp {
  color: #999;
  font-size: 0.8rem;
}

/* Deleted Chat Effect */
.deleted-chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
}

.deleted-chat-message {
  background-color: white;
  border-radius: 8px;
  padding: 30px;
  width: 90%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.4s ease-out;
}

.deleted-chat-message .material-icons {
  font-size: 48px;
  color: var(--danger-color);
  margin-bottom: 15px;
}

.deleted-chat-message h3 {
  color: var(--danger-color);
  margin-bottom: 10px;
}

.deleted-chat-message p {
  margin-bottom: 20px;
  color: var(--text-color);
}

.deleted-chat-message .btn {
  min-width: 100px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Delete Message Animation */
@keyframes messageDeleteEffect {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  20% {
    background-color: rgba(220, 53, 69, 0.1);
  }
  60% {
    opacity: 0.5;
    transform: scale(0.95) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
}

.message.deleting {
  animation: messageDeleteEffect 0.6s ease-in forwards;
  pointer-events: none;
  position: relative;
  overflow: hidden;
}

.message.deleting::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(220, 53, 69, 0.1) 100%
  );
  z-index: 1;
}

/* Delete Flash Effect */
@keyframes deleteFlash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
  50% {
    box-shadow: 0 0 10px 2px rgba(220, 53, 69, 0.3);
  }
}

/* Enhanced view for blocked users */
.blocked-users-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 15px;
}

.blocked-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-color);
}

.blocked-user-item:last-child {
  border-bottom: none;
}

.blocked-username {
  font-weight: 500;
}

.unblock-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.unblock-btn:hover {
  background-color: var(--primary-light);
}

/* Encrypted message notice styling */
.encrypted-message-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warning-color);
  font-style: italic;
  background-color: rgba(255, 193, 7, 0.1);
  padding: 8px;
  border-radius: 4px;
  margin: 5px 0;
}

.encrypted-message-notice .material-icons {
  font-size: 16px;
}

/* Time Clocks */
.time-clocks {
  background-color: var(--primary-light);
  padding: 8px;
  border-radius: 4px;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
}

.time-clock {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.time-clock:last-child {
  margin-bottom: 0;
}

.time-label {
  font-weight: 500;
  color: var(--primary-dark);
}

.clock-time {
  font-family: monospace;
  color: var(--text-color);
}

/* Load More Button Styles */
.load-more-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin: 10px 0;
  text-align: center;
  background-color: var(--primary-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.load-more-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 5px;
  vertical-align: middle;
}

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

/* Add these responsive styles at the end of your CSS file */

/* Tablet Styles (768px and below) */
@media screen and (max-width: 768px) {
  .app-container {
    padding: 10px;
    height: 100vh;
    max-width: 100%;
  }

  .main-container {
    height: calc(100vh - 20px);
  }

  .modal-content.wide {
    width: 90%;
  }

  .message {
    max-width: 80%;
  }
}

/* Mobile Styles (576px and below) */
@media screen and (max-width: 576px) {
  .app-container {
    padding: 10px;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 80%;
    max-width: 300px;
    z-index: 1000;
    transition: left 0.3s ease;
    background-color: white;
  }

  .sidebar.visible {
    left: 0;
  }

  .main-container {
    height: calc(100vh - 20px);
  }

  .chat-container {
    width: 100%;
  }

  .messages-container {
    max-height: calc(60vh - 130px);
    /* No flex-direction override needed - keep consistent with desktop */
  }

  .message-input-container {
    padding: 10px;
  }

  .message-input-container input {
    font-size: 16px;
  }

  .modal-content {
    width: 90%;
    max-width: 350px;
  }

  .auth-container {
    margin: 20px auto;
    width: 90%;
  }
}

/* Very small screens */
@media screen and (max-width: 360px) {
  .auth-tabs {
    flex-direction: column;
  }

  .message-input-container {
    flex-direction: column;
    gap: 8px;
  }

  .message-actions {
    width: 100%;
    justify-content: space-between;
  }

  .btn {
    padding: 8px 12px;
  }

  .chat-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-actions {
    margin-top: 10px;
    width: 100%;
    justify-content: space-between;
  }
}

/* Fix for iOS Safari viewport height issue */
@supports (-webkit-touch-callout: none) {
  .app-container,
  .main-container {
    height: -webkit-fill-available;
  }
}

/* Hide mobile-only elements on desktop */
.mobile-only {
  display: none;
}

/* Mobile toggle button styles */
.chat-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Add a semi-transparent overlay when sidebar is visible on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.sidebar-overlay.visible {
  display: block;
}

/* Add this to your CSS file */
.message.optimistic {
  opacity: 0.7;
}

.message.failed {
  opacity: 0.5;
  background-color: rgba(255, 0, 0, 0.1);
}
