/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap');

/* Theme System - CSS Custom Properties */
:root {
  /* Light Theme (Default) */
  --moat-bg-primary: #ffffff;
  --moat-bg-secondary: #f9fafb;
  --moat-bg-tertiary: #f3f4f6;
  --moat-border: #e5e7eb;
  --moat-border-light: #f3f4f6;
  --moat-text-primary: #1f2937;
  --moat-text-secondary: #4b5563;
  --moat-text-tertiary: #6b7280;
  --moat-text-muted: #9ca3af;
  --moat-accent: #3b82f6;
  --moat-accent-light: rgba(59, 130, 246, 0.1);
  --moat-accent-border: rgba(59, 130, 246, 0.2);
  --moat-success: #059669;
  --moat-success-light: rgba(34, 197, 94, 0.1);
  --moat-success-border: rgba(34, 197, 94, 0.2);
  --moat-error: #dc2626;
  --moat-error-light: rgba(239, 68, 68, 0.1);
  --moat-error-border: rgba(239, 68, 68, 0.2);
  --moat-warning: #d97706;
  --moat-warning-light: rgba(245, 158, 11, 0.1);
  --moat-warning-border: rgba(245, 158, 11, 0.2);
  --moat-shadow: rgba(0, 0, 0, 0.1);
  --moat-shadow-lg: rgba(0, 0, 0, 0.15);
  --moat-notification-bg: #1f2937;
  --moat-notification-text: #ffffff;
  
  /* Scrollbar colors */
  --moat-scrollbar-track: transparent;
  --moat-scrollbar-thumb: #d1d5db;
  --moat-scrollbar-thumb-hover: #9ca3af;
}

/* Dark Theme */
[data-moat-theme="dark"] {
  --moat-bg-primary: #111827;
  --moat-bg-secondary: #1f2937;
  --moat-bg-tertiary: #374151;
  --moat-border: #374151;
  --moat-border-light: #4b5563;
  --moat-text-primary: #f9fafb;
  --moat-text-secondary: #e5e7eb;
  --moat-text-tertiary: #d1d5db;
  --moat-text-muted: #9ca3af;
  --moat-accent: #60a5fa;
  --moat-accent-light: rgba(96, 165, 250, 0.1);
  --moat-accent-border: rgba(96, 165, 250, 0.2);
  --moat-success: #10b981;
  --moat-success-light: rgba(16, 185, 129, 0.1);
  --moat-success-border: rgba(16, 185, 129, 0.2);
  --moat-error: #f87171;
  --moat-error-light: rgba(248, 113, 113, 0.1);
  --moat-error-border: rgba(248, 113, 113, 0.2);
  --moat-warning: #fbbf24;
  --moat-warning-light: rgba(251, 191, 36, 0.1);
  --moat-warning-border: rgba(251, 191, 36, 0.2);
  --moat-shadow: rgba(0, 0, 0, 0.3);
  --moat-shadow-lg: rgba(0, 0, 0, 0.4);
  --moat-notification-bg: #374151;
  --moat-notification-text: #f9fafb;
  
  /* Scrollbar colors for dark theme */
  --moat-scrollbar-track: transparent;
  --moat-scrollbar-thumb: #4b5563;
  --moat-scrollbar-thumb-hover: #6b7280;
}

/* Float Chrome Extension Styles */

/* Comment Mode */
body.float-comment-mode {
  cursor: crosshair !important;
}

body.float-comment-mode * {
  cursor: crosshair !important;
}

/* Element Highlight */
.float-highlight {
  outline: 2px solid #3B82F6 !important;
  outline-offset: 2px !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
  transition: all 0.2s ease !important;
}

/* Make sure containers are visible when highlighted */
.float-highlight:not(img):not(button):not(a):not(input) {
  min-height: 20px !important;
  min-width: 20px !important;
}

.float-highlight-pulse {
  animation: float-pulse 2s ease-in-out !important;
}

@keyframes float-pulse {
  0% {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    background-color: rgba(59, 130, 246, 0.1);
  }
  50% {
    outline: 4px solid #3B82F6;
    outline-offset: 4px;
    background-color: rgba(59, 130, 246, 0.2);
  }
  100% {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    background-color: rgba(59, 130, 246, 0.1);
  }
}

/* ========== HEADER NOTIFICATIONS ========== */
.float-header-notifications {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}

/* For vertical sidebar (right position) - position notifications at bottom */
.float-moat.float-moat-right .float-header-notifications {
  position: absolute;
  bottom: 0; /* At the bottom of the sidebar */
  left: 0;
  right: 0;
  margin: 0;
  padding: 8px 16px; /* Match the header padding exactly */
  background: var(--moat-bg-primary);
  backdrop-filter: blur(8px);
  z-index: 10;
  min-height: 40px; /* Ensure consistent height: 8px + 24px + 8px */
  box-sizing: border-box;
}

/* For vertical sidebar (left position) - position notifications at bottom (same as right) */
.float-moat.float-moat-left .float-header-notifications {
  position: absolute;
  bottom: 0; /* At the bottom of the sidebar */
  left: 0;
  right: 0;
  margin: 0;
  padding: 8px 16px; /* Match the header padding exactly */
  background: var(--moat-bg-primary);
  backdrop-filter: blur(8px);
  z-index: 10;
  min-height: 40px; /* Ensure consistent height: 8px + 24px + 8px */
  box-sizing: border-box;
}

.float-notification-container {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 24px;
  max-width: 280px;
  overflow: hidden;
}

