/**
 * Audience Tabs Animation - EXACT MATCH to map legend animation properties 
 * while preserving existing tab styles
 * Created for Ashton Gray Development - 2025
 */

/* EXACTLY match map-legend-navigation */
.audience-tabs {
  justify-content: center;
  margin-bottom: 2.5rem;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  opacity: 0;
  display: none;
  position: fixed;
  z-index: 100;
  /* CSS variables for ultra smooth transitions - EXACTLY match map legend */
  --tab-bg-gradient: linear-gradient(135deg,
      var(--gradient-blue),
      var(--gradient-orange-hover));
  --tab-bg-color: rgb(18, 18, 18);
  --tab-bg-opacity: 1;
  --tab-glow-opacity: 0;
  --tab-glow-spread: 0px;
  --tab-glow-color: rgba(85, 143, 255, 0.8);
  padding-top: 1rem;
}

/* Ensures tabs are centered in the contact section */
.audience-tabs {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
}

/* Visible state - EXACTLY like map legend */
.audience-tabs.visible {
  opacity: 1;
  display: flex;
}

/* EXACTLY match map-legend-wrapper - Glassmorphism */
.audience-tabs-wrapper {
  padding: 0.3rem 0.3rem;
  display: inline-flex;
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 50%;

  /* Glassmorphism foundation */
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 var(--tab-glow-spread) var(--tab-glow-color);

  /* Gradient border */
  --border-angle: 135deg;
  border: none;

  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gradient border for glassmorphism */
.audience-tabs-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(var(--border-angle, 135deg),
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.1) 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.audience-tabs-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--tab-bg-gradient);
  opacity: var(--tab-bg-opacity);
  z-index: -2;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Audience-specific indicator colors - matching accordion */
.audience-indicator[data-audience='realestate'] {
  background: rgba(85, 143, 255, 0.1);
  /* antique gold with opacity - matching accordion */
  box-shadow: 0 0 15px rgba(85, 143, 255, 0.1);
  border: 1px solid rgba(85, 143, 255, 0.3);
}

.audience-indicator[data-audience='investors'] {
  background: rgba(126, 228, 179, 0.15);
  /* sage green with opacity - matching accordion */
  box-shadow: 0 0 15px rgba(126, 228, 179, 0.1);
  border: 1px solid rgba(126, 228, 179, 0.3);
}

/* Circle state - EXACT MATCH to map legend */
.audience-tabs-wrapper.circle {
  width: 40px;
  height: 40px;
  transform: scale(0);
  opacity: 0;
  border-radius: 50%;
  margin: 0 auto;
}

/* Expanded state - EXACT MATCH to map legend */
.audience-tabs-wrapper.expanded {
  transform: scale(1);
  opacity: 1;
  border-radius: 3rem;
  width: 100%;
  max-width: 450px;
}

/* EXACT MATCH to map legend button states */
.audience-tabs-wrapper.circle .audience-tab {
  opacity: 0;
  pointer-events: none;
}

.audience-tabs-wrapper.expanded .audience-tab {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s ease 0.3s;
  /* EXACT MATCH - delayed reveal */
}

/* EXACT MATCH to map legend indicator states */
.audience-tabs-wrapper.circle .audience-indicator {
  opacity: 0;
}

.audience-tabs-wrapper.expanded .audience-indicator {
  opacity: 1;
  transition: opacity 0.3s ease 0.3s,
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* EXACT MATCH to map legend placeholder */
.audience-tabs-placeholder {
  height: 0px;
  margin-bottom: 2.5rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.audience-tabs-placeholder.active {
  visibility: visible;
  opacity: 1;
}

/* Maintain existing tag styles from contact.css */
.audience-tab {
  opacity: 0;
  /* Initially hidden until animation completes */
  transition: opacity 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  flex: 1;
  min-width: 140px;
  /* Ensure each tab has enough width with just two tabs */
}

.audience-tab:hover {
  color: white;
}

/* Active tab colors - matching accordion */
.audience-tab.active[data-audience='realestate'] {
  color: var(--cyan) !important;
  /* Antique gold - matching accordion */
}

.audience-tab.active[data-audience='investors'] {
  color: var(--teal) !important;
  /* Sage green - matching accordion */
}

/* Responsive styles */
@media (max-width: 768px) {
  .audience-tabs {
    width: 100% !important;
  }

  .audience-tab {
    min-width: 120px;
    padding: 0.7rem 2rem;
    font-size: 0.95rem;
  }
}