/* Tags & Baskets Styles */

/* Tag hover cursor */
.tag-clickable {
  cursor: pointer;
}

.tag-clickable:hover {
  cursor: pointer;
}

/* Tag Card */
.tag-card {
    background: linear-gradient(135deg, 
    rgba(var(--color-bg-primary), 0.95), 
    rgba(var(--color-bg-secondary), 0.8)
  );
}

.tag-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Tag Card Structure - Similar to Judgment Card */
.tag-card-header {
  margin-bottom: 0.5rem;
}

.tag-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: rgb(var(--color-text-primary));
  line-height: 1.4;
}

.tag-card-meta {
  font-size: 0.75rem;
  color: rgb(var(--color-text-muted));
  margin-top: 0.5rem;
}

.tag-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag-card-meta-item {
  display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tag-card-meta-icon {
  font-weight: 600;
}

.tag-card-content {
  margin-bottom: 0.5rem;
}

.tag-card-footer {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(var(--color-border));
}

.tag-card-actions {
  display: flex;
    gap: 0.5rem;
  min-width: 0;
}

.tag-icon {
  margin-right: 0.25rem;
}

/* Tag Card Responsive Design */
/* Desktop: Show header actions, hide footer actions */
@media (min-width: 769px) {
  .tag-card-header .tag-card-actions {
    display: flex;
  }
  
  .tag-card-footer {
    display: none;
  }
}

/* Mobile: Hide header actions, show footer actions */
@media (max-width: 768px) {
  .tag-card-title {
    font-size: 1rem;
  }
  
  .tag-card-header .tag-card-actions {
    display: none;
  }
  
  .tag-card-footer {
    display: block;
  }
  
  .tag-card-header .flex {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .tag-card-footer .flex {
    gap: 0.25rem;
  }
  
  .tag-card-meta-row {
    gap: 0.5rem;
  }
}

.tag-search-result {
  padding: 0.75rem;
  background-color: rgb(var(--color-bg-tertiary));
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--color-border));
  margin-bottom: 0.5rem;
}

.tag-search-result-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.tag-search-result-info {
  flex: 1;
  min-width: 0;
}

.tag-search-result-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--color-text-primary));
  margin-bottom: 0.25rem;
}

.tag-badge {
  display: inline-flex;
    align-items: center;
    padding-left: 0.5rem; padding-right: 0.5rem;
    padding-top: 0.25rem; padding-bottom: 0.25rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgb(var(--color-border));
}

.tag,
.tag-item {
  display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: rgb(var(--color-bg-primary));
    border: 1px solid rgb(var(--color-border));
    border: 1px solid rgb(var(--color-border));
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}


/* Tag Card - Similar to Judgment Card */
.tag-card {
  background: linear-gradient(135deg, 
    rgba(var(--color-bg-primary), 0.95), 
    rgba(var(--color-bg-secondary), 0.8)
  ) !important;
  border: 1px solid rgb(var(--color-border)) !important;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  padding: 0.75rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease-in-out;
  padding: 0.75rem;
}

.tag-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark mode tag cards */
.dark .tag-card {
  background: linear-gradient(135deg, 
    rgba(75, 85, 99, 0.25),  /* lighter gray */
    rgba(107, 114, 128, 0.18)  /* even lighter gray */
  ) !important;
  border: 1px solid rgb(var(--color-border)) !important;
}

/* Tag Card Structure - Similar to Judgment Card */
.tag-card-header {
  margin-bottom: 0.5rem;
}

.tag-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: rgb(var(--color-text-primary));
  line-height: 1.4;
}

.tag-card-meta {
  font-size: 0.75rem;
  color: rgb(var(--color-text-muted));
  margin-top: 0.5rem;
}

.tag-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag-card-meta-item {
  display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tag-card-meta-icon {
  font-weight: 600;
    /* Unknown: mr-1 */;
}

.tag-card-content {
  margin-bottom: 0.5rem;
}

.tag-card-footer {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(var(--color-border));
}

.tag-card-actions {
  display: flex;
    gap: 0.5rem;
  min-width: 0;
}



.tag-icon {
  margin-right: 0.25rem;
}

/* Tag Card Responsive Design */
/* Desktop: Show header actions, hide footer actions */
@media (min-width: 769px) {
  .tag-card-header .tag-card-actions {
    display: flex;
  }
  
  .tag-card-footer {
    display: none;
  }
}

/* Mobile: Hide header actions, show footer actions */
@media (max-width: 768px) {
  .tag-card-title {
    font-size: 1rem;
  }
  
  .tag-card-header .tag-card-actions {
    display: none;
  }
  
  .tag-card-footer {
    display: block;
  }
  
  .tag-card-header .flex {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .tag-card-footer .flex {
    gap: 0.25rem;
  }
  
  .tag-card-meta-row {
    gap: 0.5rem;
  }
}

.tag-search-result {
  padding: 0.75rem;
  background-color: rgb(var(--color-bg-tertiary));
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--color-border));
  margin-bottom: 0.5rem;
}