/* For vertical sidebar - adjust container to full width but maintain height */
.float-moat.float-moat-right .float-notification-container {
  max-width: 100%;
  width: 100%;
  min-height: 24px; /* Keep the exact same min-height as bottom dock */
}

/* For vertical sidebar (left position) - adjust container to full width but maintain height (same as right) */
.float-moat.float-moat-left .float-notification-container {
  max-width: 100%;
  width: 100%;
  min-height: 24px; /* Keep the exact same min-height as bottom dock */
}

.float-header-notification {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--moat-accent-light);
  border: 1px solid var(--moat-accent-border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--moat-accent);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  opacity: 0;
  transform: translateX(20px);
  animation: slideInHeader 0.4s ease forwards;
  transition: all 0.2s ease;
}

@keyframes slideInHeader {
  0% {
    opacity: 0;
    transform: translateX(20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.float-header-notification.error {
  background: var(--moat-error-light);
  border-color: var(--moat-error-border);
  color: var(--moat-error);
}

.float-header-notification.warning {
  background: var(--moat-warning-light);
  border-color: var(--moat-warning-border);
  color: var(--moat-warning);
}

.float-header-notification.info {
  background: var(--moat-accent-light);
  border-color: var(--moat-accent-border);
  color: var(--moat-accent);
}

.float-header-notification.connected {
  background: var(--moat-success-light);
  border-color: var(--moat-success-border);
  color: var(--moat-success);
}

.float-header-notification.disconnected {
  background: var(--moat-error-light);
  border-color: var(--moat-error-border);
  color: var(--moat-error);
}

.float-header-notification-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.float-header-notification-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.float-header-notification.removing {
  animation: slideOutHeader 0.3s ease forwards;
}

@keyframes slideOutHeader {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* Floating Across the Moat Animation System */
@keyframes float-across-moat {
  0% {
    transform: translateX(-100vw) scale(0.8);
    opacity: 0.7;
    filter: blur(1px);
  }
  15% {
    opacity: 0.9;
    filter: blur(0.5px);
  }
  50% {
    transform: translateX(calc(50vw - 140px)) scale(0.95);
    opacity: 1;
    filter: blur(0px);
  }
  85% {
    transform: translateX(calc(100vw - 280px)) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: blur(0px);
  }
}

@keyframes float-gentle-settle {
  0% {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
  }
  50% {
    transform: translateY(5px) scale(0.98);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

@keyframes float-glow-fade {
  0% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(59, 130, 246, 0.4);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

/* Animation Classes */
.float-moat-item.float-floating {
  animation: float-across-moat 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  will-change: transform, opacity, filter;
  z-index: 100;
  position: relative;
}

.float-moat-item.float-settling {
  animation: float-gentle-settle 0.8s ease-out forwards,
             float-glow-fade 1.2s ease-out forwards;
  will-change: transform, box-shadow;
}

.float-moat-item.float-new-highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 197, 253, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.2);
  animation: float-new-item-pulse 3s ease-in-out;
}

@keyframes float-new-item-pulse {
  0%, 100% {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 197, 253, 0.05));
    border-color: rgba(59, 130, 246, 0.2);
  }
  50% {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(147, 197, 253, 0.08));
    border-color: rgba(59, 130, 246, 0.3);
  }
}

/* Staggered animation delays for multiple items */
.float-moat-item.float-floating:nth-of-type(1) { animation-delay: 0s; }
.float-moat-item.float-floating:nth-of-type(2) { animation-delay: 0.2s; }
.float-moat-item.float-floating:nth-of-type(3) { animation-delay: 0.4s; }
.float-moat-item.float-floating:nth-of-type(4) { animation-delay: 0.6s; }
.float-moat-item.float-floating:nth-of-type(5) { animation-delay: 0.8s; }

/* Enhanced visibility for floating items */
.float-moat.float-moat-bottom .float-moat-queue .float-moat-item.float-floating {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
}

/* Notification */
.float-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--moat-notification-bg);
  color: var(--moat-notification-text);
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  box-shadow: 0 4px 12px var(--moat-shadow-lg);
  z-index: 10002;
  animation: float-slide-up 0.3s ease;
  max-width: 300px;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.float-notification.float-error {
  background: var(--moat-error);
  color: white;
}

@keyframes float-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Comment Box */
.float-comment-box {
  position: fixed;
  width: 300px;
  background: var(--moat-bg-primary);
  border-radius: 8px;
  box-shadow: 0 4px 24px var(--moat-shadow-lg);
  padding: 16px;
  z-index: 10001;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Shake animation for comment box */
.float-shake {
  animation: float-shake 0.5s ease-in-out !important;
}

@keyframes float-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.float-comment-input {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--moat-border);
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--moat-bg-primary);
  color: var(--moat-text-primary);
}

.float-comment-input:focus {
  outline: none;
  border-color: var(--moat-accent);
}

.float-comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.float-comment-actions button {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  height: 32px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 1px 2px var(--moat-shadow);
}

.float-comment-cancel {
  background: var(--moat-bg-primary);
  color: var(--moat-text-secondary);
  border: 1px solid var(--moat-border);
}

.float-comment-cancel:hover {
  background: var(--moat-bg-secondary);
  color: var(--moat-text-primary);
  border-color: var(--moat-border-light);
  box-shadow: 0 1px 3px var(--moat-shadow);
}

.float-comment-submit {
  background: var(--moat-accent);
  color: white;
  font-weight: 500;
  border: 1px solid var(--moat-accent);
}

