.chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.chat-link {
  display: flex;
  align-items: center;
  background-color: #3a86ff;
  color: white;
  padding: 12px 20px;
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.chat-link:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.chat-link svg {
  margin-right: 8px;
}

/* Cursor follower styling */
.cursor-follower {
  position: absolute;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  transition: left 0.1s ease-out, top 0.1s ease-out;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
} 


.chat-user-badge {
  display: none;
}


#notification-container {
  z-index: 1000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  top: 90px;
  right: 10px;
  left: 10px;
  z-index: 1000;
}

.notification {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 48px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  animation: slide-down 0.3s ease-out;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 1000px; /* Adjusted for 1080px width */
  display: flex;
  align-items: flex-start;
  font-size: 32px;
}

.notification-icon {
  width: 72px;
  height: 72px;
  margin-right: 20px;
  margin-top: 20px;
  border-radius: 12px;
  background-size: cover;
  flex-shrink: 0;
  /* border: 1px solid #000; */
}

.notification-content-wrapper {
  flex-grow: 1;
}

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

.app-name {
  color: #000;
  font-weight: 600;
  font-size: 32px;
  font-family: sans-serif;
}

.notification-time {
  color: #666;
  /* font-size: 20px; */
  font-size: 32px;
  font-weight: 200;
  margin-right: 20px;
  font-family: sans-serif;
}

.notification-content {
  font-size: 32px;
  line-height: 1.2;
  font-family: sans-serif;
  font-weight: 400;
}

.notification-content strong {
  display: block;
  color: #000;
  margin-bottom: 4px;
  font-weight: 400;
  font-size: 32px;
  font-family: sans-serif;
}

.notification-content p {
  margin: 0;
  color: #333;
  font-weight: 400;
  font-family: sans-serif;
  font-size: 32px;
}

/* Different notification types with their specific app icons */
.notification.banner {
  background: rgba(255, 255, 255, 0.95);
}

/* .notification.alert {
  background: rgba(255, 235, 235, 0.95);
}

.notification.metric {
  background: rgba(235, 245, 255, 0.95);
} */

@keyframes slide-down {
  from {
    transform: translateY(-120%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fade-up {
  to {
    transform: translateY(-120%);
    opacity: 0;
  }
}



/* User panel styles */
.panel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 250px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  z-index: 100;
  display: none;
}

.panel h3 {
  margin-top: 0;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

#users-list {
  max-height: 300px;
  overflow-y: auto;
}

.user-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.user-avatar-container {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: saturate(0) contrast(1.25);
}

.user-avatar-container .visitor-avatar {
  width: 30px;
  height: 30px;
}

.avatar-placeholder {
  width: 30px;
  height: 30px;
  background-color: #457B9D;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-name {
  flex: 1;
}

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

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  width: 440px;
  max-width: 90%;
  text-align: center;
  position: relative;
}

#close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  color: #000;
}

.close-chat {
  position: relative;
  background-color: transparent;
}

.close-chat::before,
.close-chat::after {
  content: '';
  position: absolute;
  background-color: black;
}

.close-chat::before {
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
  transform: rotate(45deg);
}

.close-chat::after {
  height: 100%;
  width: 1px;
  left: 50%;
  top: 0;
  transform: rotate(45deg);
}

#registration-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

#username-input {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

button {
  padding: 10px 15px;
  /* background-color: #4CAF50; */
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 16px;
  color: #000;
  border: 1px solid #000;
  background-color: #fff;
}

button:hover {
  /* background-color: #45a049; */
}

.error-message {
  color: #f44336;
  margin-top: 10px;
}