.tag-search-result-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.tag-search-result-info {
  flex: 1;
  min-width: 0;
}

.tag-search-result-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--color-text-primary));
  margin-bottom: 0.25rem;
}

.tag-search-result-parents {
  font-size: 0.75rem;
  color: rgb(var(--color-text-secondary));
  margin-bottom: 0.5rem;
}

.tag-search-result-description {
  font-size: 0.875rem;
  color: rgb(var(--color-text-secondary));
  margin-bottom: 0.5rem;
}

.tag-search-result-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.tag-display {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid rgb(var(--color-border));
  background-color: rgb(var(--color-bg-secondary));
  color: rgb(var(--color-text-secondary));
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.tag-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.tag-display:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  border-color: currentColor;
}

.tag-display:hover::before {
  left: 100%;
}

/* Special styling for tags with colors */
.tag-display[data-tag-color] {
  border-width: 1px;
  font-weight: 600;
}

.tag-display[data-tag-color]:hover {
  filter: brightness(1.02);
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

/* Ensure clickable tags are clearly interactive */
.tag-display[data-tags-modal] {
  cursor: pointer;
  user-select: none;
}

.tag-display[data-tags-modal]:hover {
  cursor: pointer;
}

.tag-display[data-tags-modal]:active {
  transform: translateY(0);
  opacity: 0.9;
}


.tag {
  display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding-left: 0.75rem; padding-right: 0.75rem;
    /* Unknown: py-1.5 */;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
  background-color: rgb(var(--color-bg-tertiary));
  border: 1px solid rgb(var(--color-border));
  color: rgb(var(--color-text-primary));
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  line-height: 1;
}

.tag::before {
  content: "🏷️";
  font-size: 0.75rem;
  opacity: 0.8;
}

.tag:hover {
  background-color: rgb(var(--color-primary));
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-color: rgb(var(--color-primary));
}

.tag:hover::before {
  opacity: 1;
}

.card-list-tags {
  max-height: 400px;
  overflow-y: auto;
}


.judgment-count-badge,
.law-count-badge {
  padding: 1px 4px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  min-width: 16px;
  text-align: center;
}

.judgment-count-badge {
  background-color: rgb(var(--color-bg-secondary));
  color: rgb(var(--color-text-secondary));
  &::before {
    content: "⚖️";
    margin-right: 2px;
    font-size: 0.85em;
    opacity: 0.8;
  }
}
.law-count-badge {
  background-color: rgb(var(--color-bg-secondary));
  color: rgb(var(--color-text-secondary));
  &::before {
    content: "📕";
    margin-right: 2px;
    font-size: 0.85em;
    opacity: 0.8;
  }
}

.folder-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dark .folder-badge {
  border-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.tag-children {
  overflow: visible !important;
  transition: all 0.3s ease;
}

.tag-children.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.tag-children.expanded {
  max-height: none !important;
  height: auto !important;
  opacity: 1 !important;
  margin-top: 4px;
  overflow: visible !important;
  display: block !important;
  visibility: visible !important;
}

/* Tree node content structure */
.tree-node-content {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  background: transparent;
  min-height: 40px;
  gap: 8px;
}

.tree-node-content:hover {
  background: rgba(var(--color-bg-secondary), 0.05);
}

.dark .tree-node-content:hover {
  background: rgba(var(--color-bg-secondary), 0.1);
}

.tree-node-main {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 12px;
}

.tree-node-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Empty state styling */
.tree-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: #6b7280;
}

.dark .tree-empty-state {
  color: #9ca3af;
}

.tree-empty-content {
  text-align: center;
}

.tree-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.tree-empty-title {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: #374151;
}

.dark .tree-empty-title {
  color: #f9fafb;
}

.tree-empty-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
}

.dark .tree-empty-subtitle {
  color: #9ca3af;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .tree-node-content {
    padding: 6px 8px;
    min-height: 36px;
  }
  
  .tree-node-actions {
    gap: 2px;
    margin-left: 4px;
  }
  
  .search-btn {
    padding: 3px 6px;
    font-size: 10px;
  }
  
  .tree-node-icon {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }
  
  .tree-node-title {
    font-size: 13px;
  }
  
  .tree-node-subtitle {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .tree-node-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .tree-node-main {
    width: 100%;
  }
  
  .tree-node-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }
}

