// 全局变量定义
$primary-color: #165DFF;
$secondary-color: #6B7280;
$success-color: #00B42A;
$warning-color: #FFAA00;
$error-color: #F53F3F;
$text-primary: #333333;
$text-secondary: #666666;
$text-tertiary: #999999;
$border-color: #E5E7EB;
$bg-light: #F9FAFB;
$bg-white: #FFFFFF;
$shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
$shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
$shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

// 对话框容器
.project-dialog {
  min-width: 700px;
  border-radius: 12px;
  overflow: hidden;
  background-color: $bg-white;
}

// 对话框头部
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid $border-color;
  background-color: $bg-light;

  .dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: $text-primary;
    margin: 0;
  }

  .close-btn {
    color: $text-tertiary;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;

    &:hover {
      background-color: #E5E7EB;
      color: $text-secondary;
    }
  }
}

// 对话框内容
.dialog-content {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

// 表单样式
.project-form {
  .form-group {
    margin-bottom: 20px;

    .form-field {
      width: 100%;
      .mat-form-field-wrapper {
        .mat-form-field-flex {
          border-radius: 8px;
        }

        .mat-form-field-outline {
          border-radius: 8px;
        }

        .mat-form-field-infix {
          padding: 10px 0;

          input {
            font-size: 14px;
            color: $text-primary;
          }

          .mat-input-element {
            &::placeholder {
              color: $text-tertiary;
            }
          }
        }

        .mat-form-field-label {
          font-size: 14px;
          color: $text-secondary;
        }

        .mat-form-field-suffix {
          .mat-icon {
            color: $text-tertiary;
          }
          span {
            color: $text-tertiary;
            font-size: 14px;
          }
        }
      }
    }
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

// 进度显示区域
.progress-display {
  margin-top: 8px;
  margin-bottom: 20px;

  .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;

    .progress-label {
      font-size: 13px;
      color: $text-secondary;
      font-weight: 500;
    }
  }

  .progress-bar-container {
    height: 8px;
    background-color: $border-color;
    border-radius: 4px;
    overflow: hidden;

    .progress-bar {
      height: 100%;
      background-color: $primary-color;
      border-radius: 4px;
      transition: width 0.3s ease;
    }
  }
}

// 对话框底部
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid $border-color;
  background-color: $bg-light;

  .cancel-btn {
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: $text-secondary;
    background-color: $bg-white;
    border: 1px solid $border-color;
    transition: all 0.2s ease;

    &:hover {
      background-color: #F3F4F6;
      border-color: $text-tertiary;
    }
  }

  .save-btn {
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background-color: $primary-color;
    color: $bg-white;
    transition: all 0.2s ease;
    box-shadow: $shadow-sm;

    &:hover:not(:disabled) {
      background-color: #0E4BD8;
      box-shadow: $shadow-md;
      transform: translateY(-1px);
    }

    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .project-dialog {
    min-width: auto;
    width: 90vw;
    max-width: 600px;
  }

  .form-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .dialog-header,
  .dialog-content,
  .dialog-footer {
    padding: 16px;
  }

  .dialog-title {
    font-size: 16px !important;
  }

  .cancel-btn,
  .save-btn {
    padding: 6px 16px !important;
    font-size: 13px !important;
  }
}

// 滚动条样式
.dialog-content {
  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: $bg-light;
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background: $border-color;
    border-radius: 3px;
  }

  &::-webkit-scrollbar-thumb:hover {
    background: $text-tertiary;
  }
}