/**
 * Styles for Wallex MCP Commands widget.
 * @since 2.2.0
 */

.wallex-mcp-commands {
  display: block;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.wallex-mcp-commands *,
.wallex-mcp-commands *::before,
.wallex-mcp-commands *::after {
  box-sizing: border-box;
}

.wallex-mcp-commands__inner {
  display: flex;
  align-items: center;
  gap: var(--spacingS, 12px);
  position: relative;
  width: 100%;
}

.wallex-mcp-commands__nav {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--cornerRadiusCircular, 1000px);
  background-color: unset;
  border: unset;
  color: var(--color-text-1, #252525);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0;
  z-index: 5;
}

.wallex-mcp-commands__nav:hover:not(:disabled):not(.is-disabled) {
  background-color: var(--color-negativeGlassBg-2, rgba(0, 0, 0, 0.05));
  border-color: var(--color-stroke-3, rgba(0, 0, 0, 0.1));
}

.wallex-mcp-commands__nav:disabled,
.wallex-mcp-commands__nav.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.wallex-mcp-commands__nav svg {
  width: 20px;
  height: 20px;
}

.wallex-mcp-commands__track {
  display: flex;
  width: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.wallex-mcp-commands__track::-webkit-scrollbar {
  display: none;
}

.wallex-mcp-commands:not(.is-slider) .wallex-mcp-commands__track {
  overflow-x: hidden;
  scroll-snap-type: none;
}

.wallex-mcp-commands__page {
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--page-cols, 2), minmax(0, 1fr));
  grid-template-rows: repeat(var(--page-rows, 2), minmax(0, auto));
  gap: var(--spacingM, 16px);
  scroll-snap-align: start;
  box-sizing: border-box;
}

.wallex-mcp-commands__card {
  background-color: var(--color-bg, #ffffff);
  border: 1px solid var(--color-stroke-2, rgba(0, 0, 0, 0.05));
  border-radius: var(--cornerRadiusXL, 16px);
  padding: var(--spacingMNudge, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.wallex-mcp-commands__card:hover {
  border-color: var(--color-stroke-3, rgba(0, 0, 0, 0.1));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.wallex-mcp-commands__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacingS, 12px);
}

.wallex-mcp-commands__identity {
  display: flex;
  align-items: center;
  gap: var(--spacingS, 12px);
}

.wallex-mcp-commands__icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background-color: var(--color-bg-3, #e5f2ff);
  color: var(--color-primaryBrandText, #007aff);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wallex-mcp-commands__icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.wallex-mcp-commands__icon svg {
  width: 24px;
  height: 24px;
}

.wallex-mcp-commands__titles {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.wallex-mcp-commands__title {
  margin: 0;
  font-size: var(--body-large-size, 16px);
  font-weight: 500;
  line-height: var(--body-large-line-height, 28px);
  color: var(--color-text-1, #252525);
}

.wallex-mcp-commands__usage {
  font-size: var(--caption-size, 12px);
  color: var(--color-text-3, rgba(0, 0, 0, 0.4));
  line-height: var(--caption-line-height, 20px);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.wallex-mcp-commands__copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--cornerRadiusCircular, 1000px);
  background-color: var(--color-negativeGlassBg-2, rgba(0, 0, 0, 0.05));
  border: 1px solid var(--color-stroke-2, rgba(0, 0, 0, 0.05));
  color: var(--color-text-1, #252525);
  font-size: var(--caption-size, 12px);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 110px;
}

.wallex-mcp-commands__copy-btn:hover {
  background-color: var(--color-negativeGlassBg, rgba(0, 0, 0, 0.08));
}

.wallex-mcp-commands__copy-btn.is-copied {
  background-color: var(--color-bg-4);
  border-color: var(--color-bg-4);
}

.wallex-mcp-commands__copy-icon {
  width: 14px;
  height: 14px;
}

.wallex-mcp-commands__body {
  margin: var(--spacingM, 16px) 0;
  text-align: right;
}

.wallex-mcp-commands__desc {
  margin: 0;
  font-size: var(--body-size, 14px);
  line-height: var(--body-line-height, 24px);
  color: var(--color-text-1, rgba(0, 0, 0, 0.6));
}

.wallex-mcp-commands__footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.wallex-mcp-commands__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--cornerRadiusCircular, 1000px);
  font-size: var(--caption-size, 12px);
  font-weight: 500;
  line-height: 1;
}

.wallex-mcp-commands__badge-icon {
  width: 14px;
  height: 14px;
}

.wallex-mcp-commands__badge--no-key {
  background-color: var(--color-negativeGlassBg-2, rgba(0, 0, 0, 0.05));
  color: var(--color-text-2, rgba(0, 0, 0, 0.6));
}

.wallex-mcp-commands__badge--needs-key {
  background-color: var(--color-primaryBrandBg-4, #e5f2ff);
  color: var(--color-primaryBrandText, #007aff);
}

.wallex-mcp-commands__badge--custom {
  background-color: var(--color-bg-3, #f5f6f7);
  color: var(--color-text-1, #252525);
}

.wallex-mcp-commands__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--spacingM, 16px);
  z-index: 2;
}

.wallex-mcp-commands__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--cornerRadiusCircular, 1000px);
  background-color: var(--color-bg-4, #d7dadf);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wallex-mcp-commands__dot:hover {
  background-color: var(--color-text-3, rgba(0, 0, 0, 0.4));
}

.wallex-mcp-commands__dot.is-active {
  width: 20px;
}

@media (max-width: 767px) {
  .wallex-mcp-commands__inner {
    gap: 8px;
  }

  .wallex-mcp-commands__nav {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .wallex-mcp-commands__nav svg {
    width: 16px;
    height: 16px;
  }

  .wallex-mcp-commands__page {
    gap: 12px;
  }

  .wallex-mcp-commands__copy-text {
    display: none;
  }

  .wallex-mcp-commands__copy-btn {
    min-width: max-content;
    padding: 6px;
  }

  .wallex-mcp-commands__copy-icon {
    width: 24px;
    height: 24px;
  }

  .wallex-mcp-commands__nav {
    display: none !important;
  }
}