/* ========================================
   VueSense AI Modal - Phase 1 Styles
   Optimized for 1600×900 baseline
   ======================================== */

/* Modal Container */
.vuesense-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-in-out;
}

.vuesense-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Modal Window */
.vuesense-modal {
  background: var(--bg-primary, #1a1a2e);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: transform 200ms ease-in-out;
  overflow: hidden;
}

.vuesense-modal-overlay.active .vuesense-modal {
  transform: scale(1) translateY(0);
}

/* Position Variants */
.vuesense-modal-overlay.position-bottom-right {
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
}

.vuesense-modal-overlay.position-bottom-left {
  align-items: flex-end;
  justify-content: flex-start;
  padding: 24px;
}

.vuesense-modal-overlay.position-top-right {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 24px;
}

.vuesense-modal-overlay.position-top-left {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 24px;
}

/* Size Variants */
.vuesense-modal.size-small {
  max-width: 480px;
}

.vuesense-modal.size-default {
  max-width: 800px;
}

.vuesense-modal.size-large {
  max-width: 1200px;
}

.vuesense-modal.size-fullscreen {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

/* Modal Header */
.vuesense-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
  background: linear-gradient(135deg, var(--bg-secondary, #16213e) 0%, var(--bg-tertiary, #0f1923) 100%);
}

.vuesense-modal-branding {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vuesense-modal-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-blue, #3b82f6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.vuesense-modal-title-group {
  display: flex;
  flex-direction: column;
}

.vuesense-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin: 0;
}

.vuesense-modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  margin: 0;
}

.vuesense-modal-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vuesense-modal-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.vuesense-modal-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #ffffff);
}

.vuesense-modal-btn:active {
  transform: scale(0.95);
}

/* Modal Body */
.vuesense-modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
  background: var(--bg-primary, #1a1a2e);
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
.vuesense-modal-body::-webkit-scrollbar {
  width: 8px;
}

.vuesense-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.vuesense-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.vuesense-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Modal Footer */
.vuesense-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
  background: var(--bg-secondary, #16213e);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Trigger Button */
.vuesense-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue, #3b82f6), var(--accent-purple, #8b5cf6));
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  z-index: 9998;
  transition: all 200ms ease;
}

.vuesense-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.6);
}

.vuesense-trigger:active {
  transform: scale(0.95);
}

.vuesense-trigger.hidden {
  display: none;
}

/* Responsive Design */

/* Tablet (1024×768 and below) */
@media (max-width: 1024px) {
  .vuesense-modal {
    max-width: 600px;
  }
  
  .vuesense-modal.size-large {
    max-width: 90%;
  }
}

/* Small Tablet/Large Mobile (900px and below) */
@media (max-width: 900px) {
  .vuesense-modal-overlay.position-bottom-right,
  .vuesense-modal-overlay.position-bottom-left,
  .vuesense-modal-overlay.position-top-right,
  .vuesense-modal-overlay.position-top-left {
    padding: 16px;
  }
  
  .vuesense-modal {
    max-width: 95%;
  }
}

/* Mobile (768px and below - minimum 1366×768 support) */
@media (max-width: 768px) {
  .vuesense-modal-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  
  .vuesense-modal-overlay.position-bottom-right,
  .vuesense-modal-overlay.position-bottom-left,
  .vuesense-modal-overlay.position-top-right,
  .vuesense-modal-overlay.position-top-left {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  
  .vuesense-modal {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
  
  .vuesense-trigger {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
}

/* Animation Keyframes */
@keyframes vuesense-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* ========================================
   Phase 2: Chat Interface Styles
   ======================================== */

/* Chat Container */
.vuesense-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  overflow: hidden;
}

/* Messages Area */
.vuesense-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

/* Welcome Screen */
.vuesense-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-primary, #ffffff);
}

.vuesense-welcome-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent-blue, #3b82f6), var(--accent-purple, #8b5cf6));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.vuesense-welcome h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.vuesense-welcome p {
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  margin: 0 0 24px 0;
  max-width: 400px;
}

/* Suggested Questions */
.vuesense-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  margin-top: 8px;
}

.vuesense-suggestions-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  margin-bottom: 4px;
}

.vuesense-suggestion-btn {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary, #ffffff);
  cursor: pointer;
  transition: all 150ms ease;
  text-align: left;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vuesense-suggestion-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-blue, #3b82f6);
  transform: translateX(4px);
}

.vuesense-suggestion-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-blue, #3b82f6);
  flex-shrink: 0;
}

/* Message Bubbles */
.vuesense-message {
  display: flex;
  gap: 12px;
  animation: vuesense-slideUp 300ms ease;
}