.float-comment-submit:hover {
  opacity: 0.9;
  box-shadow: 0 1px 3px var(--moat-shadow);
}

/* Moat Sidebar */
.float-moat {
  position: fixed;
  background: var(--moat-bg-primary);
  z-index: 10000;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}

/* Right position (default) */
.float-moat.float-moat-right {
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
}

.float-moat.float-moat-right.float-moat-visible {
  right: 0;
}

/* Left position */
.float-moat.float-moat-left {
  top: 0;
  left: -320px;
  width: 320px;
  height: 100vh;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
}

.float-moat.float-moat-left.float-moat-visible {
  left: 0;
}

/* Right position - Compact top bar layout */
.float-moat.float-moat-right .float-moat-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--moat-bg-secondary);
  border-bottom: 1px solid var(--moat-border);
  gap: 12px;
}

.float-moat.float-moat-right .float-moat-header {
  padding: 0;
  border-bottom: none;
  background: transparent;
  flex: none;
}

/* Hide Drawbridge text in right position, keep only logo */
.float-moat.float-moat-right .float-moat-header h3 {
  margin: 0;
  font-size: 0;
  color: transparent;
  display: flex;
  align-items: center;
}

.float-moat.float-moat-right .float-drawbridge-icon {
  width: 20px;
  height: 20px;
  fill: var(--moat-text-primary);
  flex-shrink: 0;
}

.float-moat.float-moat-right .float-moat-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

/* Compact project status for right position */
.float-moat.float-moat-right .float-moat-project-status-container {
  max-width: 120px;
}

.float-moat.float-moat-right .float-moat-project-dropdown {
  max-width: 120px;
  padding: 4px 8px;
  height: 28px;
  font-size: 11px;
  gap: 4px;
}

.float-moat.float-moat-right .float-project-label {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

/* Compact action buttons for right position */  
.float-moat.float-moat-right .float-moat-actions {
  gap: 8px;
}

.float-moat.float-moat-right .float-moat-actions button {
  width: 28px;
  height: 28px;
  padding: 4px;
}

.float-moat.float-moat-right .float-icon {
  width: 10px;
  height: 10px;
}

.float-moat.float-moat-right .float-project-folder-icon {
  width: 10px;
  height: 10px;
}

.float-moat.float-moat-right .float-project-divider {
  height: 12px;
}

/* Left position - Compact top bar layout (mirrors right position) */
.float-moat.float-moat-left .float-moat-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--moat-bg-secondary);
  border-bottom: 1px solid var(--moat-border);
  gap: 12px;
}

.float-moat.float-moat-left .float-moat-header {
  padding: 0;
  border-bottom: none;
  background: transparent;
  flex: none;
}

/* Hide Drawbridge text in left position, keep only logo */
.float-moat.float-moat-left .float-moat-header h3 {
  margin: 0;
  font-size: 0;
  color: transparent;
  display: flex;
  align-items: center;
}

.float-moat.float-moat-left .float-drawbridge-icon {
  width: 20px;
  height: 20px;
  fill: var(--moat-text-primary);
  flex-shrink: 0;
}

.float-moat.float-moat-left .float-moat-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

/* Compact project status for left position */
.float-moat.float-moat-left .float-moat-project-status-container {
  max-width: 120px;
}

.float-moat.float-moat-left .float-moat-project-dropdown {
  max-width: 120px;
  padding: 4px 8px;
  height: 28px;
  font-size: 11px;
  gap: 4px;
}

.float-moat.float-moat-left .float-project-label {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

/* Compact action buttons for left position */  
.float-moat.float-moat-left .float-moat-actions {
  gap: 8px;
}

.float-moat.float-moat-left .float-moat-actions button {
  width: 28px;
  height: 28px;
  padding: 4px;
}

.float-moat.float-moat-left .float-icon {
  width: 10px;
  height: 10px;
}

.float-moat.float-moat-left .float-project-folder-icon {
  width: 10px;
  height: 10px;
}

.float-moat.float-moat-left .float-project-divider {
  height: 12px;
}

/* Bottom position */
.float-moat.float-moat-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 80px;
  max-height: 50vh;
  width: 100vw;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  flex-direction: column;
}

.float-moat.float-moat-bottom.float-moat-visible {
  transform: translateY(0);
}

/* Bottom position - Top control bar */
.float-moat.float-moat-bottom .float-moat-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--moat-bg-secondary);
  border-bottom: 1px solid var(--moat-border);
  flex-shrink: 0;
  position: relative;
}

.float-moat.float-moat-bottom .float-moat-header {
  padding: 0;
  border-bottom: none;
  background: transparent;
  flex: none;
  min-width: 0;
  max-width: calc(50% - 120px); /* Ensure space for centered tabs */
}

.float-moat.float-moat-bottom .float-moat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--moat-text-primary);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.float-moat.float-moat-bottom .float-moat-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: calc(50% - 120px); /* Ensure space for centered tabs */
  overflow: hidden;
}

