/* ==========================================================================
   Tandem Traffic Sources Page Section-Specific Styles
   ========================================================================== */

/* Hero Right Side Graphic positioning */
.traffic-hero-section {
  padding-bottom: 0;
}

.traffic-hero-media {
  position: relative;
  display: flex;
  justify-content: flex-end;
  /* Align portal to the right */
  width: 100%;
  z-index: 2;
}

.traffic-hero-media .has-glow {
  position: relative;
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  --glow-size: 550px;
  --glow-blur: 80px;
}

.traffic-hero-media .portal-img {
  width: 100%;
  max-width: 600px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 50px rgba(146, 58, 255, 0.2));
}

@media (max-width: 1280px) {
  .traffic-hero-media {
    justify-content: center;
  }

  .traffic-hero-media .portal-img {
    max-width: 480px;
  }
}

@media (max-width: 768px) {
  .traffic-hero-media .portal-img {
    max-width: 280px;
  }
}

/* --- Traffic Sources Ecosystem Section --- */
.sources-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: var(--space-md);
}

@media (max-width: 768px) {
  .sources-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-lg);
  }
}

.sources-row.partner-row {
  justify-content: flex-start;
  gap: var(--space-3xl);
}

@media (max-width: 768px) {
  .sources-row.partner-row {
    justify-content: center;
  }
}

.source-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
  flex: 1;
}

.source-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.ecosystem-cards-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
}

/* --- Traffic Sources Overview Section (Tabs) --- */
.tabs-interactive-grid {
  display: grid;
  grid-template-columns: 364px 1fr;
  gap: var(--space-3xl);
  width: 100%;
}

.tabs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-card-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sharp);
  color: var(--text-white);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-text);
  font-size: var(--fs-body);
  transition: all 0.3s ease;
}

.tab-button:hover {
  background: rgba(var(--white-rgb), 0.05);
  border-color: rgba(var(--white-rgb), 0.15);
}

.tab-button.active {
  background: linear-gradient(90deg, var(--active-gradient-start) 0%, var(--secondary-blue-purple) 100%);
  border-color: transparent;
}

.tab-button.active .tab-icon {
  filter: brightness(0) invert(1);
}

.tab-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  transition: filter 0.3s ease;
}

.tab-panels {
  display: flex;
  flex-direction: column;
  max-width: none;
  width: 100%;
}

.tab-panel {
  display: none;
  opacity: 0;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  opacity: 1;
}

.tab-panel p span.highlight-text {
  color: var(--outline-stroke-color);
  font-weight: 600;
}

/* --- Traffic Source Matching Section --- */
.matching-cards-wrapper {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  /* Align glass card to the top of the column */
  width: 100%;
}


.matching-graphic {
  right: 0;
  bottom: -300px;
  /* Shift below the card, overlapping its bottom part */
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 442px;
  --glow-size: 380px;
  --glow-blur: 70px;
}

.matching-img {
  width: 100%;
  max-width: 442px;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 var(--space-md) var(--space-xl) rgba(var(--primary-purple-rgb), 0.15));
}

@media (max-width: 1280px) {
  .matching-cards-wrapper {
    min-height: auto;
    justify-content: center;
  }

  .matching-graphic {
    bottom: -140px;
    transform: translateX(-50%);
    max-width: 320px;
  }
}

@media (max-width: 768px) {
  .matching-graphic {
    bottom: -80px;
    max-width: 200px;
  }
}

/* --- Traffic Quality Section --- */
.quality-cards-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.quality-cards-wrapper .glass-card {
  display: flex;
  flex-direction: column;
}

/* Tablet & Mobile responsive styles */
@media (max-width: 1024px) {
  .tabs-interactive-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .tabs-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    padding-bottom: var(--space-xs);
    /* space for smooth scrolling shadow */
    width: 100%;
  }

  .tabs-list::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
  }

  .tab-button {
    flex: 0 0 auto;
    /* Keep intrinsic size */
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-md);
    font-size: var(--fs-small);
    /* Design variable instead of hardcoded rem */
  }

  .tab-icon {
    width: 24px;
    height: 24px;
  }
}