.vuesense-message.user {
  flex-direction: row-reverse;
}

.vuesense-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vuesense-message.user .vuesense-message-avatar {
  background: linear-gradient(135deg, #10b981, #059669);
}

.vuesense-message.ai .vuesense-message-avatar {
  background: linear-gradient(135deg, var(--accent-blue, #3b82f6), var(--accent-purple, #8b5cf6));
}

.vuesense-message-content {
  max-width: 75%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vuesense-message.user .vuesense-message-content {
  align-items: flex-end;
}

.vuesense-message-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

/* Markdown formatting styles for AI messages */
.vuesense-message.ai .vuesense-message-bubble h2,
.vuesense-message.ai .vuesense-message-bubble h3,
.vuesense-message.ai .vuesense-message-bubble h4 {
  margin: 16px 0 8px 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary, #ffffff);
}

.vuesense-message.ai .vuesense-message-bubble h2 {
  font-size: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.vuesense-message.ai .vuesense-message-bubble h3 {
  font-size: 16px;
}

.vuesense-message.ai .vuesense-message-bubble h4 {
  font-size: 14px;
  color: var(--accent-blue, #3b82f6);
}

.vuesense-message.ai .vuesense-message-bubble h2:first-child,
.vuesense-message.ai .vuesense-message-bubble h3:first-child,
.vuesense-message.ai .vuesense-message-bubble h4:first-child {
  margin-top: 0;
}

.vuesense-message.ai .vuesense-message-bubble p {
  margin: 0 0 16px 0;
  line-height: 1.6;
}

.vuesense-message.ai .vuesense-message-bubble p + h2,
.vuesense-message.ai .vuesense-message-bubble p + h3,
.vuesense-message.ai .vuesense-message-bubble p + h4 {
  margin-top: 20px;
}

.vuesense-message.ai .vuesense-message-bubble p:last-child {
  margin-bottom: 0;
}

/* Better list styling */
.vuesense-message.ai .vuesense-message-bubble ul {
  margin: 12px 0;
  padding-left: 20px;
  list-style-type: disc;
}

.vuesense-message.ai .vuesense-message-bubble ol {
  margin: 12px 0;
  padding-left: 20px;
  list-style-type: decimal;
}

.vuesense-message.ai .vuesense-message-bubble li {
  margin: 6px 0;
  line-height: 1.6;
  padding-left: 4px;
}

/* Nested lists */
.vuesense-message.ai .vuesense-message-bubble li > ul,
.vuesense-message.ai .vuesense-message-bubble li > ol {
  margin-top: 6px;
  margin-bottom: 6px;
}

/* First/last element spacing */
.vuesense-message.ai .vuesense-message-bubble > *:first-child {
  margin-top: 0 !important;
}

.vuesense-message.ai .vuesense-message-bubble > *:last-child {
  margin-bottom: 0 !important;
}

.vuesense-message.ai .vuesense-message-bubble strong {
  font-weight: 600;
  color: var(--text-primary, #ffffff);
}

.vuesense-message.ai .vuesense-message-bubble em {
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
}

/* Inline code */
.vuesense-message.ai .vuesense-message-bubble code {
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 0.9em;
  color: #93c5fd;
}

/* Code blocks */
.vuesense-message.ai .vuesense-message-bubble pre {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  overflow-x: auto;
}

.vuesense-message.ai .vuesense-message-bubble pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.5;
}

.vuesense-message.ai .vuesense-message-bubble pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  color: #e2e8f0;
  display: block;
  white-space: pre;
}

.vuesense-message.ai .vuesense-message-bubble br {
  display: block;
  content: "";
  margin: 6px 0;
}

.vuesense-message.user .vuesense-message-bubble {
  background: var(--accent-blue, #3b82f6);
  color: white;
  border-bottom-right-radius: 4px;
  max-width: 400px;
}

.vuesense-message.ai .vuesense-message-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #ffffff);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
  max-width: 600px;
}

.vuesense-message-time {
  font-size: 11px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.4));
  padding: 0 4px;
}

/* Typing Indicator */
.vuesense-typing {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  max-width: 80px;
}

.vuesense-typing-dots {
  display: flex;
  gap: 4px;
}

.vuesense-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-blue, #3b82f6);
  border-radius: 50%;
  animation: vuesense-typing 1.4s infinite;
}

.vuesense-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.vuesense-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes vuesense-typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Input Area */
.vuesense-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
  background: var(--bg-secondary, #16213e);
  flex-shrink: 0;
}

.vuesense-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.vuesense-input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary, #ffffff);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  transition: all 150ms ease;
}

.vuesense-input-field:focus {
  outline: none;
  border-color: var(--accent-blue, #3b82f6);
  background: rgba(255, 255, 255, 0.08);
}

.vuesense-input-field::placeholder {
  color: var(--text-secondary, rgba(255, 255, 255, 0.4));
}

.vuesense-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--accent-blue, #3b82f6);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  flex-shrink: 0;
}

.vuesense-send-btn:hover:not(:disabled) {
  background: #2563eb;
  transform: scale(1.05);
}

.vuesense-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.vuesense-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vuesense-stop-btn {
  background: #dc2626;
}

.vuesense-stop-btn:hover:not(:disabled) {
  background: #b91c1c;
}

/* Character Counter */
.vuesense-char-counter {
  font-size: 11px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.4));
  text-align: right;
  margin-top: 4px;
}

