/* White-label styling for Tableau Embedded Analytics v3 */

.tblwl-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 520px;
  height: 100%;
}

.tblwl-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.tblwl-toolbar__btn {
  border: 1px solid #c8d7ea;
  background: #ffffff;
  color: #17324d;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tblwl-toolbar__btn:hover {
  border-color: #7ba8d9;
  background: #eef5fd;
}

.tblwl-toolbar__btn.is-active {
  border-color: #1a5fa8;
  background: #dceafe;
  color: #0f3f73;
}

.tblwl-host {
  position: relative;
  min-height: 480px;
  height: 100%;
  width: 100%;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f6fb;
  outline: none;
}

.tblwl-host:focus-visible {
  box-shadow: 0 0 0 3px #90b9e3;
}

.tblwl-viz {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 480px;
  border: 0;
  margin: 0;
  padding: 0;
  background: #ffffff;
}

/* Deep target to neutralize iframe chrome visual artifacts when host styles apply */
.tblwl-host iframe {
  border: 0 !important;
  box-shadow: none !important;
}

.tblwl-skeleton {
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    radial-gradient(1000px 360px at 10% -10%, rgba(26, 95, 168, 0.08), transparent 65%),
    radial-gradient(1000px 360px at 90% 110%, rgba(26, 95, 168, 0.07), transparent 65%),
    linear-gradient(180deg, #f5f8fc, #edf3f9);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  align-content: start;
}

.tblwl-skeleton__bar {
  grid-column: 1 / -1;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(90deg, #e9eef6 25%, #f5f8fc 37%, #e9eef6 63%);
  background-size: 400% 100%;
  animation: tblwl-shimmer 1.4s linear infinite;
}

.tblwl-skeleton__card {
  min-height: 115px;
  border-radius: 10px;
  background: linear-gradient(90deg, #e8eef5 25%, #f3f7fc 37%, #e8eef5 63%);
  background-size: 400% 100%;
  animation: tblwl-shimmer 1.4s linear infinite;
}

.tblwl-spinner {
  position: absolute;
  right: 1rem;
  bottom: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #d8e3f1;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  color: #264767;
  font-size: 0.78rem;
  font-weight: 600;
}

.tblwl-spinner__ring {
  width: 14px;
  height: 14px;
  border: 2px solid #c8d7ea;
  border-top-color: #1a5fa8;
  border-radius: 50%;
  animation: tblwl-spin 0.75s linear infinite;
}

.tblwl-host.is-interactive .tblwl-skeleton {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

@keyframes tblwl-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tblwl-shimmer {
  to {
    background-position: -100% 0;
  }
}

@media (max-width: 920px) {
  .tblwl-skeleton {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tblwl-shell {
    min-height: 420px;
  }

  .tblwl-host,
  .tblwl-viz {
    min-height: 400px;
  }

  .tblwl-skeleton {
    grid-template-columns: 1fr;
  }

  .tblwl-toolbar__btn {
    font-size: 0.78rem;
    padding: 0.38rem 0.66rem;
  }
}
