/* Added comprehensive CSS styles for the chat application */
:root {
  --primary-color: #ec4899;
  --primary-hover: #db2777;
  --secondary-color: #fdf2f8;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #f3e8ff;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --background: #ffffff;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, #ec4899 0%, #be185d 50%, #9d174d 100%);
  --gradient-secondary: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  --gradient-accent: linear-gradient(135deg, #f9a8d4 0%, #ec4899 100%);
}

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

body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}
.app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-header {
  background: var(--gradient-primary);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.clinic-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.tagline {
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logout-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.2);
}

.logout-link:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.sheets-link-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.2s;
  font-size: 0.875rem;
  margin-right: 1rem;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.2);
}

.sheets-link-nav:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.sheets-icon-nav {
  flex-shrink: 0;
  color: #0f9d58; /* Google Sheets green */
}
.logout-icon {
  flex-shrink: 0;
}

.mobile-back-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.mobile-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.user-sidebar {
  width: 320px;
  background: var(--background);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--gradient-secondary);
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-count {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.user-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  display: block;
  max-height: calc(100vh - 150px);
}

.user-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.user-item:hover {
  background: var(--secondary-color);
}

.user-item.active {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
  animation: pinkGlow 2s ease-in-out infinite;
}

.user-item.active .user-phone,
.user-item.active .user-status {
  color: rgba(255, 255, 255, 0.8);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 1rem;
  border: 2px solid var(--border-color);
  transition: all 0.2s;
}

.user-avatar:hover {
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-phone {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

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

.status-offline {
  background: var(--text-secondary);
}

.flag-review {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--warning-color);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: pulse-attention 2s infinite;
  z-index: 2;
}

.flag-freeze {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--info-color);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: pulse-attention 2s infinite;
  z-index: 2;
}

@keyframes pulse-attention {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0.75rem 1rem;
  }

  .logo {
    gap: 0.5rem;
  }

  .clinic-logo {
    width: 36px;
    height: 36px;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.25);
  }

  .logo-text h1 {
    font-size: 1rem;
  }

  .tagline {
    font-size: 0.7rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .sheets-link-nav,
  .logout-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 0.4rem;
  }

  .sheets-icon-nav {
    width: 16px;
    height: 16px;
  }
  
  .btn-label {
    display: none;
  }

  .sheets-link-nav,
  .logout-link {
    padding: 0.4rem;
  }

  .sheets-icon-nav,
  .logout-icon {
    width: 18px;
    height: 18px;
  }

  .message-input-container {
    padding: 0.5rem;
  }

  .message-input {
    gap: 0.4rem;
  }

  .message-input input {
    font-size: 0.9rem;
    padding: 0.5rem 0.6rem;
  }

  .send-btn {
    padding: 0.5rem 0.6rem;
    box-shadow: 0 3px 10px rgba(236, 72, 153, 0.3);
  }

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

@keyframes pinkGlow {
  0%,
  100% {
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
  }
  50% {
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
  }
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
  /* Allow children to size correctly in flex layouts */
  min-height: 0;
}

.chat-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-secondary);
}

.placeholder-content {
  text-align: center;
  padding: 2rem;
}

.welcome-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 1rem;
  object-fit: cover;
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.3);
}

.placeholder-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.placeholder-content p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.chat-interface {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Critical for keeping footer input visible in flex layouts */
  min-height: 0;
}

.chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--background);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  transition: background-color 0.3s ease;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-user-details h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Chat header toggle styles (Freeze / Needs Review) */
.chat-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.freeze-toggle,
.review-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.875rem;
  user-select: none;
}

/* Visually hide native checkbox but keep it accessible */
.freeze-toggle input[type="checkbox"],
.review-toggle input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Use the following span (label text) as the host for the switch UI */
.freeze-toggle span,
.review-toggle span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 48px; /* space for switch */
  line-height: 1.2;
}

/* Track */
.freeze-toggle span::before,
.review-toggle span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 22px;
  background: #e5e7eb; /* neutral track */
  border: 1px solid var(--border-color);
  border-radius: 999px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Knob */
