/* Test Series Floating Suggestion Card - Smart Match Design */
.ts-float-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  overflow: hidden;
  transform: translateY(120%) scale(0.95);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.ts-float-card.ts-float-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Header */
.ts-float-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
}

.ts-float-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.ts-float-title i {
  color: #22d3ee;
  font-size: 16px;
}

.ts-float-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ts-float-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.ts-float-close i {
  font-size: 12px;
}

/* Insight banner */
.ts-float-insight {
  padding: 10px 16px;
  background: linear-gradient(90deg, #ecfdf5 0%, #f0fdf4 100%);
  font-size: 12px;
  color: #047857;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #d1fae5;
}

.ts-float-insight i {
  color: #10b981;
  font-size: 14px;
}

/* List items */
.ts-float-list {
  padding: 8px 0;
  max-height: 320px;
  overflow-y: auto;
}

.ts-float-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.ts-float-item:last-child {
  border-bottom: none;
}

.ts-float-item:hover {
  background: #f8fafc;
}

.ts-float-item-content {
  flex: 1;
  min-width: 0;
}

.ts-float-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ts-float-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

/* Match indicator - the key insight element */
.ts-match-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
  color: #1d4ed8;
  white-space: nowrap;
  flex-shrink: 0;
}

.ts-match-indicator i {
  color: #2563eb;
  font-size: 11px;
}

/* Snippet - the intelligent preview */
.ts-float-snippet {
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
  margin: 6px 0 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-left: 3px solid #3b82f6;
  border-radius: 0 6px 6px 0;
  font-style: italic;
}

.ts-float-snippet mark {
  background: #fef08a;
  color: #854d0e;
  padding: 0 2px;
  border-radius: 2px;
  font-style: normal;
  font-weight: 600;
}

.ts-float-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ts-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
}

.ts-meta-badge i {
  font-size: 10px;
}

.ts-meta-subject {
  background: #ede9fe;
  color: #6d28d9;
}

.ts-float-arrow {
  color: #cbd5e1;
  font-size: 18px;
  transition: all 0.2s;
  margin-top: 4px;
  flex-shrink: 0;
}

.ts-float-item:hover .ts-float-arrow {
  color: #3b82f6;
  transform: translateX(3px);
}

/* Footer */
.ts-float-footer {
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ts-float-footer i {
  color: #f59e0b;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .ts-float-card {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    border-radius: 12px;
  }
  
  .ts-float-item-header {
    flex-direction: column;
    gap: 4px;
  }
  
  .ts-float-item-title {
    font-size: 12px;
  }
  
  .ts-float-snippet {
    font-size: 10px;
    padding: 6px 8px;
  }
  
  .ts-meta-badge {
    font-size: 9px;
  }
}

/* Scrollbar styling */
.ts-float-list::-webkit-scrollbar {
  width: 4px;
}

.ts-float-list::-webkit-scrollbar-track {
  background: transparent;
}

.ts-float-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Animation for items */
.ts-float-item {
  animation: ts-slide-in 0.35s ease-out forwards;
  opacity: 0;
  transform: translateX(-10px);
}

.ts-float-item:nth-child(1) { animation-delay: 0.15s; }
.ts-float-item:nth-child(2) { animation-delay: 0.25s; }
.ts-float-item:nth-child(3) { animation-delay: 0.35s; }

@keyframes ts-slide-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Pulse animation for match indicator */
.ts-match-indicator {
  animation: ts-pulse 2s ease-in-out infinite;
}

@keyframes ts-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
  50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
}
