/* theme/assets/art-movements-hub.css */
/* Task 08 -- Hub Map: Premium Museum Light Mode Constellation & Navigation Enhancement */

:root {
  --hub-bg-canvas: #F8FAFC;
  --hub-bg-surface: #FFFFFF;
  --hub-bg-glass: rgba(255, 255, 255, 0.94);
  --hub-border: rgba(15, 23, 42, 0.12);
  --hub-border-focus: rgba(37, 99, 235, 0.65);
  --hub-text-main: #0F172A;
  --hub-text-muted: #475569;
  --hub-text-light: #64748B;
  --hub-accent-primary: #2563EB;
  --hub-accent-glow: rgba(37, 99, 235, 0.18);
  --hub-accent-hover: #1D4ED8;
  --hub-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --hub-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --hub-shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
}

#art-movements-hub-map:empty {
  display: none;
}

#art-movements-hub-map {
  width: 100%;
  margin: 12px 0 16px 0;
  box-sizing: border-box;
  position: relative;
  height: calc(100vh - var(--site-header-height, 68px) - 28px);
  min-height: 700px;
  background-color: var(--hub-bg-canvas, #F8FAFC);
  border-radius: 16px;
  border: 1px solid var(--hub-border);
  box-shadow: var(--hub-shadow-lg);
  overflow: clip;
  color: var(--hub-text-main);
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  display: flex;
  flex-direction: column;
}

@media (max-width: 767px) {
  #art-movements-hub-map {
    height: calc(100vh - var(--site-header-height, 68px) - 20px);
    min-height: 480px;
    border-radius: 8px;
    margin: 8px 0 12px 0;
  }
  .art-movements-hub-topbar {
    padding: 8px 12px;
    min-height: auto;
    gap: 8px;
  }
  .art-movements-hub-brand-title {
    font-size: 1rem;
  }
  .art-movements-hub-brand-sub {
    display: none;
  }
  .art-movements-hub-era-quickjump {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .art-movements-hub-era-quickjump::-webkit-scrollbar { display: none; }
  .dedicated-legend {
    width: 240px;
    font-size: 0.72rem;
    bottom: 12px;
    left: 12px;
    padding: 10px 12px;
  }
}

/* Sticky Header Wrapper for Hub Map */
.art-movements-hub-sticky-header {
  position: sticky;
  top: var(--site-header-height, 0px);
  z-index: 150;
  background: var(--hub-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hub-border);
  transition: box-shadow 0.25s ease;
  flex-shrink: 0;
}

.art-movements-hub-sticky-header.is-minimized {
  box-shadow: var(--hub-shadow-md);
}

/* Subtle Paper Grid Texture */
.art-movements-hub-ambient-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(124, 58, 237, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  z-index: 1;
}

/* Top Navigation & Controls Header */
.art-movements-hub-topbar {
  min-height: 68px;
  height: auto;
  padding: 12px 20px;
  background: transparent;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  z-index: 50;
  flex-shrink: 0;
  transition: padding 0.25s ease, min-height 0.25s ease, gap 0.25s ease;
}

.art-movements-hub-sticky-header.is-minimized .art-movements-hub-topbar {
  padding: 4px 20px;
  min-height: auto;
  gap: 0;
}

.art-movements-hub-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 320px;
}

.art-movements-hub-brand-logo {
  display: none;
}

.art-movements-hub-brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 680px;
}

.art-movements-hub-brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hub-text-main);
  line-height: 1.15;
  transition: font-size 0.25s ease;
  margin: 0;
}

.art-movements-hub-sticky-header.is-minimized .art-movements-hub-brand-title {
  display: none;
}

.art-movements-hub-brand-sub {
  font-size: 0.78rem;
  color: var(--hub-text-muted);
  font-weight: 500;
  line-height: 1.35;
  max-height: 120px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.art-movements-hub-sticky-header.is-minimized .art-movements-hub-brand-sub {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

/* Right Controls & Search */
.art-movements-hub-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.art-movements-hub-filter-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--hub-border);
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.art-movements-hub-filter-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--hub-text-main);
}

.art-movements-hub-filter-controls input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--hub-accent-primary);
}

.art-movements-hub-filter-controls input#chkShowRelatedMacro {
  accent-color: #10B981;
}

