/**
 * KRA - Settings Drawer Styles
 */

.kra-setting-drawer {
  .ant-drawer-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
  }

  .ant-drawer-body {
    padding: 0;
  }
}

.kra-setting-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.kra-setting-tabs {
  .ant-tabs-nav {
    margin-bottom: 0;
    padding: 8px 24px;
    background: #fafafa;
  }

  .ant-tabs-content-holder {
    padding: 16px 24px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
  }
}

.kra-setting-content {
  padding-bottom: 24px;
}

.kra-setting-section {
  margin-bottom: 32px;

  &:last-child {
    margin-bottom: 0;
  }
}

.kra-setting-section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.kra-setting-divider {
  flex: 1;
  height: 1px;
  background: #e8e8e8;
}

.kra-setting-section-title {
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

.kra-setting-card {
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 16px;
}

// Setting Item
.kra-setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;

  &:last-child {
    border-bottom: none;
  }
}

.kra-setting-item-label {
  display: flex;
  flex-direction: column;
}

.kra-setting-label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.kra-setting-description {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

// Theme Mode Selector
.kra-theme-mode-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 8px;
}

.kra-theme-mode-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 80px;
  color: #666;

  &:hover {
    background: #e8e8e8;
  }

  &.active {
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  .anticon {
    font-size: 20px;
    margin-bottom: 4px;
  }

  span {
    font-size: 12px;
    font-weight: 500;
  }
}

// Theme Color Picker
.kra-theme-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.kra-color-item {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

  &:hover {
    transform: scale(1.1);
  }

  &.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor;
  }

  .anticon {
    font-size: 16px;
  }
}


// Layout Mode Selector
.kra-layout-mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.kra-layout-mode-item {
  position: relative;
  background: #fff;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  &.active {
    border-width: 2px;
  }
}

.kra-layout-preview {
  height: 60px;
  background: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  margin-bottom: 8px;

  .preview-side {
    width: 20px;
    background: #1890ff;
  }

  .preview-main {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .preview-header {
    height: 12px;
    background: #e8e8e8;
  }

  .preview-content {
    flex: 1;
    background: #fff;
  }

  .preview-top-header {
    height: 12px;
    background: #1890ff;
  }

  .preview-body {
    flex: 1;
    background: #fff;
  }
}

.kra-layout-mode-title {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #666;
}

.kra-layout-mode-check {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
}

// Size Config
.kra-size-config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  margin-bottom: 12px;

  &:last-child {
    margin-bottom: 0;
  }
}

.kra-size-config-info {
  h4 {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px 0;
  }

  p {
    font-size: 12px;
    color: #999;
    margin: 0;
  }
}

.kra-size-config-control {
  display: flex;
  align-items: center;
  gap: 8px;

  .unit {
    font-size: 12px;
    color: #999;
  }
}

// System Info Grid
.kra-system-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.kra-system-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;

  &:nth-last-child(-n+2) {
    border-bottom: none;
  }

  .label {
    font-size: 13px;
    color: #666;
  }

  .value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    font-family: monospace;
  }
}

// Config Action Items
.kra-config-action-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.2s;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  &:last-child {
    margin-bottom: 0;
  }
}

.kra-config-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;

  &.danger {
    background: #fff1f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
  }

  &.primary {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
  }

  &.success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
  }
}

.kra-config-action-info {
  flex: 1;

  h4 {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px 0;
  }

  p {
    font-size: 12px;
    color: #999;
    margin: 0;
  }
}

// About Project
.kra-about-project {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.kra-about-logo {
  width: 64px;
  height: 64px;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.kra-about-info {
  flex: 1;

  h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
  }

  p {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 12px 0;
  }
}

.kra-about-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;

  a {
    color: #1890ff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;

    &:hover {
      text-decoration: underline;
    }
  }

  .divider {
    color: #d9d9d9;
  }
}

// Dark mode support
:global(.dark) {
  .kra-setting-drawer {
    .ant-drawer-header {
      border-color: #303030;
    }
  }

  .kra-setting-tabs {
    .ant-tabs-nav {
      background: #1f1f1f;
    }
  }

  .kra-setting-section-title {
    color: #999;
  }

  .kra-setting-divider {
    background: #303030;
  }

  .kra-setting-card {
    background: #1f1f1f;
    border-color: #303030;
  }

  .kra-setting-label {
    color: #e8e8e8;
  }

  .kra-setting-item {
    border-color: #303030;
  }

  .kra-theme-mode-selector {
    background: #262626;
  }

  .kra-theme-mode-item {
    color: #999;

    &:hover {
      background: #303030;
    }
  }

  .kra-layout-mode-item {
    background: #262626;
    border-color: #303030;
  }

  .kra-layout-preview {
    background: #1f1f1f;

    .preview-header {
      background: #303030;
    }

    .preview-content,
    .preview-body {
      background: #262626;
    }
  }

  .kra-layout-mode-title {
    color: #999;
  }

  .kra-size-config-item,
  .kra-config-action-item {
    background: #262626;
    border-color: #303030;
  }

  .kra-size-config-info,
  .kra-config-action-info {
    h4 {
      color: #e8e8e8;
    }
  }

  .kra-system-info-item {
    border-color: #303030;

    .value {
      color: #e8e8e8;
    }
  }

  .kra-about-logo {
    background: #262626;
    border-color: #303030;
  }

  .kra-about-info {
    h4 {
      color: #e8e8e8;
    }

    p {
      color: #999;
    }
  }
}
