/* Enhanced Chat Features CSS */
/* Verification marker - remove after confirming CSS loads */
body::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #4F46E5, #7C3AED);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.7;
  animation: fadeOut 3s forwards 2s;
}

@keyframes fadeOut {
  to { opacity: 0; }
}

/* Particle background */
#particle-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* Message reactions */
.message-reactions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.reaction-button {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 1rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dark-mode .reaction-button {
  background: rgba(255, 255, 255, 0.1);
}

.reaction-button:hover {
  background: rgba(0, 0, 0, 0.1);
}

.dark-mode .reaction-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.reaction-button.reacted {
  background: rgba(79, 70, 229, 0.2);
  color: var(--primary);
}

.reaction-count {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Emoji picker */
.emoji-panel {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 250px;
  z-index: 100;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .emoji-panel {
  border-color: rgba(255, 255, 255, 0.1);
}

.emoji-panel span {
  font-size: 1.5rem;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: var(--transition);
}

.emoji-panel span:hover {
  background: rgba(0, 0, 0, 0.1);
}

.dark-mode .emoji-panel span:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Command mode input styling */
#textInput.command-mode {
  color: var(--primary);
  font-family: monospace;
}

/* Analytics modal */
.analytics-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.analytics-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.analytics-content {
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.analytics-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dark-mode .analytics-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.analytics-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.close-analytics {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-light);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.close-analytics:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

.dark-mode .close-analytics:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Enhanced message styles */
.message-bubble {
  box-shadow: 0 1px 2px rgba(0,0,0,0.07);
  transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.message-bubble:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.user-message .message-bubble:hover {
  box-shadow: 0 3px 12px rgba(79, 70, 229, 0.2);
}

/* Scroll to bottom button */
.scroll-to-bottom {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 99;
  border: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.scroll-to-bottom.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-to-bottom:hover {
  background: var(--background);
}

.dark-mode .scroll-to-bottom {
  background: var(--surface);
  color: var(--text);
}

.dark-mode .scroll-to-bottom:hover {
  background: var(--surface-hover);
}

/* Human support button pulse */
.human-support-button {
  position: relative;
}

.human-support-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: var(--primary);
  z-index: -1;
  opacity: 0.5;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.5);
    opacity: 0;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.human-support-button.active::after {
  animation: none;
  opacity: 0;
}

/* Skip to content for accessibility */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-to-content:focus {
  top: 0;
}

/* Enhanced focus styles */
:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.control-button:focus, 
.theme-toggle:focus, 
.action-button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* === Link Preview Styles - START === */
/* Link Action Modal */
.link-modal-container {
  position: relative;
  margin-top: 8px;
  z-index: 100;
}

.link-action-modal {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
  animation: slideUp 0.2s ease-out;
}

.dark-mode .link-action-modal {
  border-color: rgba(255,255,255,0.1);
}

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

.link-action-content {
  padding: 12px;
}

.link-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-light);
  word-break: break-all;
}

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

.link-action-btn {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: var(--background);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.dark-mode .link-action-btn {
  background: var(--surface-hover);
}

.link-action-btn:hover {
  background: var(--primary-light);
  color: white;
}

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

.link-action-btn.preview-btn:hover {
  background: var(--primary-dark);
}

/* Link Previews */
.link-preview-container {
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
  background: var(--surface);
  box-shadow: var(--shadow);
  max-width: 100%;
}

.dark-mode .link-preview-container {
  border-color: rgba(255,255,255,0.1);
}

.link-preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text-light);
  gap: 12px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

.dark-mode .loading-spinner {
  border-color: rgba(255,255,255,0.1);
  border-top-color: var(--primary);
}

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

/* Image Preview */
.image-preview {
  display: flex;
  flex-direction: column;
}

.preview-image {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

/* Video Preview */
.video-preview {
  display: flex;
  flex-direction: column;
}

.preview-video {
  width: 100%;
  height: 250px;
}

/* Map Preview */
.map-preview {
  display: flex;
  flex-direction: column;
}

.preview-map {
  width: 100%;
  height: 250px;
}

/* Webpage Preview */
.webpage-preview {
  display: flex;
  flex-direction: column;
}

.preview-header {
  padding: 10px 12px;
  background: var(--background);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.dark-mode .preview-header {
  border-color: rgba(255,255,255,0.1);
}

.preview-url {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-iframe-container {
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: #fff;
}

.dark-mode .preview-iframe-container {
  background: #f5f5f5;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  transform-origin: 0 0;
  transform: scale(0.9);
  width: 111.11%;
  height: 111.11%;
}

/* Error Preview */
.error-preview {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.error-icon {
  font-size: 2rem;
  color: var(--error);
}

.error-message {
  color: var(--text);
}

.error-url {
  color: var(--text-light);
  font-size: 0.85rem;
  word-break: break-all;
  margin-top: 4px;
}

/* Preview Actions */
.preview-actions {
  display: flex;
  padding: 10px;
  border-top: 1px solid rgba(0,0,0,0.1);
  background: var(--background);
  justify-content: flex-end;
  gap: 8px;
}

.dark-mode .preview-actions {
  border-color: rgba(255,255,255,0.1);
}

.preview-action-btn {
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  border: 1px solid rgba(0,0,0,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: var(--transition);
}

.dark-mode .preview-action-btn {
  border-color: rgba(255,255,255,0.1);
  background: var(--surface-hover);
}

.preview-action-btn:hover {
  background: var(--primary-light);
  color: white;
}
/* === Link Preview Styles - END === */