/* Treemap Share Dialog Styles */

/* Chip active state */
.share-option-chip {
  border: 1px solid var(--border-muted) !important;
  background: var(--input-bg) !important;
  color: var(--text) !important;
}

.share-option-chip.active {
  background: var(--accent) !important;
  color: var(--button-text) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 2px 4px rgba(43, 212, 255, 0.2);
}

.share-option-chip:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  border-color: var(--accent) !important;
}

/* Share button responsive - show only icons on very small screens */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.share-btn-icon {
  flex-shrink: 0;
}

.share-btn-text {
  flex-shrink: 0;
}

/* Share buttons - expand equally to fill footer width */
.share-btn {
  min-width: 40px;
  padding: 6px 10px;
  flex: 1 1 0;
  max-width: none;
  font-size: 11px;
  gap: 6px;
  justify-content: center;
}

.share-btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.share-btn-text {
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Hide text on smaller screens, show icons only */
@media (max-width: 500px) {
  .share-btn-text {
    display: none;
  }
  .share-btn {
    padding: 6px;
    min-width: 44px;
  }
}

/* Display options slider on small screens */
@media (max-width: 480px) {
  .display-mode-slider {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  .display-mode-slider::-webkit-scrollbar {
    height: 4px;
  }
  
  .display-mode-slider::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
  }
}

/* Compare period slider on small screens */
.compare-period-slider {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.compare-period-slider::-webkit-scrollbar {
  height: 4px;
}

.compare-period-slider::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

/* Share buttons scrollable on mobile - always allow horizontal scroll */
.dlg-f > div {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.dlg-f > div::-webkit-scrollbar {
  height: 4px;
}

.dlg-f > div::-webkit-scrollbar-track {
  background: transparent;
}

.dlg-f > div::-webkit-scrollbar-thumb {
  background: var(--border-muted);
  border-radius: 2px;
}

/* Fullscreen dialog styles */
#treemapShareDialog[data-fullscreen] {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
}

/* Treemap share preview cards */
.treemap-share-card {
  position: relative;
  overflow: hidden;
}

.treemap-share-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  pointer-events: none;
}

.treemap-share-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
}

/* Ensure preview container is visible */
#treemapSharePreview {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 300px;
  width: 100%;
  box-sizing: border-box;
}

#treemapSharePreview > div {
  width: 100%;
  display: block;
}

/* Treemap items in share preview - match app.js styling */
#treemapSharePreview .treemap-item {
  aspect-ratio: unset !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 80px !important;
  min-height: 80px !important;
  position: absolute !important;
  z-index: 1;
  margin: 0 !important;
  gap: 0 !important;
  cursor: default !important;
}

#treemapSharePreview .treemap-item:hover {
  transform: scale(1.01);
  z-index: 20;
  box-shadow: 0 0 0 2px var(--accent), 0 4px 16px rgba(43, 212, 255, 0.3) !important;
}

/* Color tiers for treemap items */
#treemapSharePreview .treemap-item[data-tier="red"] {
  background: linear-gradient(135deg, rgba(240, 82, 82, 0.45) 0%, rgba(220, 38, 38, 0.35) 100%) !important;
  border-left: 4px solid rgba(255, 107, 107, 0.9) !important;
  color: #FFD1D1 !important;
  box-shadow: inset 0 0 20px rgba(240, 82, 82, 0.2) !important;
}

#treemapSharePreview .treemap-item[data-tier="amber"] {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.45) 0%, rgba(245, 158, 11, 0.35) 100%) !important;
  border-left: 4px solid rgba(255, 193, 7, 0.9) !important;
  color: #FFE8A3 !important;
  box-shadow: inset 0 0 20px rgba(251, 191, 36, 0.2) !important;
}

#treemapSharePreview .treemap-item[data-tier="green"] {
  background: linear-gradient(135deg, rgba(35, 209, 139, 0.45) 0%, rgba(22, 163, 74, 0.35) 100%) !important;
  border-left: 4px solid rgba(74, 222, 128, 0.9) !important;
  color: #A7F3D0 !important;
  box-shadow: inset 0 0 20px rgba(35, 209, 139, 0.2) !important;
}