.float-moat.float-moat-bottom .float-moat-project-status {
  padding: 0;
  background: transparent;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.float-moat.float-moat-bottom .float-moat-header-actions {
  padding: 0;
  background: transparent;
  border-bottom: none;
  justify-content: flex-start;
  flex: none;
}

.float-moat.float-moat-bottom .float-moat-actions {
  flex: none;
}

.float-moat.float-moat-bottom .float-moat-queue {
  flex: 0 1 auto;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 16px;
  gap: 12px;
  display: flex;
  min-height: 0;
  height: 152px; /* Fixed height for consistent UI */
  max-height: 152px; /* Ensure it never exceeds this */
}

.float-moat.float-moat-bottom .float-moat-item {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
  margin-bottom: 0;
  margin-right: 12px;
}

.float-moat.float-moat-bottom .float-moat-item:last-child {
  margin-right: 0;
}

/* Legacy compatibility - treat no position class as right */
.float-moat:not(.float-moat-right):not(.float-moat-bottom):not(.float-moat-left) {
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
}

.float-moat:not(.float-moat-right):not(.float-moat-bottom):not(.float-moat-left).float-moat-visible {
  right: 0;
}

/* Connect Project Inline Content */
.float-moat-connect-project {
  padding: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

/* Bottom position connect project - fixed height */
.float-moat.float-moat-bottom .float-moat-connect-project {
  padding: 16px 16px 20px 16px; /* More bottom padding to prevent button cutoff */
  height: 152px; /* Fixed height to match queue container */
  box-sizing: border-box; /* Include padding in height calculation */
  overflow-y: auto; /* Allow scrolling if content overflows */
  justify-content: flex-start; /* Align content to top instead of center */
}

.float-moat-connect-header h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--moat-text-primary);
}

/* Bottom position: smaller header and reduced margins */
.float-moat.float-moat-bottom .float-moat-connect-header h3 {
  margin: 0 0 6px 0; /* Reduced margin */
  font-size: 16px; /* Smaller font */
}

.float-moat-connect-header p {
  margin: 0 0 20px 0;
  color: var(--moat-text-secondary);
  line-height: 1.5;
  font-size: 14px;
}

/* Bottom position: reduced margin and font size */
.float-moat.float-moat-bottom .float-moat-connect-header p {
  margin: 0 0 6px 0; /* Even smaller margin to fit in fixed height */
  font-size: 12px; /* Smaller font */
  line-height: 1.3; /* Tighter line height */
}

.float-moat-connect-header code {
  background: var(--moat-bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 13px;
  color: var(--moat-text-primary);
}

.float-moat-connect-features {
  background: var(--moat-bg-secondary);
  border-radius: 8px;
  padding: 16px;
  margin: 0 0 16px 0;
}

/* Bottom position: more compact features */
.float-moat.float-moat-bottom .float-moat-connect-features {
  padding: 6px; /* Even smaller padding */
  margin: 0 0 4px 0; /* Reduced margin to fit in fixed height */
}

.float-moat-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  color: var(--moat-text-primary);
  font-size: 14px;
}

/* Bottom position: more compact features */
.float-moat.float-moat-bottom .float-moat-feature {
  gap: 4px; /* Even smaller gap */
  margin: 2px 0; /* Even smaller margin to fit in fixed height */
  font-size: 12px; /* Smaller font */
}

.float-feature-check {
  font-size: 16px;
  flex-shrink: 0;
}

/* Bottom position: smaller check icons */
.float-moat.float-moat-bottom .float-feature-check {
  font-size: 14px; /* Smaller icon */
}

.float-moat-connect-note {
  font-size: 13px;
  color: var(--moat-text-tertiary);
  margin: 0 0 20px 0;
}

/* Bottom position: more compact note */
.float-moat.float-moat-bottom .float-moat-connect-note {
  font-size: 11px; /* Smaller font */
  margin: 0 0 4px 0; /* Even smaller margin to fit in fixed height */
}

.float-moat-connect-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Bottom position: more compact actions */
.float-moat.float-moat-bottom .float-moat-connect-actions {
  gap: 8px; /* Smaller gap */
}

.float-connect-cancel,
.float-connect-confirm {
  padding: 6px 18px;
  border: none;
  height: 32px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.float-connect-cancel {
  background: var(--moat-bg-tertiary);
  color: var(--moat-text-secondary);
  border: 1px solid var(--moat-border-light);
  border-radius: 6px;
  box-shadow: 0 1px 2px var(--moat-shadow);
}

.float-connect-cancel:hover {
  background: var(--moat-border);
  border-color: var(--moat-text-muted);
  box-shadow: 0 1px 3px var(--moat-shadow);
}

.float-connect-confirm {
  background: var(--moat-accent);
  color: white;
  border: 1px solid var(--moat-accent);
  border-radius: 6px;
  box-shadow: 0 1px 2px var(--moat-shadow);
}

.float-connect-confirm:hover {
  background: var(--moat-accent);
  opacity: 0.9;
  box-shadow: 0 1px 3px var(--moat-shadow);
}

.float-moat-header {
  padding: 16px;
  border-bottom: 1px solid var(--moat-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--moat-bg-secondary);
}

.float-moat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--moat-text-primary);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.float-moat-actions button {
  background: var(--moat-bg-primary);
  border: 1px solid var(--moat-border);
  cursor: pointer;
  padding: 6px;
  height: 32px;
  width: 32px;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--moat-text-tertiary);
  border-radius: 6px;
  box-shadow: 0 1px 2px var(--moat-shadow);
}

.float-moat-actions button:hover {
  background: var(--moat-bg-secondary);
  color: var(--moat-text-secondary);
  border-color: var(--moat-border-light);
  box-shadow: 0 1px 3px var(--moat-shadow);
}

/* Pixel Icon Styling */
.float-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
  transition: all 0.2s;
}