.freeze-toggle span::after,
.review-toggle span::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

/* Focus ring on keyboard focus */
.freeze-toggle input[type="checkbox"]:focus-visible + span::before,
.review-toggle input[type="checkbox"]:focus-visible + span::before {
  outline: 3px solid rgba(236, 72, 153, 0.35);
  outline-offset: 2px;
}

/* Hover subtle highlight */
.freeze-toggle:hover span::before,
.review-toggle:hover span::before {
  filter: brightness(0.98);
}

/* Checked state (Freeze uses primary color) */
.freeze-toggle input[type="checkbox"]:checked + span::before {
  background: var(--primary-color);
  border-color: var(--primary-color);
}
.freeze-toggle input[type="checkbox"]:checked + span::after {
  transform: translate(18px, -50%);
}

/* Checked state (Needs Review uses warning color) */
.review-toggle input[type="checkbox"]:checked + span::before {
  background: var(--warning-color);
  border-color: var(--warning-color);
}
.review-toggle input[type="checkbox"]:checked + span::after {
  transform: translate(18px, -50%);
}

/* Header accent when needs-review is active */
.chat-header.needs-review {
  background: linear-gradient(0deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.08)), var(--background);
}

.sheets-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--secondary-color);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  margin-left: 1rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.sheets-link:hover {
  background: var(--border-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.sheets-icon {
  flex-shrink: 0;
  color: #0f9d58; /* Google Sheets green */
}

/* Adjust spacing in chat actions for mobile */
@media (max-width: 480px) {
  .chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sheets-link {
    margin-left: 0;
  }
}

.messages-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #fefcff 0%, #fdf2f8 100%);
  /* Prevent implicit min-height from pushing footer off-screen */
  min-height: 0;
}

.load-more-btn {
  background: var(--gradient-accent);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  margin: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.load-more-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

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

.messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Smooth scrolling on mobile */
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.message {
  display: flex;
  max-width: 70%;
  animation: fadeIn 0.3s ease-in;
}

.message.sent {
  align-self: flex-end;
}

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

.message-bubble {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  position: relative;
  word-wrap: break-word;
  box-shadow: var(--shadow);
}

.message.sent .message-bubble {
  background: var(--gradient-accent);
  color: white;
  border-bottom-right-radius: 0.25rem;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.message.received .message-bubble {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 0.25rem;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.1);
}

.message-text {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.message-text a {
  color: inherit;
  text-decoration: underline;
}

.message.sent .message-text a {
  color: rgba(255, 255, 255, 0.9);
}

.message-time {
  font-size: 0.75rem;
  opacity: 0.7;
  text-align: right;
}

/* Media message styles */
.message-media {
  margin-bottom: 0.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
}

.message-image {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  display: block;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.message-image:hover {
  transform: scale(1.02);
}

.message-video {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  display: block;
  border-radius: 0.75rem;
}

.message-audio {
  width: 100%;
  max-width: 300px;
  height: 40px;
}

.message-document {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(236, 72, 153, 0.1);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  transition: all 0.2s;
}

.message-document:hover {
  background: rgba(236, 72, 153, 0.2);
  transform: translateY(-1px);
}

.message.sent .message-document {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.message.sent .message-document:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Image lightbox effect */
.message-image.fullscreen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
  z-index: 9999;
  cursor: zoom-out;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(245, 158, 11, 0.1);
  border-top: 1px solid var(--warning-color);
  font-size: 0.875rem;
  color: var(--warning-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-color);
}

.status-dot.reconnecting {
  background: var(--warning-color);
  animation: pulse 1s infinite;
}

.status-dot.error,
.status-dot.failed {
  background: var(--error-color);
}

.message-input-container {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--background);
}

.message-input {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.message-input input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.message-input input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.message-input input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.send-btn {
  background: var(--gradient-accent);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.send-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  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;
}

.loading-indicator {
  text-align: center;
  padding: 1rem;
  color: var(--text-secondary);
  font-style: italic;
}

.error-message {
  text-align: center;
  padding: 2rem;
  color: var(--error-color);
  background: rgba(239, 68, 68, 0.1);
  border-radius: 0.5rem;
  margin: 1rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

@keyframes pulseNotice {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(236, 72, 153, 0.35);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Use dynamic viewport height to avoid address bar issues */
  .app-container { height: 100dvh; }

  .main-content {
    position: relative;
  }

  .user-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
  }

  .user-sidebar.mobile-hidden {
    transform: translateX(-100%);
  }

  .chat-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
  }

  .chat-container.mobile-active {
    z-index: 3;
  }

  /* Back button remains controlled by JS; no CSS override here */

  .message {
    max-width: 85%;
  }

  .app-header {
    padding: 1rem;
  }

  .logo-text h1 {
    font-size: 1.25rem;
  }

  /* Shrink alert badges on small screens */
  .flag-review,
  .flag-freeze {
    width: 18px;
    height: 18px;
    font-size: 12px;
    top: 0.35rem;
  }
  .flag-review { right: 0.35rem; }
  .flag-freeze { left: 0.35rem; }

  .tagline {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .user-item {
    padding: 0.75rem 1rem;
  }

  .user-avatar {
    width: 40px;
    height: 40px;
  }

  .chat-header {
    padding: 1rem;
  }

  .messages-list {
    padding: 0.75rem;
  }

  .message-input-container {
    padding: 1rem;
    position: sticky;
    bottom: 0;
    z-index: 5;
    /* Account for iOS safe area */
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

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

/* Scrollbar Styling */
.messages-list::-webkit-scrollbar,
.user-list::-webkit-scrollbar {
  width: 6px;
}

.messages-list::-webkit-scrollbar-track,
.user-list::-webkit-scrollbar-track {
  background: var(--secondary-color);
}

.messages-list::-webkit-scrollbar-thumb,
.user-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.messages-list::-webkit-scrollbar-thumb:hover,
.user-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Highlight for AI error users */
.user-item.ai-error-highlight {
  background-color: rgba(255, 0, 0, 0.08);
  border-left: 4px solid red;
  animation: pulse-ai-error 1.3s ease-in-out infinite;
}

@keyframes pulse-ai-error {
  0% {
    background-color: rgba(255, 0, 0, 0.05);
  }
  50% {
    background-color: rgba(255, 0, 0, 0.2);
  }
  100% {
    background-color: rgba(255, 0, 0, 0.05);
  }
}

.user-item.has-unread {
  background-color: rgba(236, 72, 153, 0.08);
  border-left: 4px solid var(--primary-color);
}

.user-item.has-unread .user-name {
  font-weight: 600;
}

.user-item.has-unread .user-status {
  color: var(--primary-color);
}

.user-item.needs-review {
  border-left: 4px solid var(--warning-color);
  background: rgba(245, 158, 11, 0.12);
  position: relative;
}

.user-item.needs-review--animate {
  animation: pulseNotice 0.8s ease-in-out 3, shakeNotice 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shakeNotice {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* Send button spinner overlay */
.send-btn.is-sending::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.6);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast--fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.user-item[data-badge]::after {
  content: attr(data-badge);
  font-size: 0.85rem;
  margin-left: auto;
  color: var(--warning-color);
  background: rgba(245, 158, 11, 0.15);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.user-item.has-unread {
  background-color: rgba(236, 72, 153, 0.08);
  border-left: 4px solid var(--primary-color);
}

.user-item.has-unread .user-name {
  font-weight: 600;
}

.user-item.has-unread .user-status {
  color: var(--primary-color);
}

.user-item.needs-review {
  border-left: 4px solid var(--warning-color);
  background: rgba(245, 158, 11, 0.12);
  position: relative;
}

.user-item.needs-review--animate {
  animation: pulseNotice 0.8s ease-in-out 3, shakeNotice 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