/* Notification styles */
.notification {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.notification.fade-out {
  animation: fadeOut 0.5s ease-out;
}

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

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

/* Logout button */
.logout-button {
  margin: 0 0 15px 0;
  padding: 6px 12px;
  background-color: #f44336;
  font-size: 14px;
  width: 100%;
}

.logout-button:hover {
  background-color: #d32f2f;
}

/* Current user highlighting */
.current-user {
  background-color: rgba(58, 134, 255, 0.1);
}

.you-badge {
  font-size: 12px;
  color: #666;
  margin-left: 5px;
} 

.message-avatar, .chat-user-avatar {
filter: saturate(0) contrast(1.25);
}

.npc-badge {
display: none;
}

/* Visitor interaction styles */

/* Profile tooltip */
.visitor-profile-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  width: 200px;
  z-index: 1002;
  pointer-events: none;
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.visitor-shape:hover .visitor-profile-tooltip {
  opacity: 1;
}

.tooltip-header {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 5px;
  color: #333;
}

.tooltip-info {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.tooltip-action {
  font-size: 12px;
  color: #4CAF50;
  font-weight: bold;
}

/* Notification system */
.visitor-notifications {
  position: fixed;
  top: 2.5rem;
  right: 20px;
  width: 300px;
  z-index: 1005;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.visitor-notification {
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 0px;
  padding: 12px 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  color: #333;
}

.visitor-notification.show {
  transform: translateX(0);
}

.visitor-notification.hide {
  transform: translateX(120%);
}

.visitor-notification.info {
  /* border-left: 4px solid #2196F3; */
}

.visitor-notification.success {
  /* border-left: 4px solid #4CAF50; */
}

.visitor-notification.warning {
  /* border-left: 4px solid #FF9800; */
}

.visitor-notification.error {
  /* border-left: 4px solid #F44336; */
}

/* Chat request notification */
.visitor-chat-request {
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 0;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  /* border-left: 4px solid #9C27B0; */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visitor-chat-request.show {
  transform: translateX(0);
}

.request-message {
  font-size: 14px;
  color: #333;
}

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

.request-actions button {
  padding: 8px 12px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-weight: bold;
  flex: 1;
}

.request-actions .accept-chat {
  background-color: #abffd1;
  color: #000;
}

.request-actions .decline-chat {
  background-color: #ffc8d7;
  color: #000;
}

/* Visitor states */
.visitor-shape.chat-request-pending {
  animation: pulse-purple 1.5s infinite;
}

.visitor-shape.chat-request-initiator {
  animation: pulse-blue 1.5s infinite;
}

.visitor-shape.chatting {
  /* box-shadow: 0 0 15px rgba(76, 175, 80, 0.7) !important; */
}

@keyframes pulse-purple {
  0% { box-shadow: 0 0 5px rgba(156, 39, 176, 0.5); }
  50% { box-shadow: 0 0 15px rgba(156, 39, 176, 0.8); }
  100% { box-shadow: 0 0 5px rgba(156, 39, 176, 0.5); }
}

@keyframes pulse-blue {
  0% { box-shadow: 0 0 5px rgba(33, 150, 243, 0.5); }
  50% { box-shadow: 0 0 15px rgba(33, 150, 243, 0.8); }
  100% { box-shadow: 0 0 5px rgba(33, 150, 243, 0.5); }
}

/* Chat window styles */
.visitor-chats {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  z-index: 1004;
  pointer-events: none;
}

.visitor-chat-window {
  position: fixed;
  width: 320px;
  height: 400px;
  background-color: white;
  /* border-radius: 8px 8px 0 0; */
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
  pointer-events: auto;
  z-index: 1004;
}

.visitor-chat-window.focus {
  box-shadow: 0 -2px 20px rgba(33, 150, 243, 0.4);
  transform: translateY(-5px);
}

.visitor-chat-window.minimized {
  height: 40px !important;
  width: 200px !important;
  overflow: hidden;
}

.visitor-chat-window.minimized .chat-messages,
.visitor-chat-window.minimized .chat-input-area {
  display: none;
}

.visitor-chat-window.closing {
  transform: translateY(100%);
  opacity: 0;
}

.chat-header {  
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* cursor: move; */
  min-height: 40px;
  box-sizing: border-box;
}

/* .chat-header {
  padding: 0.4rem;
  background-color: #000;
  color: white;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
 */

.minimized .chat-header {
  border-bottom: none;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chat-user-name {
  font-weight: bold;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.chat-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0px;
  padding: 0;
  color: #000;
}

.chat-actions button:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  display: flex;
  max-width: 80%;
}

.chat-message.incoming {
  align-self: flex-start;
}

.chat-message.outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.message-content {
  display: flex;
  flex-direction: column;
}

.message-text {
  background-color: white;
  padding: 10px;
  border-radius: 12px;
  /* box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); */
  font-size: 14px;
  line-height: 1.4;
}

.chat-message.incoming .message-text {
  border-top-left-radius: 4px;
  /* background-color: white; */
}

.chat-message.outgoing .message-text {
  border-top-right-radius: 4px;
  /* background-color: #e3f2fd; */
}

.message-time {
  font-size: 10px;
  color: #000;
  margin-top: 4px;
  align-self: flex-end;
}

.chat-input-area {
  padding: 10px;
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 10px;
  border-radius: 0px;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  height: 40px;
  max-height: 100px;
  background-color: transparent;
  border: 1px solid #000;
  outline: none; /* Optional: removes the default focus highlight */
}

textarea:focus {
  outline: 2px solid rgb(0,0,0,0.5); /* Inherits the color property */
}

.send-message {
  padding: 0 15px;
  /* background-color: #2196F3; */
  color: #000;
  border: 1px solid #000;
  /* border-radius: 4px; */
  cursor: pointer;
  font-weight: bold;
  background-color: transparent;

}
/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: flex-end;
  margin-top: 5px;
  margin-bottom: 5px;
}

.typing-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 8px;
  filter: saturate(0) contrast(1.25);
}

.typing-bubbles {
  background-color: #f0f0f0;
  padding: 10px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.typing-bubbles span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #999;
  border-radius: 50%;
  animation: typing-bubble 1.4s infinite ease-in-out both;
}

.typing-bubbles span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-bubbles span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing-bubble {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
} 

/* Visitor visualization styles */
#visitor-visualization {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.visitor-shape {
  position: absolute;
  transform-origin: center center;
  will-change: transform, left, top;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.visitor-shape .visitor-avatar {
  width: 70px;
  height: 70px;
  /* filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.2)); */
}

/* State animations */
/* .visitor-shape.state-active {
  animation: pulse 2s infinite;
}

.visitor-shape.state-idle {
  animation: breathe 3s infinite;
}

.visitor-shape.state-paused {
  animation: glow 2s infinite;
} */

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

@keyframes breathe {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

@keyframes glow {
  0% { box-shadow: 0 0 5px rgba(0, 0, 255, 0.3); }
  50% { box-shadow: 0 0 15px rgba(0, 0, 255, 0.7); }
  100% { box-shadow: 0 0 5px rgba(0, 0, 255, 0.3); }
}

/* State styling */
.visitor-shape.state-active .visitor-avatar {
  /* filter: drop-shadow(0 0 3px rgba(0, 255, 0, 0.5)); */
}

.visitor-shape.state-idle .visitor-avatar {
  /* filter: drop-shadow(0 0 3px rgba(255, 255, 0, 0.5)); */
}

.visitor-shape.state-paused .visitor-avatar {
  /* filter: drop-shadow(0 0 3px rgba(0, 0, 255, 0.5)); */
}

/* Controls */
.visitor-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visitor-controls button {
  padding: 8px 12px;
  /* background-color: #4CAF50; */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.visitor-controls button:hover {
  /* background-color: #45a049; */
}

.opacity-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opacity-control label {
  font-size: 12px;
  color: #333;
}

.opacity-control input {
  width: 100px;
}

/* Hover information */
.visitor-shape:hover .visitor-name-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.visitor-name-label {
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(-50%) translateY(5px);
}

/* NPC styling */
.npc-visitor {
  border: 2px dashed rgba(255, 255, 255, 0.5);
}

/* Error notification */
.visitor-error {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 2000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease-out;
}

.visitor-error.fade-out {
  animation: fadeOut 0.5s ease-out;
}

/* Proximity connections */
.visitor-connection-line {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}

/* Chat indicators */
.visitor-shape.chatting .visitor-avatar {
  /* filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8)); */
}

.visitor-shape.chat-request-pending .visitor-avatar {
  /* animation: pulse-request 1.5s ease-in-out infinite; */
}

@keyframes pulse-request {
  0% { transform: scale(1); filter: drop-shadow(0 0 3px rgba(255, 165, 0, 0.5)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 5px rgba(255, 165, 0, 0.8)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 3px rgba(255, 165, 0, 0.5)); }
}

/* Hide name label for current user */
.current-user-visitor .visitor-name-label {
  display: none;
} 

/* Avatar styling and animations */

.visitor-avatar {
  /* width: 40px; */
  /* height: 40px; */
  transition: transform 0.3s ease;
  transform-origin: center;
  background: transparent; /* Ensure transparent background */
}

/* Make sure SVG has transparent background */
.visitor-avatar svg {
  background: transparent;
  filter: saturate(0) contrast(1.25);

}

/* Remove any potential background from the visitor shape container */
.visitor-shape {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important; /* Remove default box shadow */
  filter: saturate(0) contrast(1.25);
}

/* Only apply box shadow to the SVG elements, not the container */
.visitor-shape .visitor-avatar {
  filter: saturate(0) contrast(1.25);
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.2));
}

/* Typing animation - subtle pulse */
.visitor-typing {
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Moving animation - slight rotation based on movement */
.visitor-moving-right {
  transform: rotate(5deg);
}

.visitor-moving-left {
  transform: rotate(-5deg);
}

.visitor-moving-up {
  transform: translateY(-2px);
}

.visitor-moving-down {
  transform: translateY(2px);
}

/* Proximity effect when visitors are close to each other */
.visitor-proximity {
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
}

/* Connection line between nearby visitors */
.visitor-connection {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}

/* AI Navigation Highlight */
.ai-navigation-highlight {
  position: absolute;
  pointer-events: none;
  border: 2px solid #4CAF50;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
  z-index: 9999;
  animation: pulse 1s infinite;
}

/* @keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 0.3; }
  100% { opacity: 0.7; }
} */

/* Navigation notification style */
.visitor-notification.navigation {
  background-color: #4CAF50;
  color: white;
  border-left: 4px solid #2E7D32;
}