/* Drawbridge Logo Icon */
.float-drawbridge-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Right Controls Container */
.float-moat-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.float-moat-queue {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* For vertical sidebar - add bottom padding for notification space */
.float-moat.float-moat-right .float-moat-queue {
  padding-bottom: 56px; /* Space for potential notifications at bottom */
}

/* Left position queue - same as right position */
.float-moat.float-moat-left .float-moat-queue {
  padding-bottom: 56px; /* Space for potential notifications at bottom */
}

.float-moat-loading {
  text-align: center;
  color: var(--moat-text-muted);
  padding: 40px 20px;
  font-size: 14px;
}

/* Bottom position loading - fixed height */
.float-moat.float-moat-bottom .float-moat-loading {
  padding: 12px 16px; /* Much more compact to match other states */
  height: 152px; /* Fixed height to match queue container */
  box-sizing: border-box; /* Include padding in height calculation */
  display: flex;
  align-items: center;
  justify-content: center;
}

.float-moat-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  min-height: 200px;
  padding: 40px 20px;
}

/* Bottom position empty state - fixed height */
.float-moat.float-moat-bottom .float-moat-empty {
  height: 152px; /* Fixed height to match queue container */
  padding: 24px 16px 24px 16px; /* More padding at top and bottom to prevent cutoff */
  box-sizing: border-box; /* Include padding in height calculation */
  justify-content: flex-start; /* Align content to top instead of center */
}