.vuesense-char-counter.warning {
  color: #f59e0b;
}

.vuesense-char-counter.error {
  color: #ef4444;
}

/* Empty State */
.vuesense-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  text-align: center;
}

.vuesense-empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Scrollbar for Messages */
.vuesense-messages::-webkit-scrollbar {
  width: 6px;
}

.vuesense-messages::-webkit-scrollbar-track {
  background: transparent;
}

.vuesense-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.vuesense-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .vuesense-chat-container {
    min-height: 400px;
  }
  
  .vuesense-message-content {
    max-width: 85%;
  }
  
  .vuesense-welcome {
    padding: 30px 16px;
  }
  
  .vuesense-welcome-icon {
    width: 56px;
    height: 56px;
  }
  
  .vuesense-welcome h3 {
    font-size: 20px;
  }
}

.vuesense-message.ai strong {
  font-weight: 600;
  color: var(--accent-blue);
}

.vuesense-message.ai h2 {
  font-size: 1.1em;
  font-weight: 700;
  margin: 12px 0 8px 0;
  color: var(--text-primary);
}

.vuesense-message.ai ul {
  margin: 8px 0;
  padding-left: 20px;
}

.vuesense-message.ai li {
  margin: 4px 0;
}

/* Updated Welcome Screen Styles */

.ai-prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.ai-prompt-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.ai-prompt-card:hover {
  background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
  border-color: var(--accent-blue, #3b82f6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-prompt-card:active {
  transform: translateY(0);
}

.ai-prompt-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
  border-radius: 8px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  transition: all 0.2s ease;
}

.ai-prompt-card:hover .ai-prompt-icon {
  color: var(--accent-blue, #3b82f6);
  background: var(--bg-quaternary, rgba(255, 255, 255, 0.08));
}

.ai-prompt-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ai-prompt-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary, #ffffff);
  line-height: 1.4;
}

.ai-prompt-description {
  font-size: 0.8rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
  line-height: 1.4;
}

/* Category-based colors on hover */
.ai-prompt-card[data-category="strategic"]:hover .ai-prompt-icon {
  color: var(--accent-blue, #3b82f6);
  background: rgba(59, 130, 246, 0.1);
}

.ai-prompt-card[data-category="tactical"]:hover .ai-prompt-icon {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.ai-prompt-card[data-category="scenario"]:hover .ai-prompt-icon {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.ai-prompt-card[data-category="analysis"]:hover .ai-prompt-icon {
  color: #f97316;
  background: rgba(249, 115, 22, 0.1);
}

/* Quick Tips Section */
.ai-welcome-tips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
  border-radius: 12px;
  border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
  margin-top: 1rem;
}

.ai-tip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.6));
}

.ai-tip-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue, #3b82f6);
}

.ai-tip-icon svg {
  width: 16px;
  height: 16px;
}

.ai-tip-text {
  line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ai-prompt-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .ai-prompt-card {
    padding: 0.875rem;
  }

  .ai-prompt-icon {
    width: 36px;
    height: 36px;
  }
  
  .ai-prompt-icon svg {
    width: 18px;
    height: 18px;
  }

  .ai-prompt-text {
    font-size: 0.875rem;
  }

  .ai-prompt-description {
    font-size: 0.75rem;
  }
}

/* Clickable Entity Links in AI Responses */

.ai-entity-link {
  position: relative;
  transition: all 0.2s ease;
  border-radius: 2px;
  padding: 0 2px;
}

.ai-entity-link:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration-style: solid !important;
}

.ai-entity-link:active {
  transform: translateY(1px);
}

/* Initiative Links */
.ai-entity-initiative:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Team Links */
.ai-entity-team:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Tooltip on hover */
.ai-entity-link::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border: 1px solid var(--border-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.ai-entity-link:hover::after {
  opacity: 1;
}