/* Tenant Mix Section - Chart.js + GSAP Module */

.tenant-mix-section {
  background: var(--color-black);
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}

.tenant-mix-section .content-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.tenant-mix-headline {
  font-size: var(--section-header-size);
  font-weight: 400;
  color: var(--color-white);
  margin: 0 0 60px 0;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.2;
  transform-origin: left center;
  will-change: transform, opacity;
}

.tenant-mix-container {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 80px;
  align-items: stretch;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* Chart Column */
.tenant-mix-chart-column {
  position: relative;
  height: 670px;
}

.chart-container {
  position: relative;
  height: 670px;
  width: 100%;
  border-radius: 24px;
  padding: 24px 40px 0;
  transform-origin: center center;
  transform: scale(1.02);
  opacity: 1;
  /* Ensure chart is visible by default */
  visibility: visible;
  /* Ensure chart is visible by default */
  margin-top: -20px;
}

/* Details Column */
.tenant-mix-details-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tenant-mix-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tenant-category-row {
  background: transparent;
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
  overflow: hidden;
  /* Clip the category rule by border radius */
  width: calc(100% - 8rem);
  /* Fit exactly the full width of the column */
  box-sizing: border-box;
  /* Include padding and border in width calculation */
  max-width: 100%;
  transform-origin: center center;
  will-change: transform, opacity;
  display: flex;
  flex-direction: row;
  gap: 16px;
}

.category-text-area {
  flex: 0.9;
}

/* Ensure content inside rows doesn't force width expansion */
.tenant-category-row * {
  max-width: 100%;
  box-sizing: border-box;
}

.tenant-category-row:hover,
.tenant-category-row:focus {
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-2px) scale(1.02);
}

.tenant-category-row:hover .color-chip,
.tenant-category-row:focus .color-chip {
  transform: scale(1.2);
}

.tenant-category-row:hover .percent-badge,
.tenant-category-row:focus .percent-badge {
  transform: scale(1.05);
}

.tenant-category-row.active {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px) scale(1.01);
}

.tenant-category-row.active .color-chip {
  transform: scale(1.1);
}

.tenant-category-row.active .percent-badge {
  transform: scale(1.02);
}

.tenant-category-row:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.tenant-mix-section .content-inner .header-tag {
  color: #11c4d4;
}

.color-chip {
  width: 8px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
  transform-origin: center center;
}

.color-chip.healthcare {
  background: #11c4d4;
}

.color-chip.retail {
  background: #4fe7af;
}

.color-chip.qsr {
  background: #a142f4;
}

.color-chip.banking {
  background: #e6427a;
}

.category-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  max-width: 100%;
  min-width: 0;
  /* Allow flex item to shrink below content size */
}

.category-label {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-white);
  margin: 0;
}

.tenant-category-row[data-category='healthcare'] .category-label {
  color: #11c4d4;
}

.tenant-category-row[data-category='retail'] .category-label {
  color: #4fe7af;
}

.tenant-category-row[data-category='qsr'] .category-label {
  color: #a142f4;
}

.tenant-category-row[data-category='banking'] .category-label {
  color: #e6427a;
}

.percent-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-white);
  min-width: 48px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

.percent-badge.healthcare {
  background: rgba(17, 196, 212, 0.2);
}

.percent-badge.retail {
  background: rgba(79, 231, 175, 0.2);
}

.percent-badge.qsr {
  background: rgba(161, 66, 244, 0.2);
}

.percent-badge.banking {
  background: rgba(230, 66, 122, 0.2);
}

.category-subcopy {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 100%;
  word-wrap: break-word;
  /* Prevent long text from forcing width expansion */
}

.logo-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-items: center;
  justify-items: center;
  max-width: 100%;
  /* overflow: visible allows hovered logos to expand outside the grid */
  overflow: visible;
  flex: 0.4;
}

.logo-strip > *:nth-child(3):last-child {
  grid-column: 1 / span 2;
  justify-self: center;
}

.logo-strip > *:nth-child(1):last-child {
  grid-column: 1 / span 2;
  justify-self: center;
}

.tenant-logo {
  width: 100%;
  height: auto;
  max-height: 32px;
  object-fit: contain;
  opacity: 0.8;
  filter: grayscale(100%) brightness(1.2) contrast(0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
  transform-origin: center center;
}

.tenant-category-row.active .tenant-logo,
.tenant-category-row:hover .tenant-logo {
  opacity: 1;
  transform: scale(1.05);
}

.category-rule {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid transparent;
  border-radius: 16px;
  transform-origin: center center;
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: border-color;
  pointer-events: none;
}

.tenant-category-row.active .category-rule.healthcare {
  border-color: #11c4d4;
}

.tenant-category-row.active .category-rule.retail {
  border-color: #4fe7af;
}

.tenant-category-row.active .category-rule.qsr {
  border-color: #a142f4;
}

.tenant-category-row.active .category-rule.banking {
  border-color: #e6427a;
}

/* Mobile Accordion Controls */
.mobile-accordion-controls {
  display: none;
  justify-content: center;
  margin-top: 32px;
}

.reset-highlight-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

.reset-highlight-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px) scale(1.05);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .tenant-category-row,
  .tenant-logo,
  .category-rule,
  .reset-highlight-btn {
    transition: none;
  }

  .tenant-category-row:hover,
  .tenant-category-row:focus {
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Focus Styles for Accessibility */
.tenant-category-row:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.reset-highlight-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Chart.js Custom Styling */
.chart-container canvas {
  border-radius: 16px;
  width: 100% !important;
  height: 100% !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

/* Chart section highlighting glow effect */
.chart-container.highlighting {
  transform: scale(1.02);
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom Tooltip */
.tenant-mix-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: var(--color-white);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transform-origin: center center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tenant-mix-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tenant-mix-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}
