/* ==========================================================================
   Design Studio Component Annotation System
   Non-intrusive, elevated badge tags for identified components
   ========================================================================== */

/* Ensure only elements actively containing a badge establish positioning */
[data-component-name],
.ds-component-badge-parent {
  position: relative;
}

/* Badges are completely HIDDEN by default so templates remain 100% clean and authentic */
.ds-component-badge {
  display: none !important;
}

/* Only render component badges when explicitly activated via Studio Template Options */
body.show-annotations .ds-component-badge {
  display: inline-flex !important;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 999;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(10, 10, 12, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f4f4f5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  pointer-events: auto;
  cursor: help;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  opacity: 0.85;
}

.ds-component-badge:hover {
  opacity: 1;
  background: rgba(18, 18, 22, 0.98);
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.2);
}

.ds-component-badge .ds-badge-tag {
  color: #818cf8;
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
}

.ds-component-badge .ds-badge-name {
  color: #ffffff;
  font-weight: 600;
}

.ds-component-badge .ds-badge-desc {
  display: none;
  max-width: 260px;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: #a1a1aa;
  font-size: 9.5px;
  font-weight: 400;
  white-space: normal;
}

.ds-component-badge:hover .ds-badge-desc {
  display: inline;
}

/* Compact badge for nested cards and smaller items */
.ds-component-badge.ds-compact {
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  font-size: 9px;
  opacity: 0.6;
}

.ds-component-badge.ds-compact:hover {
  opacity: 1;
}

/* Hide annotations toggle mode */
body.hide-annotations .ds-component-badge {
  display: none !important;
}

/* Ensure smooth token transitions */
body, h1, h2, h3, h4, h5, h6, p, a, button, section, header, footer, div {
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
