/* ==========================================================================
   Meron Art Movements — Storefront Shared Stylesheet
   Modals, floating canvas legends, hover tooltips, and common UI primitives.
   ========================================================================== */

/* 1. Floating Canvas Legend & FAB Minimizer */
.dedicated-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 310px;
  max-width: calc(100% - 40px);
  max-height: calc(100% - 40px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  z-index: 30;
  font-family: var(--font-body, "Inter", -apple-system, sans-serif);
  font-size: 0.78rem;
  color: #334155;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.dedicated-legend.minimized {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  visibility: hidden;
}

.dedicated-legend .legend-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F1F5F9;
}

.dedicated-legend .legend-heading {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0F172A;
}

.dedicated-legend .legend-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dedicated-legend .legend-help-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #2563EB;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dedicated-legend .legend-help-link:hover {
  color: #1D4ED8;
}

.dedicated-legend .legend-minimize {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #64748B;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.dedicated-legend .legend-minimize:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.dedicated-legend .legend-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  margin-bottom: 6px;
}

.dedicated-legend .legend-row {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  line-height: 1.35;
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.dedicated-legend .legend-row:hover {
  background: #F8FAFC;
}

.dedicated-legend .legend-row.active {
  opacity: 1;
  color: #0F172A;
}

.dedicated-legend .legend-row.inactive {
  opacity: 0.38;
  color: #94A3B8;
}

.dedicated-legend .legend-row.inactive .legend-line-sample {
  filter: grayscale(1);
  opacity: 0.5;
}

.dedicated-legend .legend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 6px;
}

.dedicated-legend .legend-grid-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  min-width: 0;
}

.dedicated-legend .legend-era-label {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dedicated-legend .legend-grid-item:hover {
  background: #F8FAFC;
}

.dedicated-legend .legend-grid-item.active {
  opacity: 1;
  color: #0F172A;
}

.dedicated-legend .legend-grid-item.inactive {
  opacity: 0.38;
  color: #94A3B8;
}

.dedicated-legend .legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dedicated-legend .legend-grid-item.inactive .legend-color-dot {
  opacity: 0.4;
  transform: scale(0.85);
}

/* Legend Floating Action Button (FAB) */
.legend-fab {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: #0F172A;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  z-index: 19;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.legend-fab.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.legend-fab:hover {
  background: #1E293B;
}

/* Reset Zoom Floating Button */
.reset-zoom-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 15;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.15s ease;
}

.reset-zoom-btn:hover {
  background: #FFFFFF;
  color: #0F172A;
  border-color: #CBD5E1;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* 2. Modals & Overlay (#legendModal & #detailModal) */
.legend-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.legend-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.legend-modal {
  position: relative;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.25);
  font-family: var(--font-body, "Inter", -apple-system, sans-serif);
}

.legend-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.legend-modal-close:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.lm-heading {
  font-family: var(--font-heading, "Outfit", sans-serif);
  font-size: 1.4rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.lm-intro {
  font-size: 0.9rem;
  color: #64748B;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

.lm-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.lm-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.lm-glyph {
  font-size: 1.3rem;
  line-height: 1.2;
  color: #2563EB;
  font-weight: 700;
  min-width: 24px;
}

.lm-text {
  flex: 1;
}

.lm-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0F172A;
}

.lm-line {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748B;
}

.lm-detail {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.45;
  margin-top: 2px;
}

.lm-node-color {
  font-size: 0.82rem;
  color: #64748B;
  border-top: 1px solid #F1F5F9;
  padding-top: 14px;
  margin: 0;
}

/* Detail Modal Formatting (#detailModalBody) */
.detail-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2563EB;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.detail-explain {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 16px;
  background: #F8FAFC;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid #cbd5e1;
}

.detail-note {
  font-size: 0.92rem;
  color: #1E293B;
  line-height: 1.6;
  margin-bottom: 12px;
}

.detail-note:last-of-type {
  margin-bottom: 16px;
}

.detail-sources {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #F1F5F9;
}

.detail-sources-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  margin-bottom: 8px;
}

.detail-source-link {
  display: inline-block;
  font-size: 0.82rem;
  color: #2563EB;
  text-decoration: none;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 4px 10px;
  border-radius: 6px;
  margin-right: 6px;
  margin-bottom: 6px;
  transition: all 0.15s ease;
}

.detail-source-link:hover {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

/* 3. Hover Tooltip Base (#hoverTooltip) */
.hover-tooltip,
.art-movements-shared-tooltip,
.art-movements-hub-tooltip,
.movement-lineage-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 100000;
  display: none;
  opacity: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
  max-width: 280px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  font-family: var(--font-body, "Inter", -apple-system, sans-serif);
  color: #0F172A;
  transition: opacity 0.1s ease;
  transform: none !important;
  margin: 0 !important;
}

/* 4. Integrated Header Breadcrumbs (Shared for Node View & Hub Map) */
.integrated-header-breadcrumbs {
  display: block;
  width: 100%;
  margin: 0 0 6px 0;
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
}

.ih-breadcrumbs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  line-height: 1.2;
}

.ih-breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.ih-breadcrumb-link {
  color: #64748b;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.ih-breadcrumb-link:hover {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ih-home-icon {
  display: block;
  color: #64748b;
  transition: color 0.15s ease;
}

.ih-breadcrumb-link:hover .ih-home-icon {
  color: #2563eb;
}

.ih-breadcrumb-separator {
  display: inline-block;
  margin: 0 8px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  user-select: none;
}

.ih-breadcrumb-current span {
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 600;
}

