.configPage {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  :global {
    .qwenpaw-slider-track {
      background-color: #ff7f16;
    }

    .qwenpaw-slider .qwenpaw-slider-handle::after {
      box-shadow: 0 0 0 2px #ff7f16;
    }

    .qwenpaw-tabs-nav {
      padding: 0 16px !important;
    }
  }
}

.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
}

/* ---- Main Tabs ---- */
.mainTabs {
  :global(.qwenpaw-tabs-nav) {
    margin-bottom: 20px;

    &::before {
      border-bottom: 1px solid #f0f0f0;
    }
  }

  :global(.qwenpaw-tabs-tab) {
    padding: 10px 4px;
    font-size: 14px;
    font-weight: 500;
    color: #666 !important;

    &:hover {
      color: #ff7f16 !important;
    }
  }

  :global(.qwenpaw-tabs-tab-active .qwenpaw-tabs-tab-btn) {
    color: #ff7f16 !important;
    font-weight: 600;
  }

  :global(.qwenpaw-tabs-ink-bar) {
    background: #ff7f16 !important;
    height: 3px;
    border-radius: 2px 2px 0 0;
  }
}

.tabLabel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.tabContent {
  padding: 0 16px;
}

.pageHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 20px;
  border-bottom: 1px solid #eae9e7;
  margin-bottom: 0;
}

.breadcrumbHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  flex: 1;
}

.breadcrumbParent {
  color: #999;
  font-weight: 400;
}

.breadcrumbSeparator {
  color: #ccc;
  margin: 0 4px;
}

.breadcrumbCurrent {
  color: #333;
  font-weight: 600;
  font-size: 20px;
}

.formCard {
  width: 100%;
}

.form {
  flex: 1;
  min-height: 0;

  :global {
    .ant-form-item-label > label {
      font-weight: 500;
    }
  }
}

/* ReAct Agent row layout */
.reactAgentRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.reactAgentField {
  margin-bottom: 0 !important;
}

/* LLM Retry row layout */
.llmRetryRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.llmRetryField {
  margin-bottom: 0 !important;
}

/* Slider overrides - remove theme color */
:global {
  .ant-slider-rail {
    background-color: rgba(20, 20, 19, 0.15) !important;
  }

  .ant-slider-track {
    background-color: rgba(20, 20, 19, 0.25) !important;
  }

  .ant-slider-handle::after {
    box-shadow: 0 0 0 2px rgba(20, 20, 19, 0.25) !important;
    background-color: #fff !important;
  }
}

:global(.dark-mode) {
  .ant-slider-rail {
    background-color: rgba(255, 255, 255, 0.15) !important;
  }

  .ant-slider-track {
    background-color: rgba(255, 255, 255, 0.25) !important;
  }

  .ant-slider-handle::after {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25) !important;
    background-color: #fff !important;
  }
}

/* formContainer kept for legacy reference */

.sliderValue {
  font-weight: 500;
  color: #1890ff;
}

.buttonGroup {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
  margin-bottom: 0;
}

.centerState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  gap: 16px;
}

.stateText {
  font-size: 14px;
  color: #666;
}

.stateTextError {
  font-size: 14px;
  color: #ff4d4f;
}

.footerActions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid #eae9e7;
  background: #fff;
  flex-shrink: 0;
}

/* ─── Dark mode ─────────────────────────────────────────────────────────────── */
:global(.dark-mode) {
  .pageHeader {
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .breadcrumbParent {
    color: rgba(255, 255, 255, 0.35);
  }

  .breadcrumbSeparator {
    color: rgba(255, 255, 255, 0.2);
  }

  .breadcrumbCurrent {
    color: rgba(255, 255, 255, 0.85);
  }

  .footerActions {
    background: #1f1f1f;
    border-top-color: rgba(255, 255, 255, 0.08);
  }

  .sliderValue {
    color: #ff7f16;
  }

  .mainTabs {
    :global(.qwenpaw-tabs-tab .qwenpaw-tabs-tab-btn) {
      color: #ffffff !important;
    }

    :global(.qwenpaw-tabs-tab-active .qwenpaw-tabs-tab-btn) {
      color: #ff7f16 !important;
      font-weight: 600;
    }

    :global(.qwenpaw-tabs-ink-bar) {
      background: #ff7f16 !important;
    }
  }
}

/* ─── Mobile responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pageHeader {
    padding: 12px 16px;
  }

  .breadcrumbCurrent {
    font-size: 16px;
  }

  .tabContent {
    padding: 0 12px;
  }

  .reactAgentRow {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .reactAgentField {
    margin-bottom: 12px !important;
  }

  .llmRetryRow {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .llmRetryField {
    margin-bottom: 12px !important;
  }

  .formCard {
    margin-bottom: 16px;
  }

  .footerActions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    justify-content: center;
  }

  .footerActions :global(.ant-btn) {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
  }

  .mainTabs {
    :global(.qwenpaw-tabs-nav) {
      overflow-x: auto;
      white-space: nowrap;
      -webkit-overflow-scrolling: touch;
    }
    :global(.qwenpaw-tabs-nav-list) {
      display: inline-flex;
      white-space: nowrap;
    }
  }
}