.float-empty-content {
  text-align: center;
  color: var(--moat-text-muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Bottom position: reduce spacing between elements */
.float-moat.float-moat-bottom .float-empty-content {
  gap: 6px; /* Further reduced to fit better in fixed height */
}

.float-empty-content p {
  margin: 0;
}

.float-empty-icon {
  margin-bottom: 8px;
  color: var(--moat-text-muted);
  opacity: 0.6;
  transition: all 0.3s ease;
}

/* Bottom position: smaller icon and no margin */
.float-moat.float-moat-bottom .float-empty-icon {
  margin-bottom: 0; /* Remove margin */
}

.float-empty-icon svg {
  width: 32px;
  height: 32px;
}

/* Bottom position: smaller icon */
.float-moat.float-moat-bottom .float-empty-icon svg {
  width: 24px; /* Smaller icon */
  height: 24px;
}

.float-moat-hint {
  margin: 8px 0 0 0;
}

/* Bottom position: remove margin from hint */
.float-moat.float-moat-bottom .float-moat-hint {
  margin: 0;
}

.float-empty-connect-btn {
  background: #000000;
  color: white;
  border: 1px solid #4B5563;
  border-radius: 6px;
  padding: 6px 20px;
  height: 32px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Bottom position: remove margin from connect button */
.float-moat.float-moat-bottom .float-empty-connect-btn {
  margin-top: 0; /* Remove margin */
}

.float-empty-connect-btn:hover {
  background: #333333;
  border-color: #1F2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tab System - Two versions for different positions */

/* Tabs in header (for bottom-docked position) */
.float-moat-tabs-header {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
  margin: 0 12px;
}

/* Override flex behavior for bottom-docked moat - tabs are absolutely positioned */
.float-moat.float-moat-bottom .float-moat-top-bar .float-moat-tabs-header {
  flex: none;
  margin: 0;
}

/* Tabs below header (for right-docked position) */
.float-moat-tabs-below-header {
  padding: 12px 16px 8px 16px;
  background: var(--moat-bg-primary);
  border-bottom: 1px solid var(--moat-border);
  display: none; /* Hidden by default */
}

.float-tab-group {
  display: flex;
  background: var(--moat-bg-tertiary);
  border-radius: 6px;
  padding: 2px;
  gap: 1px;
}

.float-tab-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--moat-text-secondary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  white-space: nowrap;
}

.float-tab-btn:hover {
  color: var(--moat-text-primary);
  background: var(--moat-bg-primary);
}

.float-tab-btn.float-tab-active {
  background: var(--moat-bg-primary);
  color: var(--moat-text-primary);
  box-shadow: 0 1px 3px var(--moat-shadow);
  font-weight: 600;
}

.float-tab-badge {
  background: var(--moat-accent);
  color: white;
  border-radius: 8px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 600;
  min-width: 14px;
  text-align: center;
  line-height: 10px;
  display: none; /* Hidden by default, shown only when count > 0 */
}

.float-tab-btn.float-tab-active .float-tab-badge {
  background: var(--moat-accent);
}

.float-tab-btn[data-status="to do"] .float-tab-badge {
  background: #F59E0B; /* Orange for to-do */
}

.float-tab-btn[data-status="doing"] .float-tab-badge {
  background: #3B82F6; /* Blue for doing */
}

.float-tab-btn[data-status="done"] .float-tab-badge {
  background: #10B981; /* Green for done */
}

/* Hide tabs when empty state is shown */
.float-moat-queue .float-moat-empty ~ .float-moat-tabs-header,
.float-moat-queue .float-moat-connect-project ~ .float-moat-tabs-header,
.float-moat-queue:has(.float-moat-empty) ~ .float-moat-tabs-header,
.float-moat-queue:has(.float-moat-connect-project) ~ .float-moat-tabs-header,
.float-moat-queue .float-moat-empty ~ .float-moat-tabs-below-header,
.float-moat-queue .float-moat-connect-project ~ .float-moat-tabs-below-header,
.float-moat-queue:has(.float-moat-empty) ~ .float-moat-tabs-below-header,
.float-moat-queue:has(.float-moat-connect-project) ~ .float-moat-tabs-below-header {
  display: none;
}

/* Hide tabs when showing project connection or empty states */
.float-moat-tabs-header,
.float-moat-tabs-below-header {
  transition: opacity 0.2s ease;
}

.float-moat-tabs-header.hidden,
.float-moat-tabs-below-header.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Position-specific visibility rules */

/* Right-docked position: show tabs below header, hide tabs in header */
.float-moat.float-moat-right .float-moat-tabs-header,
.float-moat:not(.float-moat-bottom):not(.float-moat-left) .float-moat-tabs-header {
  display: none !important;
}

.float-moat.float-moat-right .float-moat-tabs-below-header,
.float-moat:not(.float-moat-bottom):not(.float-moat-left) .float-moat-tabs-below-header {
  display: block;
}

/* Right-docked position: make tabs fill full width */
.float-moat.float-moat-right .float-tab-group,
.float-moat:not(.float-moat-bottom):not(.float-moat-left) .float-tab-group {
  width: 100%;
}

.float-moat.float-moat-right .float-tab-btn,
.float-moat:not(.float-moat-bottom):not(.float-moat-left) .float-tab-btn {
  flex: 1; /* Make each tab expand to fill available space */
}

/* Left-docked position: make tabs fill full width (same as right) */
.float-moat.float-moat-left .float-tab-group {
  width: 100%;
}

.float-moat.float-moat-left .float-tab-btn {
  flex: 1; /* Make each tab expand to fill available space */
}

/* Left-docked position: show tabs below header, hide tabs in header (same as right) */
.float-moat.float-moat-left .float-moat-tabs-header {
  display: none !important;
}

.float-moat.float-moat-left .float-moat-tabs-below-header {
  display: block;
}

/* Bottom-docked position: show tabs in header, hide tabs below header */
.float-moat.float-moat-bottom .float-moat-tabs-header {
  display: flex;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  z-index: 10;
  pointer-events: auto;
}

.float-moat.float-moat-bottom .float-moat-tabs-below-header {
  display: none !important;
}

.float-moat.float-moat-bottom .float-tab-group {
  border-radius: 8px; /* Slightly larger radius for bottom position */
  padding: 3px; /* Slightly more padding for bottom position */
}

.float-moat.float-moat-bottom .float-tab-btn {
  padding: 8px 12px; /* Slightly larger padding for bottom position */
  font-size: 12px; /* Slightly larger font for bottom position */
  gap: 6px; /* More gap for bottom position */
}

.float-moat.float-moat-bottom .float-tab-badge {
  font-size: 10px; /* Slightly larger badge text for bottom position */
  padding: 2px 5px; /* More padding for bottom position */
  min-width: 16px; /* Larger min-width for bottom position */
  line-height: 12px; /* Better line height for bottom position */
}

/* Moat Item */
.float-moat-item {
  background: var(--moat-bg-secondary);
  border: 1px solid var(--moat-border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  cursor: grab;
  transition: all 0.2s;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

/* Hover effect removed per user request */

.float-moat-item.float-moat-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

/* Row 1: Status, Timestamp | Close button */
.float-moat-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.float-moat-status-and-time {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.float-moat-status-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--moat-text-tertiary);
  background: var(--moat-bg-tertiary);
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
  text-transform: lowercase;
}

.float-moat-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--moat-text-tertiary);
}

.float-moat-remove {
  background: transparent;
  border: 1px solid var(--moat-border);
  color: var(--moat-text-muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: 16px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.float-moat-remove:hover {
  background: var(--moat-error-light);
  color: var(--moat-error);
}

/* Row 2: User comment (lighter weight, closer to black) */
.float-moat-content {
  font-size: 14px;
  font-weight: 400;
  color: var(--moat-text-secondary);
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Row 3 & 4: Divider line + Target element info */
.float-moat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--moat-text-tertiary);
  margin: auto 0 0 0;
  padding: 8px 0 0 0;
  border-top: 1px solid var(--moat-border-light);
}

.float-moat-target {
  font-size: 12px;
  font-weight: 400;
  color: var(--moat-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}

.float-moat-selector {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: var(--moat-bg-tertiary);
  color: var(--moat-text-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Task 3.6: Enhanced status indicators */
.float-moat-item.float-status-to-do {
  border-left: 4px solid #F59E0B; /* Orange for to-do */
}

.float-moat-item.float-status-doing {
  border-left: 4px solid #3B82F6; /* Blue for doing */
}

.float-moat-item.float-status-done {
  border-left: 4px solid #10B981; /* Green for done */
  opacity: 0.7;
}

.float-moat-item.float-status-failed {
  border-left: 4px solid #EF4444; /* Red for failed */
}

/* Backward compatibility for old status names */
.float-moat-item.float-status-pending {
  border-left: 4px solid #F59E0B;
}

.float-moat-item.float-status-in-progress {
  border-left: 4px solid #3B82F6;
}

.float-moat-item.float-status-completed {
  border-left: 4px solid #10B981;
  opacity: 0.7;
}

.float-moat-completed {
  opacity: 0.7;
  border-color: var(--moat-border-light);
  background: var(--moat-bg-secondary);
}

.float-moat-completed .float-moat-target {
  text-decoration: line-through;
  color: var(--moat-text-tertiary);
}

.float-moat-completed .float-moat-content {
  color: var(--moat-text-tertiary);
  font-weight: 500;
}

/* Scrollbar styling for Moat - Right position */
.float-moat.float-moat-right .float-moat-queue::-webkit-scrollbar,
.float-moat:not(.float-moat-bottom):not(.float-moat-left) .float-moat-queue::-webkit-scrollbar {
  width: 6px;
}

.float-moat.float-moat-right .float-moat-queue::-webkit-scrollbar-track,
.float-moat:not(.float-moat-bottom):not(.float-moat-left) .float-moat-queue::-webkit-scrollbar-track {
  background: var(--moat-scrollbar-track);
}

.float-moat.float-moat-right .float-moat-queue::-webkit-scrollbar-thumb,
.float-moat:not(.float-moat-bottom):not(.float-moat-left) .float-moat-queue::-webkit-scrollbar-thumb {
  background: var(--moat-scrollbar-thumb);
  border-radius: 3px;
}

.float-moat.float-moat-right .float-moat-queue::-webkit-scrollbar-thumb:hover,
.float-moat:not(.float-moat-bottom):not(.float-moat-left) .float-moat-queue::-webkit-scrollbar-thumb:hover {
  background: var(--moat-scrollbar-thumb-hover);
}

/* Scrollbar styling for Moat - Left position (same as right) */
.float-moat.float-moat-left .float-moat-queue::-webkit-scrollbar {
  width: 6px;
}

.float-moat.float-moat-left .float-moat-queue::-webkit-scrollbar-track {
  background: var(--moat-scrollbar-track);
}

.float-moat.float-moat-left .float-moat-queue::-webkit-scrollbar-thumb {
  background: var(--moat-scrollbar-thumb);
  border-radius: 3px;
}

.float-moat.float-moat-left .float-moat-queue::-webkit-scrollbar-thumb:hover {
  background: var(--moat-scrollbar-thumb-hover);
}

/* Scrollbar styling for Moat - Bottom position */
.float-moat.float-moat-bottom .float-moat-queue::-webkit-scrollbar {
  height: 6px;
}

.float-moat.float-moat-bottom .float-moat-queue::-webkit-scrollbar-track {
  background: var(--moat-scrollbar-track);
}

.float-moat.float-moat-bottom .float-moat-queue::-webkit-scrollbar-thumb {
  background: var(--moat-scrollbar-thumb);
  border-radius: 3px;
}

.float-moat.float-moat-bottom .float-moat-queue::-webkit-scrollbar-thumb:hover {
  background: var(--moat-scrollbar-thumb-hover);
}

.float-project-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  transition: all 0.3s ease;
}

.float-project-indicator.float-project-connected {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.float-project-indicator.float-project-disconnected {
  background: #dc2626;
}

.float-project-label {
  font-size: 12px;
  color: var(--moat-text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* New Comment Button */
.float-moat-new-comment-container {
  /* Spacing handled by parent gap: 12px */
}

.float-moat-new-comment-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--moat-bg-primary);
  border: 1px solid var(--moat-border);
  border-radius: 6px;
  color: var(--moat-text-tertiary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 32px;
  box-sizing: border-box;
  font-family: inherit;
  box-shadow: 0 1px 2px var(--moat-shadow);
}

.float-moat-new-comment-btn:hover {
  background: var(--moat-bg-secondary);
  border-color: var(--moat-border-light);
  color: var(--moat-text-secondary);
  box-shadow: 0 1px 3px var(--moat-shadow);
}

.float-comment-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

.float-comment-text {
  font-size: 12px;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
}

/* Compact styling for right position */
.float-moat.float-moat-right .float-moat-new-comment-container {
  /* Spacing handled by parent gap */
}

.float-moat.float-moat-right .float-moat-new-comment-btn {
  padding: 6px;
  height: 28px;
  width: 28px;
  font-size: 11px;
  gap: 4px;
}

.float-moat.float-moat-right .float-comment-icon {
  width: 12px;
  height: 12px;
}

.float-moat.float-moat-right .float-comment-text {
  display: none;
}

/* Compact styling for left position (same as right) */
.float-moat.float-moat-left .float-moat-new-comment-container {
  /* Spacing handled by parent gap */
}

.float-moat.float-moat-left .float-moat-new-comment-btn {
  padding: 6px;
  height: 28px;
  width: 28px;
  font-size: 11px;
  gap: 4px;
}

.float-moat.float-moat-left .float-comment-icon {
  width: 12px;
  height: 12px;
}

.float-moat.float-moat-left .float-comment-text {
  display: none;
}

/* New Project Dropdown Styling */
.float-moat-project-status-container {
  position: relative;
}

.float-moat-project-dropdown {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  height: 32px;
  background: var(--moat-bg-primary);
  border: 1px solid var(--moat-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-family: inherit;
  color: var(--moat-text-tertiary);
  box-shadow: 0 1px 2px var(--moat-shadow);
}

.float-moat-project-dropdown:hover {
  background: var(--moat-bg-secondary);
  border-color: var(--moat-border-light);
  box-shadow: 0 1px 3px var(--moat-shadow);
}

.float-project-folder-icon {
  width: 12px;
  height: 12px;
  fill: var(--moat-text-tertiary);
  transition: fill 0.2s;
  flex-shrink: 0;
}

.float-moat-project-dropdown:hover .float-project-folder-icon {
  fill: var(--moat-text-secondary);
}

.float-project-divider {
  width: 1px;
  height: 16px;
  background: var(--moat-border);
  flex-shrink: 0;
  margin: 0 2px;
}

.float-project-chevron {
  width: 12px;
  height: 12px;
  margin-left: auto;
  opacity: 0.6;
  transition: transform 0.2s;
  fill: var(--moat-text-tertiary);
}

.float-moat-project-dropdown:hover .float-project-chevron {
  opacity: 1;
  fill: var(--moat-text-secondary);
}

.float-moat-more-btn {
  background: var(--moat-bg-primary);
  border: 1px solid var(--moat-border);
  border-radius: 6px;
  padding: 6px;
  height: 32px;
  width: 32px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--moat-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px var(--moat-shadow);
}

.float-moat-more-btn:hover {
  background: var(--moat-bg-secondary);
  color: var(--moat-text-secondary);
  border-color: var(--moat-border-light);
  box-shadow: 0 1px 3px var(--moat-shadow);
}

.float-moat-more-btn .float-icon {
  width: 12px;
  height: 12px;
}

/* Project Menu */
.float-project-menu {
  position: fixed;
  background: var(--moat-bg-primary);
  border: 1px solid var(--moat-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--moat-shadow);
  z-index: 10003;
  overflow: hidden;
  min-width: 200px;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.float-project-menu-item {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--moat-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.float-project-menu-item:hover {
  background: var(--moat-bg-secondary);
}

.float-project-menu-item[data-action="disconnect"]:hover {
  background: var(--moat-error-light);
}

.float-project-menu-divider {
  border-top: 1px solid var(--moat-border);
}

.float-project-menu-item span {
  font-size: 13px;
  font-weight: 500;
}

.float-project-menu-item svg {
  flex-shrink: 0;
}

/* More Menu */
.float-more-menu {
  position: fixed;
  background: var(--moat-bg-primary);
  border: 1px solid var(--moat-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--moat-shadow);
  z-index: 10003;
  overflow: hidden;
  min-width: 160px;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.float-more-menu-item {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--moat-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.float-more-menu-item:hover {
  background: var(--moat-bg-secondary);
}

.float-more-menu-item span {
  font-size: 13px;
  font-weight: 500;
}

.float-more-menu-item svg {
  flex-shrink: 0;
}

/* Modal */
.float-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10004;
  animation: float-fade-in 0.2s ease;
}

@keyframes float-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.float-modal {
  background: var(--moat-bg-primary);
  border-radius: 12px;
  padding: 24px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 40px var(--moat-shadow-lg);
  animation: float-modal-slide 0.3s ease;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes float-modal-slide {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.float-modal h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
  color: var(--moat-text-primary);
}

.float-modal p {
  margin: 0 0 16px 0;
  color: var(--moat-text-secondary);
  line-height: 1.5;
}

.float-modal code {
  background: var(--moat-bg-tertiary);
  color: var(--moat-text-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 13px;
}

.float-modal-features {
  background: var(--moat-bg-secondary);
  border-radius: 8px;
  padding: 16px;
  margin: 0 0 16px 0;
}

.float-modal-features div {
  margin: 8px 0;
  color: var(--moat-text-primary);
  font-size: 14px;
}

.float-modal-note {
  font-size: 13px;
  color: var(--moat-text-tertiary);
  margin-bottom: 20px;
}

.float-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.float-modal-actions button {
  padding: 6px 18px;
  border: none;
  height: 32px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.float-modal-cancel {
  background: var(--moat-bg-tertiary);
  color: var(--moat-text-secondary);
  border: 1px solid var(--moat-border-light);
  border-radius: 6px;
  box-shadow: 0 1px 2px var(--moat-shadow);
}

.float-modal-cancel:hover {
  background: var(--moat-border);
  border-color: var(--moat-text-muted);
  box-shadow: 0 1px 3px var(--moat-shadow);
}

.float-modal-confirm {
  background: var(--moat-accent);
  color: white;
  border: 1px solid var(--moat-accent);
  border-radius: 6px;
  box-shadow: 0 1px 2px var(--moat-shadow);
}

.float-modal-confirm:hover {
  background: var(--moat-accent);
  opacity: 0.9;
  box-shadow: 0 1px 3px var(--moat-shadow);
}

/* Float Badge styles removed - badge feature disabled */

/* Protocol Status in Moat */
.float-moat-protocol-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.float-protocol-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  transition: all 0.3s ease;
}

.float-protocol-indicator.connected {
  background: #00ff00;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.float-protocol-indicator.disconnected {
  background: #ff0000;
}

.float-protocol-indicator.ag-ui {
  animation: pulse-ag-ui 2s infinite;
}

@keyframes pulse-ag-ui {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

/* Annotation Progress Messages */
.float-annotation-progress {
  display: none;
  padding: 6px 10px;
  background: rgba(0, 123, 255, 0.1);
  border-left: 3px solid #007bff;
  margin-top: 8px;
  font-size: 12px;
  color: #007bff;
  border-radius: 4px;
  animation: slideIn 0.3s ease;
}

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

/* Code Change Preview */
.float-code-change-preview {
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  font-size: 12px;
}

.float-change-description {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.float-change-diff {
  background: #f5f5f5;
  padding: 8px;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre;
}

/* Status-specific card styles */
.float-annotation-card.float-status-in_progress {
  border-left-color: #007bff;
  background: rgba(0, 123, 255, 0.05);
}

.float-annotation-card.float-status-resolved {
  border-left-color: #28a745;
  background: rgba(40, 167, 69, 0.05);
}

.float-annotation-card.float-status-queued {
  border-left-color: #ffc107;
  background: rgba(255, 193, 7, 0.05);
}

/* Moat Controls Update */
.float-moat-controls {
  display: flex;
  align-items: center;
  gap: 10px;
} 

/* Pulse animation for successful markdown updates */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}