.hub-search-container {
  position: relative;
  width: 240px;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hub-search-container:focus-within {
  width: 320px;
}

.hub-search-input {
  width: 100%;
  height: 34px;
  padding: 6px 30px 6px 34px;
  border: 1px solid var(--hub-border, rgba(15, 23, 42, 0.12));
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--hub-text-main, #0F172A);
  font-size: 0.80rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.hub-search-input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
}

.hub-search-input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

.hub-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748B;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  transition: color 0.2s ease;
}

.hub-search-container:focus-within .hub-search-icon {
  color: #2563EB;
}

.hub-search-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.hub-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #F1F5F9;
  border: none;
  border-radius: 50%;
  color: #64748B;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.hub-search-clear:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* Enhanced Autocomplete Dropdown Menu with Era Section Groupings & Dates */
.hub-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 360px;
  max-width: 440px;
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  z-index: 10000;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 0;
  display: none;
  animation: hubSearchDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hubSearchDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hub-search-era-group {
  margin-bottom: 2px;
}

.hub-search-era-group:last-child {
  margin-bottom: 0;
}

.hub-search-era-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: #F8FAFC;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.hub-search-era-group:first-child .hub-search-era-header {
  border-top: none;
}

.hub-search-era-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hub-search-era-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.hub-search-era-count {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94A3B8;
  background: #FFFFFF;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.hub-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 8px 12px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, transform 0.1s ease;
  border-bottom: 1px solid rgba(15, 23, 42, 0.03);
  gap: 12px;
}

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

.hub-search-item:hover,
.hub-search-item.highlighted {
  background: #F1F5F9;
}

.hub-search-item-bar {
  width: 3px;
  height: 28px;
  border-radius: 999px;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
  opacity: 0.7;
}

.hub-search-item:hover .hub-search-item-bar,
.hub-search-item.highlighted .hub-search-item-bar {
  opacity: 1;
}

.hub-search-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.hub-search-item-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-search-item:hover .hub-search-item-title,
.hub-search-item.highlighted .hub-search-item-title {
  color: #2563EB;
}

.hub-search-item-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #64748B;
  font-weight: 500;
}

.hub-search-item-date {
  color: #64748B;
  font-weight: 500;
}

.hub-search-item-action {
  color: #94A3B8;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}

.hub-search-item:hover .hub-search-item-action,
.hub-search-item.highlighted .hub-search-item-action {
  opacity: 1;
  transform: translateX(0);
  color: #2563EB;
}

.hub-search-highlight {
  background: rgba(37, 99, 235, 0.15);
  color: #1D4ED8;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 700;
}

.hub-search-empty {
  padding: 20px 16px;
  text-align: center;
  color: #64748B;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hub-search-empty-text {
  font-size: 0.84rem;
  color: #334155;
  font-weight: 500;
}

.hub-search-empty-sub {
  font-size: 0.76rem;
  color: #94A3B8;
}

/* Mobile / Index Filter Box Styling */
.art-movements-hub-filter-wrapper {
  margin: 16px 0 24px 0;
}

.art-movements-hub-filter-box {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.art-movements-hub-search-input {
  width: 100%;
  height: 44px;
  padding: 10px 38px 10px 42px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 0.90rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
}

.art-movements-hub-search-input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), 0 4px 12px rgba(15, 23, 42, 0.08);
}

.art-movements-hub-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748B;
  pointer-events: none;
}

.art-movements-hub-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #F1F5F9;
  border: none;
  border-radius: 50%;
  color: #64748B;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.art-movements-hub-search-clear:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.art-movements-hub-search-count {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748B;
  margin-top: 8px;
}

.hub-action-btn {
  padding: 8px 14px;
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--hub-text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--hub-shadow-sm);
}

.hub-action-btn:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

/* Era Quick-Jump Bar (Split Buttons & Dropdowns) */
.art-movements-hub-era-quickjump {
  min-height: 48px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--hub-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 20px;
  z-index: 100;
  flex-shrink: 0;
  overflow: visible;
}