* Tag chip animation */
.tag-chip {
  position: relative;
}

.tag-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tag-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  color: currentColor;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.6;
}

.tag-chip-remove:hover {
  opacity: 1;
  background: rgba(220, 38, 38, 0.2);
  color: rgb(220, 38, 38);
  transform: scale(1.1);
}

/* Tag search result items (used in assignment modal) */
.tag-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--color-border));
  background: rgb(var(--color-bg-primary));
  transition: all 0.2s;
}

.tag-search-item:hover {
  background: rgb(var(--color-bg-secondary));
  border-color: rgb(var(--color-primary));
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tag-chip:not([style]) {
  background-color: rgb(var(--color-bg-secondary, 248 250 252));
  border-color: rgb(var(--color-border, 226 232 240));
  color: rgb(var(--color-text-secondary, 71 85 105));
}

.dark .tag-chip:not([style]) {
  background-color: rgb(var(--color-bg-tertiary, 30 41 59));
  border-color: rgb(var(--color-border, 71 85 105));
  color: rgb(var(--color-text-secondary, 148 163 184));
}

/* Tag Tree Shared Styles */

#tags-hierarchy-view {
  min-height: 800px;
  height: auto;
  overflow-y: auto;
  border: 1px solid rgb(var(--color-border));
  border-radius: 8px;
  background: rgb(var(--color-bg-primary));
}

.tag-tree-container {
  height: auto;
  border-radius: 8px;
  background: rgb(var(--color-bg-primary));
}

.tree-nodes {
  padding: 8px;
  height: auto;
}


/* Expand button - exactly 24px like icon */
.tree-expand-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
  font-size: 10px;
  color: rgb(var(--color-text-secondary));
  flex-shrink: 0;
}

.tree-expand-btn:hover {
  color: rgb(var(--color-primary));
}

.tree-expand-btn.expanded {
  transform: rotate(90deg);
}

/* Placeholder for nodes without children - exactly 24px like button */
.tree-expand-placeholder {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  flex-shrink: 0;
}

/* Icon - exactly 24px like button */
.tree-node-icon {
  position: relative;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tree-node-icon-emoji {
  font-size: 14px;
  line-height: 1;
}

/* Children container - collapsed by default */
.tree-node-children {
  display: none;
  overflow: hidden;
}

.tree-node-children.expanded {
  display: block;
}

.tree-node-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-right: 12px;
  margin-left: 12px;
}

.tree-node-title {
  font-weight: 500;
  color: rgb(var(--color-text-primary));
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  padding: 2px 0;
}

.tree-node-subtitle {
  font-size: 0.75rem;
  color: rgb(var(--color-text-secondary));
  line-height: 1.4;
}

.folder-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid rgb(var(--color-bg-primary));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Tags view mode - clickable links */
.tree-node-link {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 0;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  border-radius: 4px;
  padding: 4px;
  margin: -4px;
}

.tree-node-link:hover {
  background: rgba(var(--color-primary), 0.1);
}

.tree-node-link:hover .tree-node-title {
  color: rgb(var(--color-primary));
}

.tree-node-link:hover .tree-node-icon {
  transform: scale(1.1);
}

/* Judgment filter mode - basket buttons */
.tree-node-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.search-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
  min-width: 42px;
  text-align: center;
}

.search-btn-any,
.basket-btn-any {
  color: #1d4ed8;
  background-color: #dbeafe;
  border-color: #93c5fd;
}

.search-btn-any:hover,
.basket-btn-any:hover {
  background-color: #bfdbfe;
  border-color: #60a5fa;
}

.dark .search-btn-any,
.dark .basket-btn-any {
  color: #93c5fd;
  background-color: #1e3a8a;
  border-color: #3b82f6;
}

.dark .search-btn-any:hover,
.dark .basket-btn-any:hover {
  background-color: #1e40af;
  border-color: #2563eb;
}

.search-btn-all,
.basket-btn-all {
  color: #166534;
  background-color: #dcfce7;
  border-color: #86efac;
}

.search-btn-all:hover,
.basket-btn-all:hover {
  background-color: #bbf7d0;
  border-color: #4ade80;
}

.dark .search-btn-all,
.dark .basket-btn-all {
  color: #86efac;
  background-color: #14532d;
  border-color: #22c55e;
}

.dark .search-btn-all:hover,
.dark .basket-btn-all:hover {
  background-color: #166534;
  border-color: #16a34a;
}

.search-btn-none,
.basket-btn-none {
  color: #dc2626;
  background-color: #fee2e2;
  border-color: #fca5a5;
}

.search-btn-none:hover,
.basket-btn-none:hover {
  background-color: #fecaca;
  border-color: #f87171;
}

.dark .search-btn-none,
.dark .basket-btn-none {
  color: #fca5a5;
  background-color: #7f1d1d;
  border-color: #ef4444;
}

.dark .search-btn-none:hover,
.dark .basket-btn-none:hover {
  background-color: #991b1b;
  border-color: #dc2626;
}

/* Active/selected basket button states */
.basket-btn.font-bold.ring-2 {
  font-weight: 700;
}

.basket-btn.font-bold.ring-2.basket-btn-any {
  background-color: #3b82f6;
  color: white;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.basket-btn.font-bold.ring-2.basket-btn-all {
  background-color: #22c55e;
  color: white;
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.basket-btn.font-bold.ring-2.basket-btn-none {
  background-color: #ef4444;
  color: white;
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .tree-node-content {
    padding: 6px 8px;
    min-height: 36px;
  }
  
  .tree-node-actions {
    gap: 2px;
    margin-left: 4px;
  }
  
  .search-btn {
    padding: 3px 6px;
    font-size: 10px;
    min-width: 38px;
  }
  
  .tree-node-title {
    font-size: 13px;
  }
  
  .tree-node-subtitle {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .tree-node-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .tree-node-main {
    width: 100%;
  }
  
  .tree-node-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }
}

/* Tag relationship editing */
.tag-relationship-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(var(--color-border));
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: rgb(var(--color-bg-secondary));
}

.tag-chip-remove {
  margin-left: 0.5rem;
  color: rgb(var(--color-danger));
  cursor: pointer;
}

.tag-chip-remove:hover {
  color: rgb(var(--color-danger-hover));
}

.tag-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.375rem;
  background-color: rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
}

.tag-search-results {
  position: absolute;
  z-index: 9999;
  width: 100%;
  margin-top: 0.25rem;
  background-color: rgb(var(--color-bg-primary));
  border-radius: 0.5rem;
  max-height: 24rem;
  overflow-y: auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgb(var(--color-border));
}

/* Ensure search results in modals are not clipped */
.modal-content .tag-search-results {
  z-index: 10000;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 20rem;
}

/* Specific positioning for tag assignment modal */
#assigned-search-results {
  z-index: 10000;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 20rem;
}

/* Ensure search input containers in modals don't clip results */
.modal-content .relative {
  overflow: visible;
}

/* Override modal body overflow only for search containers */
.modal-content .relative .tag-search-results {
  position: absolute;
  z-index: 10000;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 20rem;
  overflow-y: auto;
}

/* Ensure search results can extend beyond modal boundaries */


.tag-search-result-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.tag-search-result-item:hover {
  background-color: rgb(var(--color-bg-secondary));
}

/* Tag relationship search results styling */
.tag-relationship-search-item {
  border-bottom: 1px solid rgb(var(--color-border-light));
  transition: all 0.2s ease;
}

.tag-relationship-search-item:last-child {
  border-bottom: none;
}

.tag-relationship-search-item:hover {
  background-color: rgb(var(--color-bg-secondary));
}

.tag-relationship-icon-container {
  background-color: rgb(var(--color-bg-tertiary));
  transition: all 0.2s ease;
}

.tag-relationship-search-item:hover .tag-relationship-icon-container {
  background-color: rgb(var(--color-bg-quaternary));
}

.tag-relationship-icon {
  color: rgb(var(--color-text-secondary));
}

.tag-relationship-icon-fallback {
  color: rgb(var(--color-text-muted));
}

.tag-relationship-name {
  color: rgb(var(--color-text-primary));
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.tag-relationship-description {
  color: rgb(var(--color-text-secondary));
  line-height: 1.375rem;
}

.tag-relationship-usage-badge {
  background-color: rgb(var(--color-info-light));
  color: rgb(var(--color-info-dark));
}

.tag-relationship-meta {
  color: rgb(var(--color-text-muted));
}

.tag-relationship-id {
  background-color: rgb(var(--color-bg-tertiary));
  color: rgb(var(--color-text-secondary));
}

.tag-relationship-color-preview {
  border-color: rgb(var(--color-border));
}

.tag-relationship-empty {
  color: rgb(var(--color-text-muted));
}

.tag-relationship-empty div {
  color: rgb(var(--color-text-muted));
}

/* Dynamic font sizing for tag names */
.tag-relationship-name {
  font-size: clamp(0.75rem, 2.5vw, 0.875rem);
}

.tag-relationship-description {
  font-size: clamp(0.75rem, 2vw, 0.875rem);
}