.hub-era-pill-btn {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--hub-border);
  background: #F8FAFC;
  color: var(--hub-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hub-era-pill-btn:hover {
  background: #F1F5F9;
  color: var(--hub-text-main);
  transform: translateY(-1px);
}

.hub-era-pill-btn.active {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Split Button Groups */
.hub-era-split-btn-group {
  display: inline-flex;
  align-items: stretch;
  position: relative;
  border-radius: 999px;
  border: 1px solid var(--hub-border);
  background: #F8FAFC;
  transition: all 0.2s ease;
}

.hub-era-split-btn-group:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.hub-era-split-btn-group.active {
  background: #2563EB;
  border-color: #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  z-index: 101;
}

.hub-era-split-btn-group.open-dropdown {
  z-index: 1000 !important;
}

.hub-era-pill-btn.main-split-btn {
  border: none;
  background: transparent;
  padding: 6px 12px 6px 14px;
  border-radius: 999px 0 0 999px;
  box-shadow: none;
  color: var(--hub-text-muted);
}

.hub-era-pill-btn.main-split-btn:hover {
  transform: none;
  color: var(--hub-text-main);
}

.hub-era-split-btn-group.active .hub-era-pill-btn.main-split-btn {
  color: #FFFFFF;
}

.hub-era-split-caret {
  border: none;
  border-left: 1px solid rgba(15, 23, 42, 0.1);
  background: transparent;
  padding: 6px 10px;
  border-radius: 0 999px 999px 0;
  font-size: 0.75rem;
  color: var(--hub-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hub-era-split-btn-group.active .hub-era-split-caret {
  border-left-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.hub-era-split-caret:hover,
.hub-era-split-caret.open {
  background: rgba(15, 23, 42, 0.08);
  color: var(--hub-text-main);
}

.hub-era-split-btn-group.active .hub-era-split-caret:hover,
.hub-era-split-btn-group.active .hub-era-split-caret.open {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

/* Dropdown Menu */
.hub-era-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 10000;
  min-width: 260px;
  max-width: 360px;
  max-height: 380px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
  padding: 6px 0;
  text-align: left;
}

.hub-era-dropdown-menu.open {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  animation: hubDropdownFadeIn 0.15s ease;
}

@keyframes hubDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hub-era-dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 8px 16px;
  color: var(--hub-text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.hub-era-dropdown-item:last-child {
  border-bottom: none;
}

.hub-era-dropdown-item:hover {
  background: #F8FAFC;
  color: #2563EB;
}

.hub-era-dropdown-item .period {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--hub-text-muted);
  margin-top: 2px;
}

/* Macro Map Canvas */
.art-movements-hub-canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

#art-movements-hub-map svg {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  cursor: grab;
}

#art-movements-hub-map svg:active {
  cursor: grabbing;
}

#art-movements-hub-map .node-label {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  fill: #0f172a;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95), 0 0 6px #ffffff;
  transition: opacity 0.2s ease;
}

/* Note: Floating Legend, Modals, Tooltips & Detail styles are imported from art-movements-shared.css */

/* Floating Hover Tooltip */
.art-movements-hub-tooltip {
  position: absolute;
  z-index: 100;
  display: none;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--hub-shadow-lg);
  max-width: 280px;
  color: var(--hub-text-main);
  font-family: inherit;
  transition: opacity 0.1s ease;
}

.art-movements-hub-tooltip-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hub-text-main);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.art-movements-hub-tooltip-era {
  font-size: 0.74rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  letter-spacing: 0.02em;
}

.art-movements-hub-tooltip-period {
  font-size: 0.74rem;
  color: var(--hub-text-light);
  margin: 0;
}

/* Active Highlight state for items below when selected on map */
.art-movements-hub-item.map-selected-item {
  background: #EFF6FF;
  border-radius: 6px;
  padding-left: 8px;
  padding-right: 8px;
  border-bottom: 1px solid #BFDBFE;
  transition: background 0.2s ease;
}

/* Page Title hidden on all viewports since it lives inside map header topbar */
.art-movements-hub-page-title {
  display: none !important;
}

/* Topbar actions (Search input + mobile filter button) */
.art-movements-hub-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.hub-mobile-filter-btn {
  display: none;
}

@media (max-width: 767px) {
  .art-movements-hub-topbar-actions {
    gap: 6px;
  }
  .art-movements-hub-era-quickjump .hub-search-container {
    width: 200px;
  }
  .art-movements-hub-era-quickjump .hub-search-container:focus-within {
    width: 240px;
  }
  .hub-mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--hub-border, rgba(15, 23, 42, 0.12));
    background: #FFFFFF;
    color: var(--hub-text-main, #0F172A);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
    flex-shrink: 0;
  }
  .hub-mobile-filter-btn:hover {
    background: #F8FAFC;
    border-color: #2563EB;
    color: #2563EB;
  }
  .hub-mobile-filter-btn.active {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  }
  .hub-mobile-filter-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  /* Era quickjump in top sticky header hidden by default on mobile */
  .art-movements-hub-era-quickjump {
    display: none;
  }
  .art-movements-hub-era-quickjump.mobile-open {
    display: flex;
    padding: 8px 12px;
  }
}